Skip to content

define spacetype for TruncationSpace#403

Open
ogauthe wants to merge 7 commits intoQuantumKitHub:mainfrom
ogauthe:trunc_spacetype
Open

define spacetype for TruncationSpace#403
ogauthe wants to merge 7 commits intoQuantumKitHub:mainfrom
ogauthe:trunc_spacetype

Conversation

@ogauthe
Copy link
Copy Markdown
Contributor

@ogauthe ogauthe commented Apr 16, 2026

This PR defines spacetype for TruncationSpace and adds a test that spacetype matches between the vector to truncate and the strategy (else it will crash with a hard to read error). I expect the check to be done at compile time without any consequence on assembly code.

Copy link
Copy Markdown
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely okay with this change, but would you mind changing the @assert to throw(SpaceMismatch("spacetype of truncation strategy does not match spacetype of tensor")) (or a better worded message if you have inspiration, just quickly typed something here)

Copy link
Copy Markdown
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(you are right, sectortype is more appropriate :))

Comment thread src/factorizations/truncation.jl Outdated
Comment thread src/factorizations/truncation.jl Outdated
lkdvos
lkdvos previously approved these changes Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants