qrunch.quantum.circuits.transpilation.transpiler

Module with transpiler that can transpile a Kvantify Qrunch Circuit to universal third party circuits.

Classes

Transpiler

Class for transpile circuits, i.e., compile the circuit to universal gates and translate to circuit type.

class Transpiler

Bases: Generic[ThirdPartyCircuit]

Class for transpile circuits, i.e., compile the circuit to universal gates and translate to circuit type.

__init__(compiler: Compiler, translator: Translator[ThirdPartyCircuit], synthesizer: LayoutSynthesizer | None = None) None

Initialize a transpiler.

Parameters:
  • compiler (Compiler) – Compiler to use.

  • translator (Translator[ThirdPartyCircuit]) – Translator to use.

  • synthesizer (LayoutSynthesizer | None) – Layout synthesizer to use. Defaults to None.

Return type:

None

transpile(circuits: Circuit | Sequence[Circuit], device_data: DeviceData | None = None) list[TranspiledCircuit[ThirdPartyCircuit]]

Transpile the given circuits to third party circuits format.

This is done first by compiling the circuit to a universal gate set, and then translating the gates to third party circuit using the given translator.

Parameters:
  • circuits (Circuit | Sequence[Circuit]) – circuits to transpile.

  • device_data (DeviceData | None) – Device data for the circuit to be mapped to. If None, all-to-all connection is assumed.

Return type:

list[TranspiledCircuit[ThirdPartyCircuit]]