Skip to content

add AbstractGroupElement and ZNElement#19

Merged
kshyatt merged 11 commits intomainfrom
jh/znelement
Aug 22, 2025
Merged

add AbstractGroupElement and ZNElement#19
kshyatt merged 11 commits intomainfrom
jh/znelement

Conversation

@Jutho
Copy link
Member

@Jutho Jutho commented Jul 28, 2025

Build the foundation for adding sectors corresponding to group elements, in order to use $\mathrm{Vec}_{\mathsf{G}}^\omega$ categories, and explicitly implement the case of $\mathbb{Z}_N$, which will be useful for testing purposes of UniqueFusion sectors with nontrivial Fsymbol values.

Potentially of interest to @lalooten, @Chenqitrg , @borisdevos .

@Jutho Jutho requested a review from lkdvos July 28, 2025 23:08
@codecov
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 79.41176% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/groupelements.jl 78.12% 14 Missing ⚠️
Files with missing lines Coverage Δ
src/TensorKitSectors.jl 16.66% <ø> (ø)
src/irreps.jl 95.43% <100.00%> (ø)
src/sectors.jl 89.24% <100.00%> (ø)
src/groupelements.jl 78.12% <78.12%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
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.

Left a few comments, but overall looks good to me! Could probably do with some minor reformatting and making sure the docstrings are all up to date though.

@Jutho
Copy link
Member Author

Jutho commented Jul 29, 2025

I will update the PR tonight, as I still have to install the Runic formatter in my VSCode at the office.

@Jutho
Copy link
Member Author

Jutho commented Jul 30, 2025

Ok, with some delay, here are the updates. I also figured out and implemented the correct braiding rules for the ZNElement{p} case, which in the end was quite simple. It took me more time to discover that there was actually an error (not that it matters) in the hexagon_equations, at least according to the convention for Rsymbol that we use in the documentation and manual. Rsymbol(a, b, c) is the coefficient you get when you apply a braid to a splitting tensor with first (left) output a and second (right) output b, and coupled sector c, i.e. when denoting the fusiontensor objects as X(a, b, c), the relation is

$$\tau_{1, 2} \circ X(a, b, c) = R(a, b, c) X(b, a, c)$$

But this was not how it was used in the hexagon_equations, i.e. a and b were reversed. However, for all the sectors we currently test, this does not matter.

@Jutho
Copy link
Member Author

Jutho commented Jul 30, 2025

I don't understand the JET error, nor why it only happens on Julia latest on Mac and Ubuntu.

Copy link
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.

Looks more or less good to go for me, I also can't say I understand the JET error. I'm wondering if it is complaining that no type_repr implementation exists for the abstract group element supertype?

if p == 0
R = 1
elseif N == 2 && p == 1
R = ifelse(a.n == b.n == 1, -1.0, 1.0)
Copy link
Member

Choose a reason for hiding this comment

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

In principle we could specialize the cocycle and Rsymbol for this case to return $\pm1$ as Int if I'm not mistaken, but this might not really be worth it

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I had this at first. But it seems that also for SU2Irrep we return ±1.0 so I opted for floating point. Of course, in that case the Fsymbol definitely needs floating point numbers, so yes, the N ==2 && p == 1 case could use integers for both Fsymbol (cocycle) and Rsymbol.

@Jutho
Copy link
Member Author

Jutho commented Jul 30, 2025

Looks more or less good to go for me, I also can't say I understand the JET error. I'm wondering if it is complaining that no type_repr implementation exists for the abstract group element supertype?

That's also what I think. Not sure if there is a better or cleaner way to do this.

@Jutho
Copy link
Member Author

Jutho commented Jul 30, 2025

This is very weird, the latest commit, which was just a code suggestion in a doc string, completely changed the CI results, again because of the JET error. That doesn't seem right.

@Jutho
Copy link
Member Author

Jutho commented Jul 30, 2025

Ok, actually the cocycles were having an incorrect factor $1/N$ instead of $1/N^2$, which made them all trivial. This is now correct, and also makes that the N==2 && p==1 case is no longer fermionic, but anyonic (twist = i). This is what I indeed thought, because that should be the semion.

@kshyatt
Copy link
Member

kshyatt commented Aug 21, 2025

FWIW the Jet error doesn't occur for me just now with Julias 1.10 or 1.11 on OSX. Let me try rebasing this and we'll see how CI does...

@lkdvos
Copy link
Member

lkdvos commented Aug 22, 2025

I guess we still don't have any idea what's going on here? Any ideas on circumventing the issue?

@kshyatt
Copy link
Member

kshyatt commented Aug 22, 2025

I have one, do you mind if I try some CI based debugging? I can't replicate this locally on macOS or Linux...

@lkdvos
Copy link
Member

lkdvos commented Aug 22, 2025

Of course, go ahead!

@kshyatt
Copy link
Member

kshyatt commented Aug 22, 2025

This fixed the problem for me locally on a linux box, 🙏

@borisdevos
Copy link
Member

Same here on Windows!

@kshyatt kshyatt enabled auto-merge (squash) August 22, 2025 11:03
@kshyatt kshyatt merged commit 1180232 into main Aug 22, 2025
7 of 8 checks passed
@kshyatt kshyatt deleted the jh/znelement branch August 22, 2025 11:10
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.

5 participants