MapperFnEvolutionSynthesis
class MapperFnEvolutionSynthesis(mapper_fn, product_formula=None)
Bases: object
A F2QSynthesisPlugin for transpiling Evolution under a custom mapping.
This plugin maps the fermionic Hamiltonian of the incoming Evolution gate to a qubit operator using mapper_fn and emits a PauliEvolutionGate. It thereby preserves the convention of the Evolution gate, with the same evolution time .
How that PauliEvolutionGate is subsequently decomposed into basis gates is governed by the product formula passed as product_formula. Leaving it at its default (None) defers to the PauliEvolutionGate’s own default synthesis (a first-order LieTrotter decomposition with a single repetition). Supplying an explicit EvolutionSynthesis – for example a higher-order SuzukiTrotter or one with several repetitions – selects a different Trotter-Suzuki product formula, trading circuit depth for a smaller Trotter error.
Initializing this transpiler pass plugin can be done with the arguments listed below.
Parameters
- mapper_fn (MapperFunction) – the fermion-to-qubit operator mapping function.
- product_formula (EvolutionSynthesis | None) – the product formula with which to synthesize the emitted
PauliEvolutionGate. IfNone(the default), the gate’s own default synthesis is used (a first-orderLieTrotterdecomposition with a single repetition).
Attributes
mapper_fn
Type: MapperFunction
The fermion-to-qubit operator mapping function.
The two input arguments should be the following:
- the operator to be mapped.
- the number of qubits that the resulting operator should be defined on.
It is the user’s responsibility to ensure that this function is in-sync with the global transpilation F2QLayout setting.
product_formula
Type: EvolutionSynthesis | None
The product formula used to synthesize the emitted PauliEvolutionGate, or None to defer to that gate’s own default synthesis.
Methods
run
run(in_node, out_dag, *, f2q_layout)
Runs this transpilation plugin.
The fermionic Hamiltonian of the incoming Evolution gate is mapped to a qubit operator via mapper_fn, simplified, and appended to out_dag as a PauliEvolutionGate implementing with the original evolution time and the product_formula synthesis.
Parameters
- in_node (DAGOpNode) – the input fermion-based circuit instruction. When this plugin gets called, the
in_node.opattribute must be of typeEvolution. - out_dag (DAGCircuit) – the output qubit-based circuit.
- f2q_layout (dict[QuantumRegister, QuantumRegister]) – the global transpilation
F2QLayoutsetting.
Return type
None
The documentation of F2QSynthesisPlugin for more detailed explanations of the arguments.
Raises
NotImplementedError – when in_node acts on fermionic modes that are spread across multiple FermionicRegister instances.
Parameters
- in_node (DAGOpNode)
- out_dag (DAGCircuit)
- f2q_layout (dict[QuantumRegister, QuantumRegister])
Return type
None