-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
define nsymbol #4
base: main
Are you sure you want to change the base?
Conversation
Maybe as an alternative, if we had an API for getting the block length associated with a certain sector it would be easy enough to write this function outside of the library. I.e. we could redefine r = gradedrange([U1(0) => 2, U1(1) => 3])
blocklengths(r)[U1(1)] == 3 (or I guess it would output Then, the logic of not being sure if the sector exists can be handled by the standard Julia API That is analogous to how in julia> a = BlockedArray(randn(5, 5), [2, 3], [2, 3])
2×2-blocked 5×5 BlockedMatrix{Float64}:
0.0903129 1.48556 │ 0.210218 0.36306 0.327547
-1.16907 -1.51292 │ 0.38288 1.82632 -1.43893
──────────────────────┼──────────────────────────────────
-0.268323 -1.16097 │ 1.18574 0.258269 0.362909
-0.37301 0.90419 │ -0.552486 -0.218437 -0.0195218
2.22222 -1.60995 │ -0.704768 -0.317308 0.0766319
julia> blocksizes(a)
2×2 BlockArrays.BlockSizes{Tuple{Int64, Int64}, 2, BlockedMatrix{Float64, Matrix{Float64}, Tuple{BlockedOneTo{Int64, Vector{Int64}}, BlockedOneTo{Int64, Vector{Int64}}}}}:
(2, 2) (2, 3)
(3, 2) (3, 3) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4 +/- ##
======================================
Coverage ? 0.00%
======================================
Files ? 12
Lines ? 412
Branches ? 0
======================================
Hits ? 0
Misses ? 412
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Would you like me to wait for this PR, or shall I already register a version for convenience? |
Is |
Go ahead and register the latest main, I want to use it in ITensor/BlockSparseArrays.jl#10. |
I am not sure how standard it is, but it is quite common to write something like this for decomposing tensor products (or category theory decompositions) This data is what qualifies the fusion ring of the irreps (or simple objects), ie how these multiply. For example the notation is here, and of course TensorKit has On the other hand, the fusion category bible just talks about fusion rings, and doesn't actually name the coefficients. In any case, I would say that this is definitely a convenient concept to have a shorthand function for, since it is quite often that you need to loop over |
I see, thanks for clarifying. The notation I also see that in many cases you can directly get the number and circumvent getting all of the sectors through fusion so it makes sense to have a devoted function for it, but even so using fusion seems like a reasonable fallback definition. But I would still vote for basing this implementation that uses fusion around a more general functionality for getting the block length associated with a sector as I outlined above. I would almost prefer going "all in" on the tensor analogy, and define |
I do quite like the It's not obvious to me why this should return a labelled integer though, this integer is really the number of times |
Yeah, I'm fine with |
Right, I guess following that logic there could be |
We may have a similar function inside I will have a try for a custom |
This PR defines
nsymbol
, a function to accede the number of time labels3
appears in the tensor products1⊗s2
. To stay consistent with the interface, the output is a labelled integer.