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.

A key challenge in quantum machine learning (QML) applications is efficiently encoding classical data into quantum states. The trivial amplitude encoding, while requiring only a logarithmic number of qubits, results in deep circuits and low fidelity on quantum devices. The angular encoding, on the other hand, only allows encoding linearly many features (in the number of qubits), which is insufficient for most real-life datasets. Haiqu SDK contains feature loading methods, which address both of these limitations: Entanglied Manifold Embedding and Block Vector Loading.
For unstructured features, such as features from a tabular dataset or obtained from feature extraction methods like Principal Component Analysis, it is recommended to use Entangled Manifold Embedding.If your machine learning samples contain spatial dependency, for example, a wave signal or an image, it is recommended to load each sample with Block Vector Loading.

Entangled Manifold Embedding

Haiqu SDK introduces a novel feature loading method Entangled Manifold Embedding. It embeds a classical feature vector in a sub-manifold of the full Hilbert space, consisting of states of a controllable entanglement. Each classical feature corresponds to a degree of freedom in this sub-manifold, independently and non-linearly affecting the resulting quantum state, which is synthesized into compact, linear-in-depth circuits. The complexity of the encoding, or equivalently the entanglement is controlled by the feature density parameter DD. The number of features, which is possible to encode using nn qubits is approximately equal to nD2nD^2. To encode a fixed number of features the user can set either the density DD or the desired number of qubits nn (the minimal possible density is then chosen automatically). When D=1D=1 the Entangled Manifold Embedding is equivalent to the angular encoding. To encode a real feature vector simply call haiqu.entangled_manifold_embedding(...).
job = haiqu.entangled_manifold_embedding(
    name="EME Circuit",    # Name
    data=feature_vector    # Feature vector. 
    )

gate = job.result()  # a HaiquCircuitGate, encapsulating the embedding circuit
Feature vector must be a real one-dimensional vector. The method can produce states either using real- or complex-valued amplitudes.
While Entangled Manifold Embedding can encode feature with arbitrary values and ranges, and unnormalized, in most applications it is useful to standardize the features (e.g. by re-scaling each feature mean and variance to 0 and 1, respectively).
The table below shows the number of features that can potentially be loaded on different hardware platforms as a function of the feature density parameter DD.
The estimations are approximate and take into account the number of qubits available on the devices, and device’s Quantum Volume. The latter defines the largest random circuit of equal width and depth, which can be successfully run on a device with certain precision, and effectively quantifies the sensitivity of the device to noise. Large noise can effectively blur the distinction between different feature vectors.
HardwareD=2D=4D=8
IBM Heron5441,6224,342
IQM Emerald1915701,209
IonQ Forte 1129380779
Rigetti Ankaa-3303891834
OQC Toshiko118336318

Block Vector Loading

Encoding a dataset of size NN with amplitude encoding requires logN\log N qubits and may generate exponentially deep circuits to achieve high fidelity.Block Vector Loading encodes the data by splitting it into smaller blocks and loading them independently. It results in shallower quantum circuits at the cost of using more qubits. This approach introduces a practical trade-off between qubit count and fidelity.
More blocks → more qubits → shallower circuits → higher fidelity on a noisy device.
Block Vector Loading enables data preparation for utility scale QML, particularly when the spatial dependencies within the data need to be preserved (e.g. for images). To block-encode classical data vectors into a quantum state callhaiqu.block_vector_loading(...). For example,
random_vector_1d = numpy.random.random(200)

job = haiqu.block_vector_loading(
    name="Example with target_num_qubits",
    data=random_vector_1d,  # example 1D vector
    target_num_qubits=100,  # specify target number of qubits
    num_layers=1
)

gate = job.result()     # a HaiquCircuitGate, encapsulating state preparation circuit
fidelity = job.quality  # fidelity of the state preparation circuit
will load a random vector of size 200 into a shallow single-layer HaiquCircuitGate with fidelity close to 1.

Entangled Manifold Embedding 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-10 seconds with no fine-tuning;
up to 2 minutes with fine-tuning
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

Block Vector Loading specifications

ParameterDetails
Number of qubits1000+ qubits; no more than 20 qubits for a single block
Input data1D vector
2D matrix
Data typeReal and complex values
Data sizeAny, with no more than ~1M features for a single block
Runtime0.5–2 minutes per block
Runtime scalingLinear scaling with number of qubits
Circuit size (gates count)O(n), n = number of qubits
Circuit depthO(m/2), m = number of qubits in each block
Circuit connectivityLinear within each block, arbitrary between blocks
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