Skip to main content
Haiqu SDK provides a number of analytics functions, properties and widgets: Each analytics widget includes built-in help for the displayed metrics, turned on with 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 the haiqu.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:
The job for circuit analysis and computation of metrics requires a certain amount of time to complete. The duration depends on the depth of the original circuit and the number of qubits involved. The function 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 metrics computed in this step include:
  • The number of qubits in the original circuit.
  • The depth of the original circuit and the depth of the circuit normalized (transpiled) to basis gates.
  • The count of 1-qubit and 2-qubit gates for 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:
The metrics computed in this step include:
  • 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

The Radar 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

The Gate 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

The Liveness 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.

4.4. Matrix of correlations between qubits

Computes a normalized interaction matrix (heatmap) that quantifies how frequently each pair of qubits participates together in two-qubit gates within a given quantum circuit.

4.5. “Evolution” of the circuit

Generate a plot showing the “evolution” of key circuit metrics, as the circuit is traversed. The original circuit is divided into slices. Metrics are calculated for each slice, providing insights into changes in connectivity, depth of two-qubit interactions, degree of entanglement, and concurrent operation performance.