quantax.symmetry.Symmetry#
- class quantax.symmetry.Symmetry#
Symmetry of the system.
- __init__(generator: Sequence[int] | NDArray[integer] | None = None, sector: int | Sequence[int] = 0, generator_sign: NDArray[integer] | 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 fromgeneratorandsector.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 Nsites: int#
The number of sites.
- property Nmodes: int#
The length of a configuration array, i.e. the number of local modes per sample. This is
Nsitesfor spins or spinless fermions and2 * Nsitesfor spinful fermions.
- property Nparticles: int | tuple[int, int] | None#
The number of particles.
None: No particle conservation.int: Conservation of total particle number.Tuple[int, int]: Conservation of spin-up and spin-down particle numbers.
- property particle_type: PARTICLE_TYPE#
The type of particle in the system. See
PARTICLE_TYPE.
- property double_occ: bool#
Whether the system allows double occupancy.
- property is_fermion: bool#
Whether the system is made of fermions.
- property is_spinful: bool#
Whether the system is spinful.
- 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.
- 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.