qdk_chemistry.plugins.qiskit._interop.circuit module

Utilities to analyze and plot qiskit quantum circuits.

class qdk_chemistry.plugins.qiskit._interop.circuit.CircuitInfo(circuit)[source]

Bases: object

Data class to store information of a quantum circuit.

This class provides methods to analyze the circuit and summarize its properties.

Parameters:

circuit (QuantumCircuit)

circuit: QuantumCircuit

The quantum circuit to analyze.

num_qubits: int

Number of qubits in the circuit.

depth: int

Depth of the circuit.

num_gates: int

Total number of gates in the circuit.

gate_counts: Counter

Counts of each type of gate in the circuit.

count_gate_category(gate_list)[source]

Return the number of gates in the circuit that belong to a list.

Return type:

int

Parameters:

gate_list (frozenset[str])

count_gate(gate_name)[source]

Return the number of times a specific gate appears.

Return type:

int

Parameters:

gate_name (str)

property num_single_qubit_clifford: int[source]

Return the number of single-qubit Clifford gates in the circuit.

__init__(circuit)
Parameters:

circuit (QuantumCircuit)

Return type:

None

property num_two_qubit_clifford: int[source]

Return the number of two-qubit Clifford gates in the circuit.

property num_non_clifford: int[source]

Return the number of non-Clifford gates in the circuit.

summary()[source]
Return type:

dict

qdk_chemistry.plugins.qiskit._interop.circuit.analyze_qubit_status(circuit)[source]

Analyze the status of qubits in a quantum circuit.

Note: The gate classification logic depends on the settings defined in definitions.py. Please modify gate sets to ensure gate consistency.

This function inspects the quantum circuit to determine the role of each qubit:

  • “quantum”: has a quantum gate applied

  • “classical”: touched by gates but bitstring outputs are deterministic

  • “idle”: has no gates applied

Parameters:

circuit (QuantumCircuit) – The quantum circuit to analyze.

Returns:

A summary of qubit roles indexed by qubit index.

Return type:

dict[int, str]

qdk_chemistry.plugins.qiskit._interop.circuit.plot_circuit_diagram(circuit, remove_idle_qubits=True, remove_classical_qubits=True, output_file=None, **draw_kwargs)[source]

Plots a simplified circuit diagram, removing idle or classical qubits safely.

Ensures measurement targets and classical registers remain consistent.

Parameters: