MajoranaPropagator
Classical simulator for Majorana operators.
Accepts a MajoranaOperator (or any object implementing
get_majorana_operator(), such as a FermiOperator) and a
Circuit of Majorana/fermionic gates. See
MonomialPropagator for the shared surface.
Attributes
attributen_gatesintNumber of authoring gates ingested into the graph.
A single-Majorana-monomial gate expands to one graph layer; a multi-monomial gate
expands to several layers sharing one gate, so n_gates \<= graph_layers. Stays
correct after a graph prefix is consumed by
contract_partially /
propagate.
attributeparameter_mappinglist[int]The parameter mapping owned by the graph, one entry per graph layer.
Entry i is the variational-parameter index driving the i-th graph layer (a
generated Majorana monomial), in the same order as the parameter vector passed to
expectation_value.
This is the graph's native (per-monomial) mapping, which
is finer-grained than the per-gate mapping of the authoring
Circuit when gates bundle several monomials.
attributegraph_layersintNumber of evolved Majorana monomials (graph layers).
attributenum_modesintNumber of fermionic modes for the simulator.
Functions
func__init__(self, initial_operator, initial_state, *, cutoff, schrodinger_cutoff=None, cutoff_type='length', lower_atol=None, upper_atol=None, comm=None) -> NoneInitialize the propagator.
paramselfparaminitial_operatorIQuantumOperator | MajoranaOperatorA MajoranaOperator or any object
implementing get_majorana_operator().
paraminitial_stateSequence[int] | np.ndarraySlater determinant, as occupied mode indices.
paramcutoffintBound on the complexity of the Majorana monomials retained during evolution,
read according to cutoff_type. A fully paired monomial -- support made up
entirely of complete pairs (m_\{2j-1\} m_\{2j\}) -- is kept regardless: only paired
monomials contribute against a computational-basis state or Slater determinant.
paramschrodinger_cutoffint | None= NoneNone (default) keeps the Heisenberg picture; an integer selects
the Schrodinger picture and bounds the evolved state -- including its initialization
from initial_state -- by the same notion as cutoff_type. Choose it at least
as large as cutoff for comparable accuracy.
paramcutoff_typestr= 'length'"length" (default) bounds the number of Majorana operators in a
monomial; "support" bounds the distinct orbitals it acts on. The fully-paired
exception applies on top of either.
paramlower_atolNone | float= NoneMonomials with |coeff| \< lower_atol are discarded during evolution.
paramupper_atolNone | float= NoneMonomials with |coeff| > upper_atol are kept regardless of complexity.
paramcommMPI.Comm | None= NoneOptional MPI communicator (must outlive the simulator).
Returns
Nonefuncevolved_operator(self, parameters=None, *, atol=1e-12) -> MajoranaOperatorReturn the evolved operator as a MajoranaOperator.
Equivalent to
contract_partially
with inplace=False, without touching the simulator state. Unlike the base method, which
hands back the engine's raw index tuples, this wraps them into a Majorana operator carrying
the propagator's mode count.
paramselfparamparametersParameterValues= NoneVariational parameter values (see
expectation_value).
paramatolfloat= 1e-12Terms with |coeff| \< atol are dropped; 0.0 keeps all of them.
Returns
monoprop.majorana.MajoranaOperatorThe evolved operator (Heisenberg picture) or evolved state (Schrodinger picture).
funcupdate_initial_operator(self, new_operator) -> NoneReplace the initial operator (existing terms only).
Re-weights the initial operator the graph is evaluated against, without touching the evolution graph or rebuilding the simulator. Only the initial operator is affected -- the gates and their generator coefficients are unchanged.
paramselfparamnew_operatorMajoranaOperatorA MajoranaOperator whose terms
replace the matching initial-operator coefficients.
Returns
Nonefunccutoff_type(self, new_cutoff_type) -> NoneSet the cutoff type ("length" or "support").
paramselfparamnew_cutoff_typestrReturns
Nonefuncbuild_graph(self, circuit, *, seed_parameters=None, only_rotate_len_k=None) -> NoneAppend a circuit to the propagation graph.
Builds (or extends) the reusable evolution graph, recording each layer's gate
information (the parameter that drives it and its generator coefficient) so that
later evaluation takes only parameters. The circuit's angle indices are local
(0-based); when extending a non-empty graph they are shifted up onto the
accumulated parameter axis automatically, so each call's circuit is authored
independently.
paramselfparamcircuitCircuitGates to append, as a Circuit.
paramseed_parametersParameterValues= NoneThe full parameter vector covering the whole accumulated graph, used to regenerate the coefficient seed (by contracting the existing graph) so coefficient truncation sees realistic coefficients when extending. Only needed when extending a non-empty graph with coefficient-informed truncation; on the first (or a single) call it defaults to the circuit's own parameters. When omitted while extending, the new layers are built structurally (coefficient truncation is skipped for them); the engine validates the length of an explicit seed.
paramonly_rotate_len_kint | None= NoneIf provided, apply gates to Majorana monomials of length <= k in the evolved operator even if they anticommute. Useful when many free-fermionic gates (generators that are length-2 Majorana monomials) are applied before expectation-value estimation in Schrodinger-picture simulations.
Returns
Nonefuncsize(self) -> intNumber of Majorana monomials currently tracked.
paramselfReturns
intThe number of distinct Majorana monomial terms in the simulator's current representation.