Transpiler Pass Synthesis (B2Q)

The B2QSynthesis transpiler pass exposes a plugin interface (see B2QSynthesisPlugin) through which implementations for mapping boson-based instructions to qubit-based ones can be registered. It is the counterpart of the boson-to-boson synthesis that the B2BSynthesis pass performs one stage earlier (see synthesis).

The available plugins are managed by the B2QSynthesisPluginManager. Choosing the right combination of synthesis plugins is crucial and the B2QSynthesis transpilation pass does not have any default plugins defined! For this, refer to the transpiler presets.

B2QSynthesisPlugin(*args, **kwargs)

The protocol for plugins to the B2QSynthesis transpiler pass.

B2QSynthesisPluginManager()

A simple manager of the installed boson-to-qubit synthesis plugins.

Builtin plugins

The plugins to use at runtime have to be registered in the B2QSynthesis.methods attribute. This can be done easily through the config argument of B2QSynthesis which specifies the plugins to use from the B2QSynthesisPluginManager or it can be done manually by writing into B2QSynthesis.methods directly.

There is one plugin per BosonicGate type. Each is handed the gate and the global B2QLayout, and inserts the equivalent qubit-based instructions.

The builtin plugins are where the boson-to-qubit encoding and the truncation enter the pipeline: the plugins taking a mapper_fn do so through the mapper they wrap, and the InitializeModes plugin through the LevelSpec it is given. This is the point of deferring the encoding to transpile time: the bosonic circuit upstream of this stage is independent of both choices.

The table below lists the builtin plugins, organized by the BosonicGate that they act upon. These are the entry points of the qiskit_bosons.transpiler.synthesis group, named <gate>.<method>:

Table 2 An overview of the builtin qiskit_bosons.transpiler.synthesis entry-points.

Circuit instruction name

Plugin method name

Reference

Evolution

MapperFn

MapperFnEvolutionSynthesis

InitializeModes

Occupation

OccupationInitializeModesSynthesis

MapperFnEvolutionSynthesis(mapper_fn[, ...])

A B2QSynthesisPlugin for transpiling Evolution under a custom mapping.

OccupationInitializeModesSynthesis(spec)

A B2QSynthesisPlugin for transpiling InitializeModes.

Additional helper functions

The Pauli term order that a mapper function produces is preserved through synthesis, since a product formula synthesizes the terms in the order it receives them. These adapters wrap a mapper function to choose that order:

group_wise(mapper_fn)

Wraps a mapper function so that it maps an operator one group at a time.

simplify(mapper_fn)

Wraps a mapper function so that it simplifies the operator it returns.