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 \(H\) of the incoming Evolution gate to a qubit operator using mapper_fn and emits a PauliEvolutionGate. It thereby preserves the \(e^{-i t H}\) convention of the Evolution gate, with the same evolution time \(t\).

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. If None (the default), the gate’s own default synthesis is used (a first-order LieTrotter decomposition with a single repetition).

Attributes

mapper_fn: MapperFunction

The fermion-to-qubit operator mapping function.

The two input arguments should be the following:

  1. the operator to be mapped.

  2. the number of qubits that the resulting operator should be defined on.

Note

It is the user’s responsibility to ensure that this function is in-sync with the global transpilation F2QLayout setting.

product_formula: EvolutionSynthesis | None

The product formula used to synthesize the emitted PauliEvolutionGate, or None to defer to that gate’s own default synthesis.

Methods

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 \(e^{-i t H}\) with the original evolution time \(t\) and the product_formula synthesis.

Parameters:
Return type:

None

See also

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:
Return type:

None