quantax.state.DenseState#

class quantax.state.DenseState#

Bases: State

Dense state in which the full wave function is stored as a numpy array

__init__(wave_function: ndarray | Array, symm: Symmetry | None = None)#
Parameters:
__getitem__(basis_ints: ndarray | Array) ndarray#

Evaluate the wave function \(\psi(s) = \left<s|\psi\right>\) by state[s]. This is done by slicing the full wave function.

Parameters:

basis_ints – A batch of basis integers

__call__(fock_states: ndarray | Array) ndarray#

Evaluate the wave function \(\psi(s) = \left<s|\psi\right>\) by state(s). This is done by converting fock states basis integers and slicing the full wave function.

Parameters:

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

property wave_function: ndarray | Array#

Full wave function

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

Convert the state to a new DenseState with the given symmetry

Parameters:

symm – The new symmetry. It’s default to self.symm, so self without copy is returned by default.

normalize() DenseState#

Normalize the wave function, and return self.

property N: int#

Number of sites

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

Number of particle convervation of the state

property basis: spin_basis_general#

Quspin basis of the state

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}\)

property nsymm: int#

Number of symmetry group elements

overlap(other: State) Number#

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

property symm: Symmetry#

Symmetry of the state