FermionicTrotterization¶
- class FermionicTrotterization(synthesis, *, apply=True, filter=None)¶
Bases:
F2FSynthesisDEPRECATED The former pass to Trotterize
Evolutiongates.This is
F2FSynthesisrestricted to theEvolutiongate: thesynthesisargument 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.FermionicTrotterizationis 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:
synthesis (F2FSynthesisPlugin) – the synthesis method for
Evolutiongates.apply (bool) – see
F2FSynthesis.filter (Callable[[DAGOpNode], bool] | None) – see
F2FSynthesis.
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 aFermionicGate, and the values are instances of theF2FSynthesisPluginprotocol. 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 theF2FSynthesisPluginManagerthrough theconfigargument.
- 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 (seeFermionicGate.with_synthesis()), except anatomicgate, which is left as it is, and leaves the expansion to whatever builds the gate’s definition later, such as adecompose()call. Note that a gate which is never expanded reaches the fermion-to-qubit stage whole, where it is mapped without itssynthesisever 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]
- run(dag)¶
Runs this transpilation pass.
Every node whose gate type is in
methodsand that is accepted byfilteris replaced by the gates that its plugin produces, or (whenapplyisFalse) 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
DAGOpNodewithFermionicGateinstances as theiropare supported, plusBarrierandFermionicMeasure, 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:
- 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: