quantax.state.State#

class quantax.state.State#

Abstract class for quantum states

__init__(symm: Symmetry | None = None)#
Parameters:

symm – The symmetry of the state, default to quantax.symmetry.Identity

__call__(fock_states: ndarray | Array) ndarray | Array#

Evaluate the wave function \(\psi(s) = \left<s|\psi\right>\) by state(s)

Parameters:

fock_states – A batch of fock states with entries \(\pm 1\)

__getitem__(basis_ints: ndarray | Array) ndarray | Array#

Evaluate the wave function \(\psi(s) = \left<s|\psi\right>\) by state[s]

Parameters:

basis_ints – A batch of basis integers

__matmul__(other: State) Number#

Compute the contraction \(\left< \psi|\phi \right>\) by self @ other. This is implemented by converting self and other to DenseState.

property N: int#

Number of sites

property symm: Symmetry#

Symmetry of the state

property nsymm: int#

Number of symmetry group elements

property basis: spin_basis_general#

Quspin basis of the state

property Nparticle: Tuple[int, int] | None#

Number of particle convervation of the state

todense(symm: Symmetry | None = None) DenseState#

Obtain the quantax.state.DenseState corresponding to the current state

Parameters:

symm – The symmetry of the state, default to the current symmetry of the state

Warning

Users are responsible to ensure that the state satisfies the given symm.

norm(ord: int | None = None) float#

Norm of state

Parameters:

ord – Order of the norm, default to 2-norm \(\sqrt{\sum_s |\psi(s)|^2}\)

overlap(other: State) Number#

Overlap between two states. Equal to self @ other if the two states are normalized.