Operator

Provides a (usually) lazy representation of an operator, which allows things like QQQ and pQp to be calculated block-by-block. Crucially, the underlying basis for the operator is assumed to be orthonormal.

 

__init__(self, funcs, quanta, prod_dim=None, symmetries=None, selection_rules=None, selection_rule_steps=None, parallelizer=None, logger=None, zero_threshold=None, skipped_indices=None, chunk_size=None): 
  • funcs: callable | Iterable[callable]

    The functions use to calculate representation

  • quanta: int | Iterable[int]

    The number of quanta to do the deepest-level calculations up to (also tells us dimension)

  • prod_dim: int | None

    The number of functions in funcs, if funcs is a direct term generator

  • symmetries: Iterable[int] | None

    Labels for the funcs where if two funcs share a label they are symmetry equivalent

 

clear_cache(self): 
  • :returns: _

 

@property
ndim(self): 

 

@property
shape(self): 

 

load_parallelizer(self): 

Loads the held parallelizer if needed

  • :returns: _

 

@property
parallelizer(self): 

Loads a parallelizer that can be used to speed up various bits of the calculation

  • :returns: _

 

@property
is_diagonal(self): 

 

@property
is_zero(self): 

 

get_inner_indices(self, reduced_inds=False): 

Gets the n-dimensional array of ijkl (e.g.) indices that functions will map over Basically returns the indices of the inner-most tensor

  • :returns: _

 

__getitem__(self, item): 

 

__getstate__(self): 

 

filter_symmetric_indices(self, inds): 

Determines which inds are symmetry unique. For something like qqq all permutations are equivalent, but for pqp we have pi qj pj distinct from pj qj pi. This means for qqq we have (1, 0, 0) == (0, 1, 0) but for pqp we only have stuff like (2, 0, 1) == (1, 0, 2) .

  • inds: np.ndarray

    indices to filter symmetric bits out of

  • :returns: _

    s y m m e t r i c

i n d i c e s

&

i n v e r s e

m a p

 

get_elements(self, idx, parallelizer=None, check_orthogonality=True, memory_constrained=False): 

Calculates a subset of elements

  • idx: BraKetSpace

    bra and ket states as tuples of elements

  • :returns: _

 

__repr__(self): 

 

get_transformed_space(self, base_space, rules=None, parallelizer=None, logger=None, **opts): 

Returns the space one would get from applying the selection rules from this operator

  • base_space: BasisStateSpace
  • :returns: SelectionRuleStateSpace

 

apply_reduced(self, base_space, parallelizer=None, logger=None): 

Takes a base space as input and applies the held selection rules in semi-efficient fashion only on the indices that can change and then uses this to compute all matrix elements, returning then the final generated space

  • base_space: BasisStateSpace | PermutationallyReducedStateSpace
  • :returns: tuple[SparseArray, BraKetSpace]

Feedback

Examples

Templates

Documentation