netket.symmetry.LabeledRepresentation#

class netket.symmetry.LabeledRepresentation[source]#

Bases: Representation

A Representation with automatic irrep labeling.

Extends the base Representation with:

  • irrep_labels β€” a human-readable string for each irrep, derived from character values on a minimal set of β€œseparating” group elements. For example: "+1", "-1", "+i", "exp(+0.3333Ο€i)", or tuples thereof for multi-generator groups.

  • projector() accepting a label= keyword in addition to the integer character_index.

The constructor signature is identical to Representation, so existing code that passes a (group, representation_dict) pair works unchanged.

Subclasses can override irrep_labels to provide physics-specific names (e.g. "even"/"odd" for Zβ‚‚).

Examples

Project a state onto the antisymmetric sector of a Zβ‚‚ group:

rep = nk.symmetry.spin_flip_representation(hilbert)
print(rep.irrep_labels)     # ['+1', '-1']
proj = rep.projector(label='-1')
Inheritance
Inheritance diagram of netket.symmetry.LabeledRepresentation
__init__(group, representation_dict)[source]#

Construct a Representation.

Parameters:
  • group (FiniteGroup) – The group being represented.

  • representation_dict (dict[Element, DiscreteJaxOperator]) – The dictionary that defines the representation. Its keys must be the elements of group. The value this dictionary associates to a group element is the operator that the representation maps this group element onto.

Attributes
character#

The vector storing the character of the representation.

Corresponds to [op.trace() for (_, op) in self].

Requires that each operator of the representation implements the trace method.

irrep_labels#

Human-readable label for each irrep (one per character_index).

Derived from character values on the minimal set of separating group elements:

  • Single separator: "+1", "-1", "+i", etc.

  • Multiple separators: "(+1, -1)", "(-1, +i)", etc.

Subclasses override this with domain-specific labels.

representation_dict#

Dictionary associating every group element to a representation

Equivalent to {el: rep for (el, rep) in (self.group.elems, self.operators)}

Methods
coset_filter(subgroup)[source]#

Build the coset Fourier filter for this group G modulo subgroup H.

Parameters:

subgroup (LabeledRepresentation) – LabeledRepresentation for a subgroup H ≀ G.

Return type:

LabeledRepresentationCosetFilter

Returns:

LabeledRepresentationCosetFilter for G/H.

Example:

rep_d4 = nk.symmetry.canonical_representation(hi, lattice.point_group())
rep_c4 = nk.symmetry.canonical_representation(hi, c4_subgroup)
C = rep_d4.coset_filter(rep_c4)
irrep_subspace_dims()[source]#

Return the dimension of the subspace associated to each irreducible representation.

Requires that each operator of the representation implements the trace method.

Return type:

int

project(state, character_index=None, *, atol=1e-15, **kwargs)[source]#

Return the state projected onto the subspace associated to the irreducible representation specified by character_index.

Additional keyword arguments are forwarded to projector(), so subclasses that accept label=, k=, etc. can be used here too.

Return type:

MCState

Parameters:

atol (float)

projector(character_index=None, *, label=None, atol=1e-15)[source]#

Build the projection operator for an irrep.

Accepts either:

  • character_index (int): index into the character table, as in the base Representation.

  • label (str): human-readable label from irrep_labels.

Parameters:
  • character_index – Irrep index (0-based).

  • label – Irrep label string, e.g. "+1" or "-1".

  • atol – Tolerance for dropping near-zero projector terms.

Return type:

DiscreteJaxOperator

Returns:

A SumOperator projection operator.

Raises:
symmetry_adapted_basis()[source]#

Return a tuple (mat, irrep_dims), where mat is the change of basis matrix associated to a symmetry adapted basis, and irrep_dims is an array giving the dimension of the subspace associated to each irreducible representation.

The basis vectors of mat are ordered by the index of their irreducible representation.

Return type:

tuple[ndarray, ndarray]