Skip to content

basepasses ¤

This module contains the TranspilerPass class, an abstract base class for defining transpiler passes that transform or optimize quantum circuits. Subclasses must implement the run method to process QuantumCircuit objects.

Classes:

Name Description
TranspilerPass

Abstract base class for defining transpiler passes that transform or optimize quantum circuits.

TranspilerPass() ¤

Bases: ABC

Abstract base class for defining transpiler passes that transform or optimize quantum circuits.

Methods:

Name Description
run

Execute the transpiler pass on a quantum circuit.

Source code in quark/circuit/basepasses.py
31
32
def __init__(self):
    pass

run(qc: QuantumCircuit) abstractmethod ¤

Execute the transpiler pass on a quantum circuit.

Parameters:

Name Type Description Default
qc QuantumCircuit

The quantum circuit to be processed by this transpiler pass.

required
Source code in quark/circuit/basepasses.py
34
35
36
37
38
39
40
41
@abstractmethod
def run(self, qc:QuantumCircuit):
    """Execute the transpiler pass on a quantum circuit.

    Args:
        qc (QuantumCircuit): The quantum circuit to be processed by this transpiler pass.
    """
    pass