-
Notifications
You must be signed in to change notification settings - Fork 5
Representations of alternating group of degree 4 #43
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
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
c4ef220
alternating group
borisdevos 7005e04
start of ANIrrep
borisdevos 2b2c351
rename file
borisdevos 71364b3
get fusion working
borisdevos 5b565d6
show and export
borisdevos 4f8bcf4
fusion tensor
borisdevos 073a097
start of hardcoding fusion tensors
borisdevos 5fe37f4
remove trace in Fsymbol
borisdevos c73027a
bosonic braiding
borisdevos 987409b
fix show
borisdevos 77dda09
keep product iterator to unique outputs
borisdevos 90e2ba9
remove aliases for N < 4
borisdevos 2cc41b3
remove show method for `ANIrrep`
borisdevos d1cde78
fix length of product iterator
borisdevos 68375f6
make `Fsymbol` type-stable
borisdevos 237212e
fix length of iterator
borisdevos 00817e3
fix rsymbol
borisdevos 6f6b09d
minor code suggestions
borisdevos 55b9608
fix some things to be clear N < 5 isn't available
borisdevos feb600d
fix Rsymbol
borisdevos 9fe524a
rename fusion tensor help functions
borisdevos 5fe2841
format
borisdevos fc4f1c2
generalise orthogonality of fusion tensor check for `GenericFusion`
borisdevos acdfa00
add to sectorlist in tests
borisdevos bddd5c7
Merge branch 'main' into bd/repa4
borisdevos 78cd1c0
Merge branch 'main' into bd/repa4
borisdevos f779b40
clean up and shorten code
borisdevos 45ef41a
add docstring for `fusiontensor`
borisdevos 05404bd
code suggestions
borisdevos f7aa50b
fix counting number of irreps of A_N
borisdevos ccea126
replace more partitions by irreps
borisdevos 27df99b
bring back sectorscalartype
borisdevos 5ab34f9
minor cleanup
borisdevos dc64831
some more cleanup
lkdvos 4a694bb
remove stray ANIrrep
borisdevos e793ae7
Merge branch 'main' of https://github.com/QuantumKitHub/TensorKitSect…
borisdevos 164e3aa
add source to motivate choice of basis
borisdevos 99f6d4b
Merge branch 'main' into bd/repa4
borisdevos 099bca6
reduce allocations
borisdevos ef61de0
Update src/irreps/irreps.jl
borisdevos b9e74b5
intertwiner check
borisdevos d23381d
Merge branch 'bd/repa4' of https://github.com/QuantumKitHub/TensorKit…
borisdevos 71cae58
move intertwiner test to run it
borisdevos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| """ | ||
| struct A4Irrep <: AbstractIrrep{A₄} | ||
| A4Irrep(n::Integer) | ||
| Irrep[A₄](n::Integer) | ||
|
|
||
| Represents irreps of the alternating group ``A₄``. | ||
|
|
||
| ## Fields | ||
|
|
||
| - `n::Int8`: the label of the irrep, corresponding to ``1``, ``1′``, ``1″`` and ``3``. | ||
| """ | ||
| struct A4Irrep <: AbstractIrrep{A₄} | ||
| n::Int8 | ||
| function A4Irrep(n::Integer) | ||
| 0 ≤ n < 4 || throw(ArgumentError("A4Irrep only has irrep labels in `0:3`")) | ||
| return new(n) | ||
| end | ||
| end | ||
|
|
||
| FusionStyle(::Type{A4Irrep}) = GenericFusion() | ||
| sectorscalartype(::Type{A4Irrep}) = Float64 | ||
|
|
||
| unit(::Type{A4Irrep}) = A4Irrep(0) | ||
| dual(a::A4Irrep) = a.n == 3 ? a : A4Irrep((3 - a.n) % 3) | ||
|
|
||
| Base.hash(a::A4Irrep, h::UInt) = hash(a.n, h) | ||
| Base.convert(::Type{A4Irrep}, n::Integer) = A4Irrep(n) | ||
|
|
||
| Base.getindex(::IrrepTable, ::Type{A₄}) = A4Irrep | ||
|
|
||
|
|
||
| # Sector iterator | ||
| # --------------- | ||
| Base.isless(a::A4Irrep, b::A4Irrep) = isless(a.n, b.n) | ||
| Base.IteratorSize(::Type{SectorValues{A4Irrep}}) = Base.HasLength() | ||
| Base.length(::SectorValues{A4Irrep}) = 4 | ||
|
|
||
| Base.iterate(v::SectorValues{A4Irrep}, i = 1) = i > length(v) ? nothing : (v[i], i + 1) | ||
|
|
||
| @inline function Base.getindex(v::SectorValues{A4Irrep}, i::Int) | ||
| @boundscheck 1 <= i <= length(v) || throw(BoundsError(v, i)) | ||
| return A4Irrep(i - 1) | ||
| end | ||
|
|
||
| findindex(::SectorValues{A4Irrep}, a::A4Irrep) = a.n + 1 | ||
|
|
||
| # Product iterator | ||
| # ---------------- | ||
|
|
||
| const A4IrrepProdIterator = SectorProductIterator{A4Irrep} | ||
| ⊗(a::A4Irrep, b::A4Irrep) = SectorProductIterator((a <= b ? (a, b) : (b, a))...) | ||
|
|
||
| Base.IteratorSize(::Type{A4IrrepProdIterator}) = Base.HasLength() | ||
| Base.length(x::A4IrrepProdIterator) = (x.a == x.b == A4Irrep(3)) ? 4 : 1 | ||
|
|
||
| function Base.iterate(p::A4IrrepProdIterator, state::Int = 1) | ||
| a, b = p.a, p.b | ||
| if state == 1 | ||
| a.n == b.n == 3 && return (A4Irrep(state - 1), state + 1) # 3 ⊗ 3 | ||
| b.n == 3 && return (b, 5) # x ⊗ 3 = 3 | ||
| return (A4Irrep((a.n + b.n) % 3), 5) # 1d irreps ≡ Z3 | ||
| elseif state < 5 # a == b == 3 | ||
| return (A4Irrep(state - 1), state + 1) | ||
| else | ||
| return nothing | ||
| end | ||
| end | ||
|
|
||
| # Topological data | ||
| # ---------------- | ||
| dim(a::A4Irrep) = a.n == 3 ? 3 : 1 | ||
|
|
||
| function Nsymbol(a::A4Irrep, b::A4Irrep, c::A4Irrep) | ||
| # 3d irreps | ||
| a.n == b.n == 3 && return 1 + (c.n == 3) | ||
| (a.n == 3 || b.n == 3) && return Int(c.n == 3) | ||
| # 1d irreps | ||
| return Int((a.n + b.n) % 3 == c.n) | ||
| end | ||
|
|
||
|
|
||
| function Fsymbol(a::I, b::I, c::I, d::I, e::I, f::I) where {I <: A4Irrep} | ||
| T = sectorscalartype(I) | ||
| Nabe = Nsymbol(a, b, e) | ||
| Necd = Nsymbol(e, c, d) | ||
| Nbcf = Nsymbol(b, c, f) | ||
| Nafd = Nsymbol(a, f, d) | ||
|
|
||
| Nabe > 0 && Necd > 0 && Nbcf > 0 && Nafd > 0 || | ||
| return zeros(T, Nabe, Necd, Nbcf, Nafd) | ||
|
|
||
| # fallback through fusiontensor for A4Irrep | ||
| A = fusiontensor(a, b, e) | ||
| B = fusiontensor(e, c, d)[:, :, 1, :] | ||
| C = fusiontensor(b, c, f) | ||
| D = fusiontensor(a, f, d)[:, :, 1, :] | ||
| @tensor F[-1, -2, -3, -4] := conj(D[1, 5, -4]) * conj(C[2, 4, 5, -3]) * | ||
| A[1, 2, 3, -1] * B[3, 4, -2] | ||
|
|
||
| return F | ||
| end | ||
|
|
||
| # bosonic | ||
| function Rsymbol(a::I, b::I, c::I) where {I <: A4Irrep} | ||
| Nabc = Nsymbol(a, b, c) | ||
| R = zeros(sectorscalartype(I), Nabc, Nabc) | ||
| Nabc == 0 && return R | ||
| if a == b == c == A4Irrep(3) | ||
| R[1, 1] = -1 | ||
| R[2, 2] = 1 | ||
| else | ||
| R[1, 1] = 1 | ||
| end | ||
| return R | ||
| end | ||
|
|
||
| # choice of basis: https://journals.aps.org/rmp/pdf/10.1103/RevModPhys.82.2701 | ||
| # triplet is a real representation -> can make all representation matrices real | ||
| function fusiontensor(a::I, b::I, c::I) where {I <: A4Irrep} | ||
| T = sectorscalartype(I) | ||
| Nabc = Nsymbol(a, b, c) | ||
| C = zeros(T, dim(a), dim(b), dim(c), Nabc) | ||
| isempty(C) && return C | ||
|
|
||
| ω = cis(2π / 3) | ||
|
|
||
| if a.n == b.n == 3 # 3 ⊗ 3 | ||
| if c.n != 3 # singlets | ||
| invsqrt3 = 1 / sqrt(3.0) | ||
| for i in 1:3 | ||
| j = 4 - mod1(i - c.n - 1, 3) | ||
| C[i, j, 1, 1] = invsqrt3 | ||
| end | ||
| else # triplet: eq 38 in above reference | ||
| s2 = 1 / sqrt(2.0) | ||
| s6 = 1 / sqrt(6.0) | ||
|
|
||
| # antisymmetric channel | ||
| C[:, :, 1, 1] .= [0 0 0; 0 0 s2; 0 -s2 0] | ||
| C[:, :, 2, 1] .= [0 s2 0; -s2 0 0; 0 0 0] | ||
| C[:, :, 3, 1] .= [0 0 -s2; 0 0 0; s2 0 0] | ||
|
|
||
| # symmetric channel | ||
| C[:, :, 1, 2] .= [-2 * s6 0 0; 0 0 s6; 0 s6 0] | ||
| C[:, :, 2, 2] .= [0 s6 0; s6 0 0; 0 0 -2 * s6] | ||
| C[:, :, 3, 2] .= [0 0 s6; 0 -2 * s6 0; s6 0 0] | ||
| end | ||
| else | ||
| if a.n != 3 && b.n != 3 # 1d x 1d | ||
| C[1, 1, 1] = one(T) | ||
| elseif a.n == 3 && b.n != 3 # 3 x 1d | ||
| for i in 1:3 | ||
| j = mod1(i - b.n, 3) | ||
| C[j, 1, i, 1] = one(T) | ||
| end | ||
| else # 1d x 3: reshape of 3 x 1d | ||
| for i in 1:3 | ||
| j = mod1(i - a.n, 3) | ||
| C[1, j, i, 1] = one(T) | ||
| end | ||
| end | ||
| end | ||
| return C | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,3 +68,4 @@ include("u1irrep.jl") | |
| include("dnirrep.jl") | ||
| include("cu1irrep.jl") | ||
| include("su2irrep.jl") | ||
| include("a4irrep.jl") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that here you could in principle also register the lower order alternating group versions, something like
though that might be more confusing than helpful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I started with including the lower degree groups, and whether or not it's confusing or helpful, I don't think that making these identifications is particularly useful.