RepresentationBasis

Metaclass for representations. Requires concrete implementations of the position and momentum operators.

name: str
selection_rules_mapping: dict

 

__init__(self, function_generator, n_quanta): 
  • function_generator: Any
  • n_quanta: int

    numbers of quanta (hold over from initial implementation)

 

__eq__(self, other): 

 

@property
dimensions(self): 

Returns the dimensions of the basis

  • :returns: _

 

@property
ndim(self): 

Returns the number of dimensions of the basis

  • :returns: _

 

ravel_state_inds(self, idx): 

Converts state indices from an array of quanta to an array of indices…except in 1D this really isn’t doing anything

  • idx: Iterable[Iterable[int]]

    indices

  • :returns: tuple[int]

    a r r a y

o f

s t a t e

i n d i c e s

i n

t h e

b a s i s

 

unravel_state_inds(self, idx): 

Converts state indices from an array of ints to an array of quanta…except in 1D this really isn’t doing anything

  • idx: Iterable[int]

    indices

  • :returns: tuple[tuple[int]]

    a r r a y

o f

s t a t e

t u p l e s

i n

t h e

b a s i s

 

__getitem__(self, item): 

 

__repr__(self): 

 

p(self, n): 

Generates the momentum matrix up to n-quanta. There’s one big subtlety to what we’re doing here, which is that for efficiency reasons we return an entirely real matrix The reason for that is we assumed people would mostly use it in the context of stuff like pp, pQp, or pQQp, in which case the imaginary part pulls out and becomes a negative sign We actually use this assumption across all of our representations.

  • n: Any
  • :returns: _

 

x(self, n): 

Generates the coordinate matrix up to n-quanta

  • n: Any
  • :returns: _

 

I(self, n): 

Generates the identity matrix up to n-quanta

  • n: Any
  • :returns: _

 

@property
operator_mapping(self): 

 

operator(self, *terms, logger=None, parallelizer=None, chunk_size=None, **operator_settings): 

Provides an Operator to handle the given terms

  • terms: Any
  • logger: Any
  • parallelizer: Any
  • chunk_size: Any
  • :returns: _

 

representation(self, *terms, logger=None, name=None, parallelizer=None, chunk_size=None, memory_constrained=False): 

Provides a representation of a product operator specified by terms

  • terms: Any
  • :returns: _

 

selection_rule_steps(self, *terms): 

Generates the full set of possible selection rules for terms

  • terms: Any
  • :returns: _

 

selection_rules(self, *terms): 

Generates the full set of possible selection rules for terms

  • terms: Any
  • :returns: _

Feedback

Examples

Templates

Documentation