Traits and Styles
Traits define compile-time properties that can be assumed about a sector type. They control behavior and enable optimizations.
FusionStyle
The FusionStyle trait indicates how many outputs to expect when fusing two sectors.
TensorKitSectors.FusionStyle — Type
abstract type FusionStyle
FusionStyle(::Sector)
FusionStyle(I::Type{<:Sector})Trait to describe the fusion behavior of sectors of type I, which can be either
UniqueFusion: each fusiona ⊗ bhas exactly one outputc.SimpleFusion: fusinga ⊗ bcan lead to multiple valuesc, but each appears at most once.GenericFusion: fusinga ⊗ bcan lead to multiple valuescthat could appear multiple times.
There is an abstract supertype MultipleFusion of which both SimpleFusion and GenericFusion are subtypes. Furthermore, there is a type alias MultiplicityFreeFusion for those fusion types which do not require muliplicity labels.
TensorKitSectors.UniqueFusion — Type
struct UniqueFusion <: FusionStyleFusion style where every product a ⊗ b has exactly one output c. As a result, $N_c^{ab} ≤ 1$ and no multiplicity labels are needed.
See also FusionStyle.
TensorKitSectors.SimpleFusion — Type
struct SimpleFusion <: MultipleFusionFusion style where multiple outputs c can appear in a ⊗ b, but each appears at most once. As a result, $N_c^{ab} ≤ 1$ and no multiplicity labels are needed.
See also FusionStyle.
TensorKitSectors.GenericFusion — Type
struct GenericFusion <: MultipleFusionFusion style with potentially multiple outputs c and nontrivial multiplicities. Here $N_c^{ab}$ can exceed 1, and multiplicity labels are required.
See also FusionStyle.
This enables various optimizations for different cases. Firstly, since the shape (size of the arrays) of the topological data is determined by combinations of the Nsymbol, for UniqueFusion and SimpleFusion we can use scalar quantities instead of arrays. Secondly, in the UniqueFusion case, there is only a single channel for $a \otimes b \otimes c \otimes \ldots$, avoiding the need to iterate through all options.
It is additionally possible to combine fusion styles through the & operator, which returns the style with the least assumptions. For example:
julia> UniqueFusion() & SimpleFusion()
SimpleFusion()
julia> GenericFusion() & UniqueFusion()
GenericFusion()Finally, some predefined combinations that appear often have dedicated names:
TensorKitSectors.MultipleFusion — Type
abstract type MultipleFusion <: FusionStyleFusion styles that allow more than one fusion output for a ⊗ b.
See also SimpleFusion, GenericFusion and FusionStyle.
TensorKitSectors.MultiplicityFreeFusion — Type
const MultiplicityFreeFusion = Union{UniqueFusion, SimpleFusion}Convenience alias for fusion styles that can assume Nsymbol(a, b, c)::Bool, and therefore never require multiplicity labels.
See also UniqueFusion, SimpleFusion and FusionStyle.
BraidingStyle
The BraidingStyle describes whether and how exchange of sectors is defined. It determines how TensorKit interprets Rsymbol and twist.
TensorKitSectors.BraidingStyle — Type
abstract type BraidingStyle
BraidingStyle(::Sector) -> ::BraidingStyle
BraidingStyle(I::Type{<:Sector}) -> ::BraidingStyleTrait to describe the braiding behavior of sectors of type I, which can be either
NoBraiding: no braiding structure defined.Bosonic: symmetric braiding structure with a trivial twist.Fermionic: symmetric braiding structure with a non-trivial twist that squares to identity.Anyonic: general braiding structure and arbitrary twists.
There is an abstract supertype HasBraiding that includes all styles that define Rsymbol (everything but NoBraiding). Furthermore, the abstract supertype SymmetricBraiding denotes the cases where braidings are equivalent to crossings, i.e. braiding twice is an identity operation. This includes the Bosonic and Fermionic styles, for which we can uniquely define permutations.
TensorKitSectors.NoBraiding — Type
struct NoBraiding <: BraidingStyleBraiding style for categories without a braiding structure. Except for braiding with the unit sector, only planar diagrams are meaningful; Rsymbol is undefined.
See also BraidingStyle.
TensorKitSectors.Bosonic — Type
struct Bosonic <: SymmetricBraidingBraiding style with symmetric braiding and trivial twist. This is characterized by $R^{ab}_c R^{ba}_c = 1$ and $\theta_a = 1$ for all sectors.
See also BraidingStyle.
TensorKitSectors.Fermionic — Type
struct Fermionic <: SymmetricBraidingBraiding style with symmetric braiding and nontrivial (symmetric) twist. This is characterized by $R^{ab}_c R^{ba}_c = 1$ and $\theta_a = \pm 1$ for all sectors.
See also BraidingStyle.
TensorKitSectors.Anyonic — Type
struct Anyonic <: HasBraidingBraiding style with general (non-symmetric) braiding and arbitrary twists. Characterized by nontrivial braid group representations where $R^{ab}_c R^{ba}_c ≠ 1$ in general.
See also BraidingStyle.
Additionally, this dictates whether or not permutations are sufficient to specify generic exchanges, or if a full braid group representation is needed.
It is also possible to combine braiding styles through the & operator, which returns the style with the least assumptions. For example:
julia> Bosonic() & Fermionic()
Fermionic()
julia> Fermionic() & Anyonic()
Anyonic()
julia> Bosonic() & NoBraiding()
NoBraiding()Finally, some predefined combinations that appear often have dedicated names:
TensorKitSectors.HasBraiding — Type
abstract type HasBraiding <: BraidingStyleSupertype for all braiding styles where an Rsymbol is defined. This includes all current BraidingStyles except NoBraiding.
TensorKitSectors.SymmetricBraiding — Type
abstract type SymmetricBraiding <: HasBraidingSupertype for braiding styles with symmetric braiding, where braiding twice is the identity operation. Subtypes include Bosonic (trivial twist) and Fermionic (nontrivial twist ±1). Supports permutation group statistics.
See also BraidingStyle.
UnitStyle
The UnitStyle tells whether there is a single identity label or multiple units. By default, it is derived from length(allunits(I)).
TensorKitSectors.UnitStyle — Type
abstract type UnitStyle
UnitStyle(::Sector)
UnitStyle(I::Type{<:Sector})Trait to describe the semisimplicity of the unit sector of type I. This can be either
SimpleUnit: the unit is simple (e.g. fusion categories).GenericUnit: the unit is semisimple (e.g. multifusion categories).
TensorKitSectors.SimpleUnit — Type
struct SimpleUnit <: UnitStyleUnit style for fusion categories with a unique unit (identity) object. The unit satisfies $\mathbb{1} ⊗ a ≅ a ≅ a ⊗ \mathbb{1}$ for all sectors.
See also UnitStyle.
TensorKitSectors.GenericUnit — Type
struct GenericUnit <: UnitStyleUnit style for multifusion categories with multiple unit objects (semisimple unit). Requires implementation of allunits(::Type{I}), leftunit(a), and rightunit(a).
See also UnitStyle.
Whenever the style is SimpleUnit, a unique value of unit can be defined and there is no distinction between leftunit and rightunit. For GenericUnit, this is no longer the case and special care has to be taken to use the correct unit for various fusion diagrams.