quantax.state.DenseState#
- class quantax.state.DenseState#
Bases:
StateDense state in which the full wave function is stored as a numpy array
- __init__(psi: ndarray | Array | LogArray | ScaleArray, symm: Symmetry | None = None)#
- Parameters:
psi – 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 psi: ndarray | Array | LogArray | ScaleArray#
Full wave function
- todense(symm: Symmetry | None = None) DenseState#
Convert the state to a new
DenseStatewith the given symmetry- Parameters:
symm – The new symmetry. It’s default to
self.symm, soselfwithout copy is returned by default.
- normalize() DenseState#
Return a
DenseStatewith 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 use_ref: bool#
Whether to use reference implementation for local updates. Default to False.