Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt

Use this file to discover all available pages before exploring further.

Haiqu SDK state_compression function is an approximate compilation method extending the depth of the circuit, which can be run on noisy hardware. It automatically adjusts the compression parameters to achieve the best performance by taking into account the device’s characteristics, including noise and topology.

Linear topology compression

To compress a circuit using idealized linear topology you simply create a state compression job
job = haiqu.state_compression(circuit=circuit)
and obtain the compressed circuit as a result
circuit_compressed = job.result()
quality = job.quality
The computed quality metric is a fidelity-like metric, which Haiqu internally computes in the end of the compression to quantify circuit approximation quality on a noiseless device. Unlike quantum state fidelity it is scalable and does not vanish with increasing the systems size, meanwhile it is highly correlated with the observables precision. As a rule of thumb you can treat its values as follows:
QualityDescription
100%Perfect match between quantum states, generated by the original and compressed circuits
90%Very good quality
75%Good quality
50%Mediocre quality
0%States do not match at all
Haiqu’s compression utilizes the device’s noise profile to ensure the best results on actual hardware. Default noise settings correspond to IBM’s Heron R2 device and can be changed by modifying noise_profile parameter (see below). State compression function can trade-off theoretical approximation on an ideal device for more compact circuits that perform better on real quantum hardware.
In the following frame you can see the metrics comparison of the original and compressed 50-qubits randomly generated circuit with qiskit.circuit.random.random_circuit.
Image

Device topology-aware compression

To use device topology-aware compression, use the state_compression_2d method. For example:
job = haiqu.state_compression_2d(circuit=circuit, device_id="ibm_fez")
circuit_compressed = job.result()
This call requires specifying the device, and results in an already compressed and transpiled circuit. The method uses noise data from the device to tune the compression approximation rates automatically.
state_compression_2d is currently limited only to devices with heavy-hex connectivity.
The basic state_compression function is computationally very efficient and should be used by default for general circuits. state_compression_2d is computationally more demanding and achieves very good results when the input circuits have already been designed with a particular device topology in mind.

Parameters

  • circuit – the quantum circuit whose action on all-0 state is to be compressed.
  • compression_level – defines the compression level. Increased compression level will lead to larger part of the input circuit being compressed. Three options are available:
    • low – this setting is best used for already shallow input circuits or very low noise levels;
    • balanced – the default setting gives the best performance for most circuits and noise profiles;
    • high – this setting may sometimes yield better results for very deep circuits.
  • noise_profile – sets the noise profile to which the function adjusts the compression algorithm. Used to automatically set the approximation level. Currently available options are "ibm_eagle_r3", "ibm_heron_r1", "ibm_heron_r2" (used by default), "ibm_heron_r3", "iqm_garnet" and "iqm_emerald".
  • fine_tuning – uses classical resources to further improve the compressed circuit. Three options are available:
    • disabled – no fine-tuning performed, the lowest latency;
    • low – default, best balance between speed and accuracy;
    • heavy – improved circuit accuracy, but time-intensive.
  • approximation_level – an integer-valued parameter influencing circuit complexity. Larger values improve the noiseless quality metric, but may degrade noisy performance. Defaults to None, which corresponds to auto-selection using the provided noise profile. Can be set to any value from 1 (very weak approximation) to 8 (very high approximation). Larger approximation level values lead to slower fine-tuning.
  • device or device_id (only for state_compression_2d) – target device for the compression.
See Haiqu SDK Reference | State Compression for more details onhaiqu.state_compression and haiqu.state_compression_2d.

State Compression Specifications

ParameterDetails
Number of qubitsUp to 1000
Runtime (at 100 qubits)From few seconds and
up to 2 minutes with no fine-tuning;
up to 15 minutes with heavy fine-tuning
Runtime scalingLinear scaling with circuit size, problem-dependent
Supported circuits- Circuits decomposable into CNOT, RX, RY, RZ basis gates
- Circuits with mid-circuit measurements are supported, but compression applies only prior to MCM
Supported connectivityAny.
Not transpiled input with Linear connectivity is preferred.
Compression rateUp to 100× for various application circuits
Returned metrics- Compression rate
- Quality of the compression (fidelity-like metric)

State Compression 2D Specifications

ParameterDetails
Number of qubitsUp to the available number of qubits on the quantum device
Runtime (at 100 qubits)From 1 to 5 minutes with no fine-tuning;
up to 30 minutes with heavy fine-tuning
Runtime scalingPolynomial scaling with circuit size, problem- and device-dependent
Supported circuits- Circuits decomposable into CNOT, RX, RY, RZ basis gates
- Circuits with mid-circuit measurements are supported, but compression applies only prior to MCM
Supported connectivityAny. Circuit will be transpiled to the device connectivity but preferable to already follow it.
Compression rateUp to 100× for various application circuits
Returned metrics- Compression rate
- Quality of the compression (fidelity-like metric)
*runtime can vary for different circuit classes of the same size