ExpGate
The exponential of a generator: one variational gate, abstract over the family.
A single gate type serves every family; the generator must be an operator object (it
carries the system size), and its type decides how it is normalized (mirroring how a
single :class:Circuit dispatches on its gates):
- :class:
~monoprop.majorana.MajoranaOperator-- a Majorana generator carrying the Hermitian operator (its coefficients follow the same convention as an observable: imaginary for a weight-2 monomial, real for weight-4); it is antihermitian-normalized -- the Hermitian phase :math:i^\{\binom\{w\}\{2\}\}divided out -- by :func:_gate_layerswhen the circuit is ingested. A coefficient that leaves a non-negligible imaginary residue after normalization is rejected as non-Hermitian. - :class:
~monoprop.pauli.PauliOperator-- a qubit generator; each Pauli term is Jordan-Wigner mapped and antihermitian-normalized by :func:expand_monomialswhen the circuit is ingested, using the propagator's qubit count. - :class:
~monoprop.fermi.FermiOperator-- a fermionic generator; converted to its (Hermitian) Majorana form by :meth:get_majorana_operatorright here in__init__, so the gate is a"majorana"gate from then on. The fermionic-to-Majorana mapping already carries the factors of :math:\tfrac12and the phases, so the resulting coefficients are exactly the Hermitian convention above -- no separate fermionic normalization is needed.
All three families thus take the Hermitian generator and normalize it identically; the
only exception is the internal wire/dense format (:meth:Circuit.from_dense_arrays), whose
coefficients are already the real structural g and are flagged so :func:_gate_layers
passes them through unchanged.
Attributes
attribute__slots__= ('_structural', 'family', 'generator', 'index')attributegenerator= generatorThe generator operator (a MajoranaOperator or PauliOperator; a
FermiOperator is stored in its converted MajoranaOperator form).
attributeindex= None if index is None else int(index)The variational-angle index driving this gate, or None for the identity
mapping (see :class:Circuit).
attributefamily= familyThe generator family -- "pauli" or "majorana" -- inferred from the
generator type at construction (a fermionic generator becomes "majorana").
attribute_structural= _structuralattribute__hash__= NoneFunctions
func__init__(self, generator, index=None, *, _structural=False) -> NoneWrap a generator operator; its type selects the family and normalization convention.
The generator must be an operator object -- a
:class:~monoprop.majorana.MajoranaOperator,
:class:~monoprop.pauli.PauliOperator, or
:class:~monoprop.fermi.FermiOperator -- because those carry the system
num_modes / num_qubits. A bare :class:~monoprop.majorana.Majorana /
:class:~monoprop.pauli.Pauli term is not accepted; wrap it in the
corresponding operator (e.g. MajoranaOperator(\{(0, 1): 1j\}, num_modes) -- a Majorana
generator carries the Hermitian operator, so a weight-2 coefficient is imaginary).
_structural is internal: :meth:_structural_gate sets it when the generator already
carries the real structural coefficients g (the wire/dense format), so
:func:_gate_layers passes them through rather than antihermitian-normalizes them.
paramselfparamgeneratorMajoranaOperator | PauliOperator | FermiOperatorparamindexint | None= Noneparam_structuralbool= FalseReturns
Nonefunc__eq__(self, other) -> boolEqual when the generator, parameter index, family, and structural flag all match.
paramselfparamotherobjectReturns
boolfunc__repr__(self) -> strReturn a string representation such as ExpGate(\<generator>, index=0).
paramselfReturns
str