Skip to content

transpiler ¤

This module contains the Transpiler class, which is designed to convert quantum circuits into formats that are more suitable for execution on hardware backends

Classes:

Name Description
Transpiler

The transpilation process involves converting the operations

Transpiler(chip_backend: Backend | None = None) ¤

The transpilation process involves converting the operations in the circuit to those supported by the device and swapping qubits (via swap gates) within the circuit to overcome limited qubit connectivity.

Obtain basic information from input quantum circuit.

Parameters:

Name Type Description Default
qc QuantumCircuit | str | list

The quantum circuit to be transpiled. Can be a QuantumCircuit object or OpenQASM 2.0 str or qlisp list.

required
chip_backend Backend

An instance of the Backend class that contains the information about the quantum chip to be used for layout selection. Defaults to None

None

Raises:

Type Description
TypeError

The quantum circuit format is incorrect.

Source code in quark/circuit/transpiler.py
38
39
40
41
42
43
44
45
46
47
48
49
50
def __init__(self, chip_backend: Backend|None = None):

    r"""Obtain basic information from input quantum circuit.

    Args:
        qc (QuantumCircuit | str | list): The quantum circuit to be transpiled. Can be a QuantumCircuit object or OpenQASM 2.0 str or qlisp list.

        chip_backend (Backend): An instance of the Backend class that contains the information about the quantum chip to be used for layout selection. Defaults to None

    Raises:
        TypeError: The quantum circuit format is incorrect.
    """
    self.chip_backend = chip_backend