Skip to main content
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
and obtain the compressed circuit as a result
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:
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:
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.

Measuring the compressed circuit

job.result() returns a CircuitModel, not a plain QuantumCircuit or HaiquCircuitGate. Local circuit.depth() and gate counts are misleading on opaque gates; transpile with Haiqu and read circuit analytics on the returned CircuitModel:
See Working with Haiqu Circuits for the full list of what works locally on compressed circuits and what requires the cloud.

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

State Compression 2D Specifications

*runtime can vary for different circuit classes of the same size