monoprop

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 Circuit dispatches on its gates):

  • 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 i(w2)i^{\binom{w}{2}} divided out -- by _gate_layers when the circuit is ingested. A coefficient that leaves a non-negligible imaginary residue after normalization is rejected as non-Hermitian.
  • monoprop.pauli.PauliOperator -- a qubit generator; each Pauli term is Jordan-Wigner mapped and antihermitian-normalized by expand_monomials when the circuit is ingested, using the propagator's qubit count.
  • monoprop.fermi.FermiOperator -- a fermionic generator; converted to its (Hermitian) Majorana form by get_majorana_operator right here in __init__, so the gate is a "majorana" gate from then on. The fermionic-to-Majorana mapping already carries the factors of 1/2 and 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 (Circuit.from_dense_arrays), whose coefficients are already the real structural g and are flagged so _gate_layers passes them through unchanged.

Attributes

attribute__slots__
= ('_structural', 'family', 'generator', 'index')
attributegenerator
= self._truncated_term(generator, atol)

The 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 Circuit).

attributefamily
= family

The generator family -- "pauli" or "majorana" -- inferred from the generator type at construction (a fermionic generator becomes "majorana").

attribute_structural
= _structural
attribute__hash__
= None

Functions

func__init__(self, generator, index=None, *, atol=1e-08, _structural=False) -> None

Wrap a generator operator; its type selects the family and normalization convention.

The generator must be an operator object -- a monoprop.majorana.MajoranaOperator, monoprop.pauli.PauliOperator, or monoprop.fermi.FermiOperator -- because those carry the system num_modes / num_qubits. A bare monoprop.majorana.Majorana / 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).

atol is the tolerance for rejecting a non-Hermitian Majorana or Pauli terms; if the corresponding coefficients are below the threshold in the absolute values, they are discarded.

_structural is internal: _structural_gate sets it when the generator already carries the real structural coefficients g (the wire/dense format), so _gate_layers passes them through rather than antihermitian-normalizes them.

paramself
paramgeneratorMajoranaOperator | PauliOperator | FermiOperator
paramindexint | None
= None
paramatolfloat
= 1e-08
param_structuralbool
= False

Returns

None
func__eq__(self, other) -> bool

Equal when the generator, parameter index, family, and structural flag all match.

paramself
paramotherobject

Returns

bool
func__repr__(self) -> str

Return a string representation such as ExpGate(\<generator>, index=0).

paramself

Returns

str

On this page