AbstractStateSpace
Represents a generalized state space which will provide core methods to index into a basis and generate representations
keep_excitations: bool
keep_indices: bool
StateSpaceSpec: StateSpaceSpec
StateSpaceCache: StateSpaceCache
excitations_dtype: dtype[int8]
indices_dtype: dtype[uint64]
__init__(self, basis):
basis
:RepresentationBasis
to_state(self, serializer=None):
Provides just the state that is needed to serialize the object
serializer
:Any
:returns
:_
from_state(state, serializer=None):
Loads from the stored state
serializer
:Any
:returns
:_
@property
ndim(self):
@property
excitations(self):
@property
mode(self):
get_mode(self):
Returns the mode (indices or excitations) for the held states
:returns
:_
@property
has_indices(self):
@property
has_excitations(self):
@property
indices(self):
@property
indexer(self):
@property
exc_indexer(self):
find(self, to_search, check=True, minimal_dtype=False, dtype=None, missing_val='raise'):
Finds the indices of a set of indices inside the space
to_search
:np.ndarray | AbstractStateSpace
array of ints
:returns
:_
__len__(self):
@property
unique_len(self):
@property
unique_indices(self):
Returns the unique indices
:returns
:_
@property
unique_excitations(self):
Returns the unique excitations
:returns
:_
as_indices(self):
Returns the index version of the stored states
:returns
:np.ndarray
as_unique_indices(self, sort=False):
Returns unique indices
:returns
:_
as_excitations(self):
Returns the excitation version of the stored states
:returns
:np.ndarray
as_unique_excitations(self, sort=False):
Returns unique excitations
:returns
:_
get_representation_indices(self, other=None, selection_rules=None, freqs=None, freq_threshold=None):
Returns bra and ket indices that can be used as indices to generate representations
other
:Any
selection_rules
:Any
freqs
:Any
freq_threshold
:Any
:returns
:(np.ndarray, np.ndarray)
get_representation_brakets(self, other=None, selection_rules=None, freqs=None, freq_threshold=None):
Returns a BraKetSpace that can be used as generate representations
other
:Any
selection_rules
:Any
freqs
:Any
freq_threshold
:Any
:returns
:BraKetSpace
take_states(self, states):
Takes the intersection of self and the specified states
states
:Any
:returns
:_
take_subspace(self, sel):
Takes a subset of the states
sel
:Any
:returns
:AbstractStateSpace
take_subdimensions(self, inds):
Takes a subset of the state dimensions
sel
:Any
:returns
:AbstractStateSpace
drop_states(self, states):
Takes the difference of self and the specified states
states
:Any
:returns
:_
drop_subspace(self, sel):
Drops a subset of the states
sel
:Any
:returns
:AbstractStateSpace
drop_subdimensions(self, inds):
Drops a subset of the state dimensions
sel
:Any
:returns
:AbstractStateSpace
get_states_with_quanta(n, ndim):
Returns the states with number of quanta equal to n
quanta
:Any
:returns
:_
num_states_with_quanta(n, ndim):
Returns the states with number of quanta equal to n
quanta
:Any
:returns
:_
to_single(self, track_excitations=True, track_indices=True):
Flattens any complicated state space structure into a
single space like a BasisStateSpace
:returns
:_
split(self, chunksize):
Subclass overridable function to allow for spaces to be split up into chunks
chunksize
:Any
:returns
:_
share(self, shared_memory_manager):
unshare(self, shared_memory_manager):