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 logariphmic amount of qubits, its normalization can introduce bias to the data itself and preparation on the device has very low fidelity. More over, the resulting circuit has a limited amount of qubits making it easily simulatable. On other hand, the most popular encoding strategy in QML is the angular encoding, which encodes up to 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 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, which 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 with setting the feature density parameter DD or desired amount of qubits nn (in this case the smalles 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 amount of degrees of freedom, which the encoding provides, scales as O(nD2)O(nD^2), giving the user an ability to encode more features into current hardware. The Haiqu SDK allows you to prepare an encoding of 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 real one-dimensional vector. The user can control the feature density or set a desired number of qubits. Additionally it is possible to deside which states for the encoding will be used: real or complex, where the latter option doubles the degrees of freedom of the state. Circuits synthesis options match other data loadings in the SDK and can be viewed in the method itself. For more details explore practical notebook IsometryEncodingTutorial.ipynb, which covers the basics of the method, encoding properties and gives a QML application example.

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