Compute Clebsch-Gordan coefficients for general SU(N) groups. Reimplementation of arXiv:1009.0437. Compatibility / interoperability with TensorKit.jl.
julia> using Pkg; Pkg.add("SUNRepresentations")using TensorKit, SUNRepresentations
I = SUNIrrep{3}(2, 1, 0)
println("$I ⊗ $I = $(collect(I ⊗ I))")Irrep[SU₃]((2, 1, 0)) ⊗ Irrep[SU₃]((2, 1, 0)) = SU3Irrep[(0, 0, 0), (2, 1, 0), (3, 3, 0), (3, 0, 0), (4, 2, 0)]
As computing Clebsch-Gordan coefficients is a relatively expensive operation, this package caches them, in memory and on disk, using MemoizationKit.jl.
The F- and R-symbols and the direct products of irreps are cached in memory as well.
To obtain information about the current status of the caches, call SUNRepresentations.cache_info():
julia> SUNRepresentations.precompute_disk_cache(3)
julia> SUNRepresentations.cache_info()
SUN_CGC: MemoizationKit.ClockCache{Any, Any}(32/100000 entries, 0 hits, 32 misses)
SUN_Fsymbol: not used yet
SUN_Rsymbol: not used yet
productirreps: MemoizationKit.ClockCache{Any, Any}(16/10000 entries, 0 hits, 16 misses)
SUN_CGC on disk: 32 entries, 309.812 KiB, ~/.julia/scratchspaces/1a50b95c-7aac-476d-a9ce-2bfc675fc617/MemoizationKit/SUNRepresentations.SUN_CGC-v1-hostname.sqliteOften, it may be useful to precompute a large set of coefficients (in parallel), which are then stored on disk and loaded when needed.
This can be done, as above, using the SUNRepresentations.precompute_disk_cache(N, a_max) function, which will compute all Clebsch-Gordan coefficients for s1 ⊗ s2 -> s3, where s1 and s2 will have Dynkin labels up to a_max, and s3 runs over all outputs of the fusion product.
The disk cache is an SQLite database per machine, stored in a scratch space of this package by default. Its location, and whether it is used at all, are set with MemoizationKit's preferences, for example to keep it off a slow or quota-limited home directory:
julia> using MemoizationKit
julia> set_cache_preferences!(SUNRepresentations; disk_path = "/scratch/cgc")
julia> set_cache_preferences!(SUNRepresentations; disk = false) # only cache in memoryThese are stored in the active project's LocalPreferences.toml, and take effect from the next session (or before the first coefficient is computed).
MemoizationKit.empty_disk_caches!(SUNRepresentations.SUN_CGC) removes the coefficients stored on this machine, and MemoizationKit.empty_caches!(SUNRepresentations) those in memory.
See the MemoizationKit documentation for the other settings, such as the sizes of the caches in memory.
By default, irreps are denoted by their N - 1 Dynkin labels, which are equivalent to consecutive differences in the number of boxes in each row of the Young tableau, and this is also how they are stored.
For example, the fundamental representation of SU(3) is denoted by SUNIrrep{3}(1, 0), and the adjoint representation by SUNIrrep{3}(1, 1).
Nevertheless, we also support using N weight labels, corresponding to the number of boxes per row in the Young tableaus.
For example, the fundamental representation of SU(3) is denoted by SUNIrrep{3}(1, 0, 0), and the adjoint representation by SUNIrrep{3}(2, 1, 0).
Finally, it is also possible to use the dimensional name which is often used in physics, e.g. SUNIrrep{3}("3") and SUNIrrep{3}("8").
The display of irreps can be changed in a persistent way by setting the display_mode preference:
julia> using SUNRepresentations
julia> for mode in ["weight", "dynkin", "dimension"]
SUNRepresentations.display_mode(mode)
@show SUNIrrep{4}(2, 2, 2, 0)
end
SUNIrrep{4}(2, 2, 2, 0) = Irrep[SU₄]((2, 2, 2, 0))
SUNIrrep{4}(2, 2, 2, 0) = Irrep[SU₄]((0, 0, 2))
SUNIrrep{4}(2, 2, 2, 0) = Irrep[SU₄]("10")This package supports outputting the irreps to a LaTeX format via a package extension for Latexify.jl.
To use this extension, load Latexify.jl and SUNRepresentations.jl and then the following should work:
julia> using SUNRepresentations, Latexify
julia> latexify(SUNIrrep{4}("10⁺"))
L"$\overline{\textbf{10}}$"v0.4 refactors the internal representation of SUNIrrep objects.
The change is minimally breaking: all public constructors and accessors continue to work as before, but any serialized or stored SUNIrrep values are incompatible with the new version.
What changed internally:
SUNIrrep{N}previously stored anNTuple{N, Int}of highest-weight components (the N weights). It now stores anNTuple{N-1, UInt8}of Dynkin labels.- The type now has a second type parameter:
SUNIrrep{N, M}whereM = N - 1. Code usingSUNIrrep{N}as a type annotation continues to work; only code matching on the concrete type (e.g.SUNIrrep{3, 2}) or directly accessing the internal.Ifield will need updating. - Constructors using
SUNIrrep(arg)witharg::Tuplevsarg::Vectorto distinguish between weights or dynkin labels are no longer supported, and theNinSUNIrrep{N}is now always required to avoid ambiguities. - Direct field access
s.Istill works, but should be avoided. Use the public accessorsweight(s)anddynkin_label(s)instead.
Impact on stored data:
Any data persisted to disk that contains SUNIrrep values will be unreadable after upgrading to v0.4.
This includes user-written JLD2 (or similar) files, but notably does not include CGC disk caches.
- Documentation