MapperFnEvolutionSynthesis

class MapperFnEvolutionSynthesis(mapper_fn)

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\).

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

Parameters:

mapper_fn (MapperFunction) – the fermion-to-qubit operator mapping function.

Attributes

mapper_fn: Callable[[OperatorTrait, int], SparseObservable]

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.

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\).

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