Majorana
A single Majorana monomial: the ordered product gamma_\{i_1\} ... gamma_\{i_w\}.
A term is the atom a :class:MajoranaOperator is built from and the generator an
:class:~monoprop.circuit.ExpGate gate exponentiates. Indices are sorted on construction
(matching the operator's canonicalization) and must be distinct and non-negative. A
repeated index is rejected because gamma_i^2 = 1 would silently change the monomial's
weight -- almost always a mistake rather than an intended simplification.
An immutable value object: equal indices compare equal and hash alike, so a term can be
used as a dictionary key (as :attr:MajoranaOperator.terms does).
Attributes
attribute__slots__= ('indices',)attributeindices= orderedThe sorted, distinct Majorana indices of the monomial.
Functions
func__init__(self, *indices) -> NoneInitialize the Majorana monomial from its indices.
paramselfparamindicesint= ()Returns
Nonefunc__eq__(self, other) -> boolTwo Majorana terms are equal when their sorted indices match.
paramselfparamotherobjectReturns
boolfunc__hash__(self) -> intHash on the sorted indices so equal terms share a bucket.
paramselfReturns
intfunc__repr__(self) -> strReturn a string representation such as Majorana(4, 5).
paramselfReturns
str