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, eigval: Array | None = None, perm_sign: Array | None = None)#
Parameters:
  • generator – The permutation that generates the symmetry group, default to identity. The input can be a 1D generator array, or a 2D array with each row a generator.

  • sector – The symmetry sector \(q\) used to compute the eigenvalues. Assume the periodicity of the generator is \(m\), then the eigenvalues are given by \(\omega_i = e^{-2 \pi i q / m}\). The sector is 0 by default, giving all eigenvalues equal to 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 defaul.

  • Z2_inversion

    The Z2 inversion symmetry. This 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 \(T\) generated by the generator. If not specified, this value will be computed in initialization.

  • eigval – Directly specify the eigenvalues \(\omega\) generated by the sector. If not specified, this value will be computed in initialization.

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

__add__(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.

__call__(**kwargs)#

Call self as a function.

property is_fermion: bool#

Whether the system is made of fermions

property is_spinful: bool#

Whether the system is spinful

property eigval: Array#

Eigenvalues

property nsymm: int#

Number of elements in the symmetry group

property Z2_inversion: int#

Z2 inversion symmetry

property basis: <module 'quspin.basis.basis_general' from '/home/aochen/quantax_env/lib/python3.12/site-packages/quspin/basis/basis_general/__init__.py'>#

The QuSpin basis corresponding to the symmetry.

basis_make() None#

Make the QuSpin basis stored in the symmetry.

get_symm_spins(spins: Array) Array#

For a input spin configuration s, obtain all symmetrized spins \(s'=Ts\) generated by the symmetry permutations.

Note

This function is jittable.

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

Symmetrize the wave function as \(\psi^{symm}(s) = \sum_i \omega_i \, \psi(T_i s) / n_{symm}\).

Parameters:
  • psi – Wave functions \(\psi(T_i s)\)

  • spins – Symmetry spins \(T_i s\). This is only necessary in fermionic systems, where additional minus signs can be generated by the symmetry depending on the input spins.

Returns:

The symmetrized wave function

Note

This function is jittable.