CircuitDAG#

Module: iqm.qrisp_iqm.passes.routing.core.graph_processing_tools

class iqm.qrisp_iqm.passes.routing.core.graph_processing_tools.CircuitDAG(indptr, indices, instruction_data)#

Bases: tuple

Describes the quantum circuit as a DAG.

All the items are of the type np.ndarray[int]. The m * m adjacency matrix A of the DAG is stored here in CSR form. The nodes are instructions in the circuit, and the edges correspond to qubits the instructions are acting on. Edge direction represents causality (relative time ordering).

  • indices is a 1-D array containing column indices of the nonzero elements of A.

  • indptr is a 1-D array, where indptr[k] is the number of nonzero elements in A above row k.

  • instruction_data is a shape==(m, 3) array describing the instructions:

    • instruction_data[i, 0]: index of the first qubit of the instruction locus

    • instruction_data[i, 1]: index of the second qubit of the instruction locus (for one-qubit gates the same as first)

    • instruction_data[i, 2]: index that identifies the qrisp.Instruction the node corresponds to. The list of Instruction objects is kept outside of the jitted code, and is used to reconstruct the qrisp.QuantumCircuit object once jit-based compilation has concluded.

Attributes

indices

Alias for field number 1

indptr

Alias for field number 0

instruction_data

Alias for field number 2

Methods

indices#

Alias for field number 1

indptr#

Alias for field number 0

instruction_data#

Alias for field number 2

Inheritance

Inheritance diagram of iqm.qrisp_iqm.passes.routing.core.graph_processing_tools.CircuitDAG