Skip to main content
A key challenge in quantum machine learning (QML) applications is efficiently encoding classical data into quantum states. While loading an unstructured feature vector into amplitudes requires only logarithmic number of qubits, its normalization can introduce bias to the data itself and preparation on the device has very low fidelity. Moreover, the resulting circuit has a limited number of qubits making it easily simulatable. On the other hand, the most popular encoding strategy in QML is the angular encoding, which encodes up to a few features per qubit with rotational gates, where their angles are equal to the feature values. This allows for a trivial state preparation and the ability to cover a large Hilbert space during the processing of this data. Yet the required number of qubits for this encoding has linear dependency and is too high for realistic datasets and current hardware.

Loading the feature vector

Here we introduce a novel loading procedure available in Haiqu SDK: Isometry Encoding, the process of embedding a classical feature vector via parametrization of the Hilbert subspace of controllable complexity. Each classical feature corresponds to a degree of freedom in these subspaces and independently affects the quantum state that is produced. The latter is then synthesized into compact, linear-in-depth circuits. Unlike Vector Loading, introduced before, data is loaded as is without any normalization needed. The user can control the complexity of the states, in which data is loaded by setting the feature density parameter DD or desired number of qubits nn (in this case the smallest suitable density is chosen automatically). With D=1D=1 only product states are considered, and the Isometry Encoding naturally matches the well-known angular encoding. Therefore, some existing techniques can be seen as a special case of the Isometry Encoding. Generally, the number of degrees of freedom, which the encoding provides, scales as O(nD2)O(nD^2), giving the user the ability to encode more features into current hardware. The Haiqu SDK allows you to prepare an encoding of a real feature vector by calling haiqu.isometry_encoding(...).
job = haiqu.isometry_encoding(
    name="Isometry Encoding Circuit",    # Unique name
    data=feature_vector                  # Feature vector. 
    )
Feature vector must be a real one-dimensional vector. The user can control the feature density or set a desired number of qubits. Additionally, it is possible to decide which states for the encoding will be used: real or complex, where the latter option doubles the degrees of freedom of the state. Circuit synthesis options match other data loadings in the SDK and can be viewed in the method itself.

Hardware benchmarks

This table shows the number of features that have been loaded on different hardware platforms as a function of the isometry encoding density parameter. And QV (Quantum Volume) is a single-number metric that quantifies the largest random circuit of equal width and depth that the device successfully implements.
HardwareDensity 2Density 4Density 8
IBM Heron (QV 2^9)5441,6224,342
IQM Emerald (QV 2^6)1915701,209
IonQ Forte 1 (QV 2^6)129380779
Rigetti Ankaa-3 (QV 2^2)303891834
OQC Toshiko (QV 2^2)118336318

Isometry Encoding specifications

ParameterDetails
Number of qubitsUp to 1000 qubits
Input data1D vector
Data typeReal values
Data sizeUp to ~1M features in the vector
DensityFrom 1 to 8
Runtime1–30 seconds
Runtime scalingLinear scaling with number of qubits
Circuit size (gates count)O(n), n = number of qubits
Circuit depthO(n/2), n = number of qubits
Circuit connectivityLinear
Other circuit properties- No mid-circuit measurements
- Only CNOT and single-qubit rotation gates
- No ancilla qubits
- No post-selection required in state preparation
Returned metricsQuantum state fidelity is returned for the ideal state prepared by the circuit
This table shows the number of features that have been loaded on different hardware platforms as a function of the isometry encoding density parameter.