Skip to content

Prevent construction of multifusion tensors with incompatible coloring - #515

Open
borisdevos wants to merge 16 commits into
mainfrom
bd/fusiontree-iterate
Open

Prevent construction of multifusion tensors with incompatible coloring#515
borisdevos wants to merge 16 commits into
mainfrom
bd/fusiontree-iterate

Conversation

@borisdevos

@borisdevos borisdevos commented Aug 26, 2026

Copy link
Copy Markdown
Member

Deals with #514, at least partially.
Now we have

julia> Wis
(Vect[IsingBimodule]((1, 1, 0) => 1)  Vect[IsingBimodule]((1, 1, 0) => 1))  Vect[IsingBimodule]((2, 2, 0) => 1)

julia> blocksectors(Wis)
0-element Dictionaries.Indices{IsingBimodule}

which behaves the same way as

julia> Wu1
Rep[U₁](1 => 1)  (Rep[U₁](0 => 1)  Rep[U₁](0 => 1))

julia> blocksectors(Wu1)
0-element Dictionaries.Indices{U1Irrep}

Edit: decided to actually prevent construction of these kinds of tensors at the level of the product space and hom space.
Since this was incompatible with the previous implementation of unitspace, this now errors for GenericUnit sector types.

@lkdvos lkdvos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do think this is probably quite a big performance hit right in the hot path of the fusiontree constructors though, I don't think there is typically a fast implementation of this. Additionally, I was kind of expecting to convert more things to Nsymbol, to actually make them error if the fusion is disallowed?

@borisdevos

Copy link
Copy Markdown
Member Author

I'm misunderstanding then what kind of behavior we want. So we want Nsymbol checks there, such that forbidden fusion trees shouldn't ever be able to be looked at? And then at the tensor construction level, when colors mismatch this should throw an error, thus preventing constructing forbidden tensors?

@lkdvos

lkdvos commented Aug 26, 2026

Copy link
Copy Markdown
Member

I think that was what I was expecting, especially since we decided Nsymbol errors instead of returning 0

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/spaces/gradedspace.jl 92.57% <100.00%> (+22.45%) ⬆️
src/spaces/homspace.jl 92.98% <100.00%> (+3.93%) ⬆️
src/spaces/productspace.jl 88.75% <100.00%> (+16.78%) ⬆️
src/spaces/vectorspaces.jl 71.31% <100.00%> (+25.03%) ⬆️
src/tensors/tensoroperations.jl 97.37% <100.00%> (+6.79%) ⬆️

... and 51 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@borisdevos borisdevos changed the title Replace Nsymbol calls or add guards in fusion tree iteration Prevent construction of multifusion tensors with incompatible coloring Sep 2, 2026

@lkdvos lkdvos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other than the comments, looks good, thanks for looking into this!

Comment thread src/spaces/gradedspace.jl Outdated
Comment thread src/spaces/productspace.jl Outdated
Comment thread src/spaces/productspace.jl Outdated
Comment thread src/spaces/homspace.jl
Comment thread src/spaces/vectorspaces.jl
Comment thread src/spaces/gradedspace.jl
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.

3 participants