quantax.symmetry.Symmetry#

class quantax.symmetry.Symmetry#

Symmetry of the system.

__init__(generator: ndarray | None = None, sector: int | Sequence = 0, generator_sign: ndarray | None = None, Z2_inversion: int = 0, perm: Array | None = None, character: Array | None = None, perm_sign: Array | None = None)#
Parameters:
  • generator – The permutation of the group generator(s), default to identity. The input can be a 1D generator array, or a 2D array with each row a different generator. The group is generated as \(G = \{ g_1^m g_2^n ... | m,n \in \mathbb{Z} \}\).

  • sector – The symmetry sector \(q\) of each generator. Assume the periodicities of generators \(g_1, g_2\) are \(M, N\), then the characters of the group element \(g = g_1^m g_2^n\) is given by \(\chi = \exp[-2 \pi i (m q_1 / M + n q_2 / N)]\). The sector is 0 by default, giving \(\chi = 1\).

  • generator_sign – The additional sign associated with the generator, usually caused by the anti-periodic boundary condition. In most other cases, this can be left as None by default.

  • Z2_inversion

    The Z2 inversion symmetry. It represents the spin flip in spin-1/2 systems, and the particle-hole symmetry in fermionic systems. The meaning of each number is

    • 1: Eigenvalue 1 after Z2 inversion

    • 0: No Z2 inversion symmetry

    • -1: Eigenvalue -1 after Z2 inversion

  • perm – Directly specify the permutations of all group elements. If not specified, this value will be computed from generator.

  • character – Directly specify the characters \(\chi\) of all group elements. If not specified, this value will be computed from sector. One needs to specify this argument if the group representation is high-dimensional, in which case the characters can’t be computed from generator and sector.

  • perm_sign – Directly specify the signs associated to the permutations generated by the generator sign. If not specified, this value will be computed from generator_sign.

__matmul__(other: Symmetry) Symmetry#

Generate superposition of two symmetries.

from quantax.sites import Square
from quantax.symmetry import Translation

lattice = Square(4)
trans1 = Translation((1, 0))  # translation symmetry in x axis
trans2 = Translation((0, 1))  # translation symmetry in y axis
trans2D = trans1 @ trans2  # 2D translation symmetry

Warning

Users are responsible to ensure the compatibility of different symmetries, especially if their generators don’t commute.

property character: Array#

Characters \(\chi\) of all group elements.

property nsymm: int#

Number of elements in the symmetry group.

property Z2_inversion: int#

The Z2 inversion symmetry. It represents the spin flip in spin-1/2 systems, and the particle-hole symmetry in fermionic systems. The meaning of each number is

  • 1: Eigenvalue 1 after Z2 inversion

  • 0: No Z2 inversion symmetry

  • -1: Eigenvalue -1 after Z2 inversion

property basis#

The QuSpin basis corresponding to the symmetry.

basis_make() None#

Make the QuSpin basis stored in the symmetry.

get_symm_spins(spins: Array) Array#

Get all symmetrized bases \(s'=Ts\) generated by the symmetry permutations.

Parameters:

spins – Input spin or fermion configuration \(s\).

Note

This function is jittable.

symmetrize(psi: ndarray | Array | LogArray | ScaleArray, spins: Array | None = None) ndarray | Array | LogArray | ScaleArray#

Symmetrize the wavefunction as

\[\psi^{\mathrm{symm}}(s) = \frac{d}{|G|} \sum_g \mathrm{sign}(s, g) \chi_g \psi(T_g s),\]

where \(d\) is the dimension of the group representation, \(|G|\) is the number of elements in the symmetry group, and \(\mathrm{sign}(s, g)\) is the additional sign generated by the symmetry depending on the input Fock state (only for fermionic systems).

Parameters:
  • psi – Wavefunctions \(\psi(T_i s)\).

  • spins – Input spin or fermion configuration \(s\). This is only necessary in fermionic systems, where additional minus signs \(\mathrm{sign}(s, g)\) can be generated by the symmetry.

Returns:

The symmetrized wave function

Note

This function is jittable.