FermionicTrotterization

class FermionicTrotterization(synthesis, *, apply=True, filter=None)

Bases: F2FSynthesis

DEPRECATED The former pass to Trotterize Evolution gates.

This is F2FSynthesis restricted to the Evolution gate: the synthesis argument is the method for that gate.

Initializing this transpiler pass can be done with the arguments listed below.

Deprecated since version 0.4.0: The class qiskit_fermions.transpiler.passes.optimization._deprecated_trotterization.FermionicTrotterization is deprecated as of qiskit-fermions 0.4.0. It will be removed no earlier than 3 months after the release date. Use F2FSynthesis({“Evolution”: synthesis}) instead.

Parameters:

Attributes

methods: dict[str, F2FSynthesisPlugin]

A dictionary of the fermion-to-fermion synthesis methods, by gate.

The keys of this dictionary correspond to the __name__ of a FermionicGate, and the values are instances of the F2FSynthesisPlugin protocol. A gate that is not a key is not touched by this pass, so the dictionary is empty by default, which makes the pass do nothing. Pre-populate it with plugins provided by the F2FSynthesisPluginManager through the config argument.

apply

Whether to expand each selected gate into the factors its plugin produces.

When this is False, the pass only selects the method: it tags each selected gate with its plugin (see FermionicGate.with_synthesis()), except an atomic gate, which is left as it is, and leaves the expansion to whatever builds the gate’s definition later, such as a decompose() call. Note that a gate which is never expanded reaches the fermion-to-qubit stage whole, where it is mapped without its synthesis ever being read.

filter

The predicate selecting which nodes to break down.

Inherited Methods

execute(passmanager_ir, state, callback=None)

Execute optimization task for input Qiskit IR.

Parameters:
  • passmanager_ir (IR) – Qiskit IR to optimize.

  • state (PassManagerState) – State associated with workflow execution by the pass manager itself.

  • callback (Callable[[Task, IR_OUT, PropertySet, float, int], None] | None) – A callback function which is called per execution of optimization task.

Returns:

Optimized Qiskit IR and state of the workflow.

Return type:

tuple[IR_OUT, PassManagerState]

name()

Name of the pass.

Return type:

str

run(dag)

Runs this transpilation pass.

Every node whose gate type is in methods and that is accepted by filter is replaced by the gates that its plugin produces, or (when apply is False) by an equivalent gate merely carrying the plugin. All other nodes are left untouched. The input DAG is modified in place.

Parameters:

dag (DAGCircuit) – the input circuit with fermion-based instructions. Only DAGOpNode with FermionicGate instances as their op are supported, plus Barrier and FermionicMeasure, which are carried through untouched (a measurement keeps the classical bit it writes into).

Returns:

The output circuit which is still acting on a fermionic register.

Return type:

DAGCircuit

update_status(state, run_state)

Update workflow status.

Parameters:
  • state (PassManagerState) – Pass manager state to update.

  • run_state (RunState) – Completion status of current task.

Returns:

Updated pass manager state.

Return type:

PassManagerState