Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

Quantum data-loading assumptions

The explicit costs and access models by which classical or quantum input information becomes available to an algorithm.

Also called input model, data preparation

Edition released Coverage: Overview · Technical
On this page

Definition and significance

Data loading is part of a quantum algorithm's resource model. A compact amplitude representation does not imply that an arbitrary classical array can be prepared quickly. Algorithms may assume coherent oracle access, a structured state-preparation circuit, data generated by a physical process or a memory architecture; these are different inputs.

Mechanism and mathematical treatment

A classical vector x with N components can be normalized into |x>=sum_j x_j|j>/||x|| using log2(N) qubits when N is a power of two. Yet the number of independent amplitudes remains order N. Without exploitable structure or stronger access, specifying and preparing them can require work proportional to N.

Fully worked reference example

The vector (3,4) becomes (3/5)|0>+(4/5)|1>. It can be prepared by R_Y(theta) with theta=2 arctan(4/3). Measuring yields probabilities 9/25 and 16/25; it does not reveal the signed entries 3 and 4 or their original norm 5. Those quantities require additional information or measurements.

Limitations and common misconceptions

Do not compare a quantum algorithm with preloaded coherent access against a classical algorithm forced to read every input from scratch without explaining the asymmetry. Loading cost may be amortized across repeated queries, but the amortization scenario must be explicit.

Scientific relationships

Preparing the right-hand-side state and matrix access can dominate resources.

Coherent memory is one possible input-access model, not a universal default.

Normalized classical data can be represented as amplitudes with preparation and readout costs.

Preparing a four-component amplitude vector from conditional weights

Take the real vector v=(1,2,2,1), whose squared norm is ten. The desired amplitude state is (|00>+2|01>+2|10>+|11>)/sqrt(10). The total squared weight in each q0 branch is five, so begin with H on q0. Conditional on q0=0, prepare q1 as (|0>+2|1>)/sqrt(5); conditional on q0=1, prepare it as (2|0>+|1>)/sqrt(5).

The corresponding Y-rotation angles are alpha=2 arctan(2) and beta=2 arctan(1/2). A uniformly controlled rotation applies R_Y(alpha) on the zero branch and R_Y(beta) on the one branch. Combining the initial branch amplitude 1/sqrt(2) with each normalized conditional state yields the four target amplitudes exactly. This supplies a complete preparation procedure, including the conditional normalization.

The computational probabilities are 1/10,4/10,4/10,1/10. If the original numbers were intended as classical probability weights rather than amplitudes, the normalized distribution would instead be 1/6,2/6,2/6,1/6. Loading the same numerical array into amplitudes squares its entries when measured. The input type must therefore distinguish amplitudes, probabilities and unnormalized weights.

Adding signs and complex phases coherently

Now target the complex vector (1,2,-2,i)/sqrt(10). First prepare the same magnitude state. Apply P(pi) to q0, which negates both amplitudes in the q0=1 branch. Then apply controlled phase CP(-pi/2), which multiplies only |11> by-i. Its current amplitude is -1/sqrt(10), so it becomes i/sqrt(10), while |10> remains-2/sqrt(10).

The resulting state has the intended phases and the same computational probabilities as the positive vector. A histogram cannot verify the sign on |10> or the imaginary amplitude on |11>. Interference observables or a small exact state calculation are needed to check those features. The original vector's norm is also not encoded as an independently readable amplitude; it is external scale information unless another register or procedure records it.

The phase gates in this preparation are chosen from the known classical entries. Their angle computation and precision are part of data preparation. If a large array contains arbitrary complex phases, a short list of magnitude rotations does not complete the loading problem. The phase information has to enter the circuit or oracle as well.

Scaling the binary-tree preparation

For N=2^n arbitrary nonnegative amplitudes, a binary tree of partial squared norms determines conditional rotation angles. Each internal node divides the weight of its descendants into a left and right branch. A complete binary tree has N-1 internal nodes, so the straightforward description contains order N rotation parameters. Computing the partial sums from an explicit array also takes order N arithmetic work.

Some branch weights can be zero. Then the corresponding conditional rotation need not be defined through a division by zero on an unreachable branch; the circuit can choose any unitary action there consistent with a complete implementation. A robust preparation algorithm treats such branches explicitly. Near-zero weights can make angle sensitivity and finite precision relevant, even when the final normalized vector is well defined.

Structured vectors can be much cheaper. A uniform vector needs only n Hadamards, and a tensor product of known one-qubit states needs n local preparations. Those are families with compact descriptions. Their efficient preparation does not establish an efficient loader for an arbitrary N-entry classical array, which contains many more independent parameters.

Value access, amplitude access and output costs

A coherent value oracle maps |j>|0> to |j>|v_j> in a computational data register. Applied to a uniform address state, it produces a superposition of address-value pairs. That is not automatically the amplitude state sum_j v_j|j>/||v||. Converting values into amplitudes can require controlled rotations, arithmetic, postselection and uncomputation, with success probability and normalization depending on the data.

A memory architecture may make repeated coherent value queries economical after a data structure has been built. The construction, updates, lifetime and classical access offered to the comparator should be included in the analysis. If a costly loading stage is amortized over many later queries, the number and type of repeated tasks must be stated. One cannot silently charge initialization to neither algorithm.

The desired output determines whether amplitude encoding is useful. A few overlaps or observable expectations can exploit a prepared state without reconstructing every entry. Returning the full classical vector requires a separate readout task and cannot be justified by the logarithmic number of qubits alone. For this four-component example, direct classical normalization and multiplication are the simplest practical methods; the circuit is a complete reference construction.

Sources

  • Aram W. Harrow; Avinatan Hassidim; Seth Lloyd · · Research paper · Publication status unspecified · arXiv · DOI 10.1103/PhysRevLett.103.150502
    Verification scope

    Selected source text checked ·

    Primary formal source anchor; original worked examples independently derived, not reported experiments.

  • Vittorio Giovannetti; Seth Lloyd; Lorenzo Maccone · · Research paper · Publication status unspecified · arXiv · DOI 10.1103/PhysRevLett.100.160501
    Verification scope

    Selected source text checked ·

    Formal or reference-semantic source anchor only; no SDK execution, hardware run, or empirical advantage is asserted. Original worked examples are independent mathematical constructions.