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.FusionStyleType
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 fusion a ⊗ b has exactly one output c.
  • SimpleFusion: fusing a ⊗ b can lead to multiple values c, but each appears at most once.
  • GenericFusion: fusing a ⊗ b can lead to multiple values c that 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.

source
TensorKitSectors.UniqueFusionType
struct UniqueFusion <: FusionStyle

Fusion 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.

source
TensorKitSectors.SimpleFusionType
struct SimpleFusion <: MultipleFusion

Fusion 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.

source
TensorKitSectors.GenericFusionType
struct GenericFusion <: MultipleFusion

Fusion style with potentially multiple outputs c and nontrivial multiplicities. Here $N_c^{ab}$ can exceed 1, and multiplicity labels are required.

See also FusionStyle.

source

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:

BraidingStyle

The BraidingStyle describes whether and how exchange of sectors is defined. It determines how TensorKit interprets Rsymbol and twist.

TensorKitSectors.BraidingStyleType
abstract type BraidingStyle
BraidingStyle(::Sector) -> ::BraidingStyle
BraidingStyle(I::Type{<:Sector}) -> ::BraidingStyle

Trait 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.

source
TensorKitSectors.BosonicType
struct Bosonic <: SymmetricBraiding

Braiding 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.

source
TensorKitSectors.FermionicType
struct Fermionic <: SymmetricBraiding

Braiding 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.

source
TensorKitSectors.AnyonicType
struct Anyonic <: HasBraiding

Braiding 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.

source

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.HasBraidingType
abstract type HasBraiding <: BraidingStyle

Supertype for all braiding styles where an Rsymbol is defined. This includes all current BraidingStyles except NoBraiding.

source

UnitStyle

The UnitStyle tells whether there is a single identity label or multiple units. By default, it is derived from length(allunits(I)).

TensorKitSectors.UnitStyleType
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).
source
TensorKitSectors.SimpleUnitType
struct SimpleUnit <: UnitStyle

Unit 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.

source
TensorKitSectors.GenericUnitType
struct GenericUnit <: UnitStyle

Unit style for multifusion categories with multiple unit objects (semisimple unit). Requires implementation of allunits(::Type{I}), leftunit(a), and rightunit(a).

See also UnitStyle.

source

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.