| Property or Function | Description |
|---|---|
haiqu_circuit.analytics | Provides ALL raw metrics data, represented as Python objects. These can be accessed in the standard manner, exported, or shared with other components of the quantum experiment. |
haiqu_circuit.core_metrics() | Renders a widget that displays a table of core analytics metrics. This core analysis provides insights into the high-level structure of the quantum circuit. |
haiqu_circuit.advanced_metrics() | Renders a widget that displays a table with advanced quantum circuit metrics. The advanced analysis provides insights into critical components of the circuit, including connectivity, the depth of two-qubit interactions, the amount of entanglement present, and the circuit’s capacity to execute operations concurrently. |
haiqu_circuit.evolution | Provides raw metrics data for the circuit evolution, as the circuit is traversed, represented as Python objects. These too can be accessed in the standard manner, exported, or shared with other components of the quantum experiment. |
haiqu_circuit.draw_evolution() | Generates a plot showing the evolution of key circuit metrics as the circuit is traversed. The original circuit is divided gate-by-gate or into slices, based on the initial depth. Metrics are calculated for each slice, providing insights into changes in connectivity, depth of two-qubit interactions, degree of entanglement, and concurrent operation performance. |
haiqu_circuit.draw_radar() | Renders a widget displaying the radar (wind-rose) plot. |
haiqu_circuit.draw_gate_diversity() | Renders a widget showing the number of different gates in the circuit. It has two modes: original and normalized to basis gates. The basis_gates=True option will display the normalized (transpiled to basis gates set RX, RY, RZ and CX) view for gate diversity. |
haiqu_circuit.draw_liveness_per_qubit() | Renders a widget displaying the liveness per qubit plot. The liveness metric reveal the frequency of qubit activity during execution in relation to the total circuit depth, indicating qubit utilization. |
haiqu_circuit.draw_correlation_matrix() | Renders a normalized interaction matrix (heatmap) that quantifies how frequently each pair of qubits participates together in two-qubit gates within a given quantum circuit. |
help=True option. Whenever possible, the widget displays a column to provide assistance for each metric. Data can be exported in formats including JSON, CSV, or used in Pandas for further analysis.
Step 1. Define and submit a quantum circuit
Haiqu SDK supports the Qiskit circuit and QASM formats.1.1. Load a quantum circuit as a QASM file:
1.2. Define a standard Qiskit circuit:
1.3. Submit a circuit for analysis
To utilize the analytics functions invoke thehaiqu.log() method. This computes the complete set of quantum metrics using the Haiqu API and returns them in a single metadata object.
Let’s submit a circuit for analysis with Haiqu quantum backend:
wait_for_analytics() polls for a completed job and then loads the metrics into the local Haiqu circuit object.
Step 2. Run basic analysis
Before executing a quantum circuit, it is crucial to assess its fundamental properties to ensure feasibility and compatibility with available simulators or hardware. This step helps determine circuit size, gate composition, and whether it contains custom or unsupported operations. By analyzing these factors, users can make informed decisions about device selection, potential optimizations, and whether additional modifications are needed before execution. The circuit’s basic metrics are displayed using:- The
number of qubitsin the original circuit. - The
depthof the original circuit and the depth of the circuit normalized (transpiled) to basis gates. - The
count of 1-qubitand2-qubit gatesfor the normalized circuit. - The
total number of gates.
Step 3. Run advanced analysis
Understanding the additional properties of a quantum circuit may be essential for predicting performance and optimizing execution. This step evaluates entanglement, circuit density, and qubit connectivity, which impact simulability, execution time, and hardware performance. By analyzing long-range interactions, gate expressivity, and parameterized structures, users can assess whether their circuit is well-structured for efficient computation and whether alternative implementations could improve performance. To display the advanced circuit metrics call:Program communication: Evaluates qubit connectivity by computing the sum of interaction degrees in the circuit’s interaction graph.Critical depth: Determines the depth of two-qubit interactions relative to their total count, assessing the circuit’s parallel execution potential.Entangling Gates Ratio: Calculates the fraction of two-qubit gates in the circuit, which may impact the present entanglement.Parallelism: Measures the circuit’s ability to execute operations simultaneously by comparing total gate count to circuit depth.Liveness: Computes how often qubits are active during execution relative to total circuit depth, indicating qubit utilization.
Step 4. Other metric visualizations
4.1. Radar Plot
TheRadar Plot aids visualizing and comparing circuit properties such as Program Communication, Critical Depth, Entangling Gates Ratio, Parallelism, and Liveness, providing an intuitive way to assess and contrast the performance trade-offs of different circuits.
4.2. Gate Diversity
TheGate Diversity chart visualizes the number and type of gates used in a quantum circuit. This metric is widely used in benchmarking, hardware-specific tuning, and noise-aware optimization. Haiqu SDK allows you to display either the original gate diversity or the normalized diversity (converted to a specified set of basis gates).
When the option basis_gates is omitted it displays the gate diversity in the original instructions submitted by the user, when the option basis_gates is set to True it displays it transpiled to the RX, RY, RZ, CX basis.
4.3. Liveness per Qubit
TheLiveness per Qubit plot indicates how frequently each qubit is active during the circuit execution, relative to the total circuit depth. This reflects qubit utilization and is particularly important because idle qubits are more susceptible to decoherence unless techniques like Dynamical Decoupling are applied.