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 | LogArray | ScaleArray#
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 | LogArray | ScaleArray#
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 convertingselfandothertoDenseState.
- property Nsites: int#
Number of sites
- property nsymm: int#
Number of symmetry group elements
- property basis#
Quspin basis of the state
- property Nparticles: Tuple[int, int] | None#
Number of particle convervation of the state
- property use_ref: bool#
Whether to use reference implementation for local updates. Default to False.
- todense(symm: Symmetry | None = None) DenseState#
Obtain the
quantax.state.DenseStatecorresponding 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) ndarray | Array | LogArray | ScaleArray#
Norm of state
- Parameters:
ord – Order of the norm, default to 2-norm \(\sqrt{\sum_s |\psi(s)|^2}\)