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:
wave_function – Full wave function given according to the basis.states order in QuSpin
symm – The symmetry of the wave function, default to
quantax.symmetry.Identity
- __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
, soself
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