quantax.state.DenseState#

class quantax.state.DenseState#

Bases: State

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

__init__(psi: ndarray | Array | LogArray | ScaleArray, 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 psi: ndarray | Array | LogArray | ScaleArray#

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#

Return a DenseState with normalized wave function.

normalize_() None#

Normalize the wave function.

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

Number of particle convervation of the state

property Nsites: int#

Number of sites

property basis#

Quspin basis of the state

norm(ord: int | None = None) ndarray | Array | LogArray | ScaleArray#

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

property symm: Symmetry#

Symmetry of the state

property use_ref: bool#

Whether to use reference implementation for local updates. Default to False.