Quantum Data Encoding Methods: Basis, Amplitude, Angle, and Qubit Encoding Compared
quantum machine learningquantum data encodingquantum feature encodingamplitude encodingangle encodingbasis encodingfeature mapsquantum algorithms

Quantum Data Encoding Methods: Basis, Amplitude, Angle, and Qubit Encoding Compared

QQubit Editorial Team
2026-12-01
7 min read

Compare basis, amplitude, angle, and feature-map encoding with practical estimates for qubits, depth, normalization, and loading cost.

Quantum data encoding is the step that turns classical records into quantum states or gate parameters. This guide compares basis, amplitude, angle, and broader feature-map approaches, then gives a repeatable way to estimate qubit count, circuit depth, normalization work, and data-loading cost before building a quantum machine-learning experiment.

Overview

A quantum processor does not accept a spreadsheet column, image array, or database row directly. A circuit must first represent each classical feature using qubit states, rotation angles, amplitudes, or a combination of these. That representation is called quantum data encoding, quantum feature encoding, or, in many software libraries, a feature map.

The encoding choice affects more than the number of qubits. It also changes circuit depth, the number and type of gates, normalization requirements, measurement strategy, simulator memory needs, and the amount of work required to load each data sample. An encoding that looks efficient on paper may be difficult to prepare on hardware. Conversely, a simple encoding may use more qubits but produce a circuit that is easier to test and transpile.

The term qubit encoding is sometimes used broadly for any method of mapping data to qubits. In this article, “basis encoding” refers specifically to representing discrete values as computational-basis states, while “feature map” refers to a circuit pattern that transforms classical features into rotations, entanglement, or both.

Encoding methods at a glance

MethodTypical qubit estimateDepth and loading profileNormalizationUseful data types
Basis encodingBinary width, or one qubit per one-hot categoryOften shallow for state preparation, but preprocessing and repeated loading still matterNot usually required for bit valuesBinary flags, discrete labels, small combinatorial inputs
Amplitude encodingFor a vector of length N, approximately log2(N) qubits when N is a power of twoState preparation can be deep and hardware-sensitiveRequired: the vector must be scaled to unit normDense numerical vectors, probability-like data, compact state representations
Angle encodingOften one qubit per feature per feature-rotation groupUsually straightforward; depth grows with rotation layers and entanglementNot required, but feature scaling is importantContinuous numerical features, small to medium feature vectors
General feature mapDepends on the chosen feature-to-gate design; commonly tied to feature countVaries from local rotations to repeated entangling layersDepends on the feature mapStructured numerical data, kernels, variational circuits, hybrid models

These are planning estimates, not performance guarantees. A transpiler can change gate counts, connectivity constraints can add routing operations, and the target backend can impose limits that are not visible in an abstract circuit. For those effects, see the quantum circuit transpilation guide.

How to estimate

Use the following workflow before selecting an SDK implementation or quantum cloud backend.

  1. Define the data unit. Decide whether one circuit represents one row, one image, one time window, one class label, or a batch summary. Encoding costs are usually paid per circuit execution or per sample, so this definition matters.
  2. Count effective features. Start with the features that will actually enter the circuit, not every column in the source dataset. Remove identifiers, inspect correlated fields, and record any dimensionality-reduction step.
  3. Set the qubit estimate. For binary basis encoding, use the number of bits needed to represent the value. A value with M possible states needs at least ceil(log2(M)) qubits for a compact binary representation. One-hot encoding instead uses roughly M qubits. For amplitude encoding, a vector of length N needs a state space with at least N amplitudes, usually requiring ceil(log2(N)) qubits, with padding if needed. For angle encoding, begin with one qubit per simultaneously encoded feature.
  4. Estimate circuit depth. Count feature-rotation layers, entangling layers, repeated feature-map blocks, and any state-preparation operations. Treat amplitude state preparation as a separate cost rather than assuming that its small qubit count means a small circuit.
  5. Estimate loading cost. Record classical preprocessing, normalization, parameter binding, state preparation, circuit construction, transpilation, and execution. If a dataset contains S samples and each sample requires a distinct state preparation, a useful first estimate is S multiplied by the per-sample loading and execution workflow.
  6. Test the same encoding classically and in simulation. Confirm that the circuit preserves the intended information and that the output is not dominated by scaling, shot noise, or an unnecessarily large circuit. The quantum circuit benchmarking guide can help structure repeatable runs.

Keep three measurements separate: representation efficiency (how many qubits are used), circuit efficiency (how many gates and layers are required), and experimental efficiency (how much total work is required across all samples, repetitions, and measurements). Comparing only qubit count can produce a misleading result.

Inputs and assumptions

A useful encoding worksheet should contain the following inputs:

  • Feature count: the number of numerical, categorical, binary, or embedded features entering the circuit.
  • Value range: minimum, maximum, distribution, and whether outliers are present.
  • Representation type: raw values, normalized values, binary codes, one-hot vectors, or reduced-dimensionality vectors.
  • Number of samples: include training, validation, test, and any repeated evaluation sets.
  • Repetition settings: feature-map repetitions, variational layers, measurement shots, and optimizer evaluations.
  • Backend assumptions: all-to-all connectivity in simulation versus limited connectivity on hardware, as well as whether dynamic circuit construction is supported.
  • Accuracy target: whether the experiment is exploratory, comparative, or intended to support a production decision.

Angle encoding generally benefits from explicit feature scaling. Map each feature to the interval expected by the rotation convention, document that mapping, and preserve the same transformation for future samples. Scaling is not a cosmetic preprocessing step: a poorly scaled feature can cause rotations to cluster in a narrow range or wrap around in an unhelpful way.

Amplitude encoding requires a normalized vector. For a vector x, compute its norm and represent x divided by its norm, provided the norm is nonzero. Document zero-vector handling, padding rules, ordering of vector elements, and the state-preparation routine. These details are part of the model definition and should not be left to an undocumented notebook default.

For reproducibility, record the encoding name, feature order, preprocessing version, qubit order, rotation convention, entanglement pattern, repetition count, and backend configuration. The quantum computing project documentation template is a practical starting point.

Worked examples

Example 1: Eight binary inputs

Suppose a classifier uses eight independent yes/no fields. A direct basis representation can use eight qubits, with each field mapped to a computational-basis value. If the fields form a single integer from 0 through 255, the same information can fit into eight binary qubits. The compact representation is not automatically better: it may make individual features less transparent and may require different downstream circuit logic.

Example 2: Sixteen continuous features

With sixteen continuous features, a first angle-encoding estimate is sixteen qubits for one rotation group. A feature map with three repeated rotation-and-entanglement blocks may therefore have three feature layers plus three entangling layers, subject to the library’s exact definition. The practical test is to transpile the circuit for the intended device and record the resulting depth and two-qubit gate count.

An amplitude representation could place the same sixteen values into a state using four qubits, assuming a length-16 vector and suitable normalization. However, state preparation may require substantially more operations than the four-qubit figure suggests. Compare the complete preparation-and-measurement workflow rather than treating the qubit reduction as the result.

Example 3: A mixed dataset

Consider four binary flags, three categorical fields, and six continuous measurements. One practical design is to encode the flags and categorical values with basis or one-hot representations, reduce the continuous block to a smaller vector, and apply angle encoding to that block. A hybrid feature map may use more qubits than an aggressive amplitude encoding but be easier to inspect, debug, and reproduce. The choice should be justified by the experiment’s objective, not by a general claim that one method is best.

When to recalculate

Revisit the encoding estimate whenever the dataset, circuit, or execution environment changes. Recalculate when feature selection changes, a categorical field gains new values, dimensionality reduction is added or removed, the feature scaling range changes, or the number of training samples increases. Also recalculate after changing the feature-map repetition count, entanglement pattern, optimizer evaluation budget, measurement shots, or target backend.

Library examples and terminology also evolve. At least annually, verify that the SDK’s encoding and feature-map APIs still implement the assumptions in your documentation. Re-run a small reference workload after an SDK, transpiler, simulator, or backend change. Compare qubit count, logical depth, transpiled depth, two-qubit gate count, state-preparation cost, and total circuit executions.

Before committing to an encoding, complete this short checklist:

  1. Write down the data shape and preprocessing transformation.
  2. Calculate the expected qubit count using the actual representation.
  3. Estimate loading, feature-map, and measurement work separately.
  4. Run the circuit on a simulator and inspect the transpiled form.
  5. Compare at least one simpler baseline, such as angle encoding with fewer features.
  6. Save the assumptions and results with the project documentation.

For implementation references, browse a quantum computing tools directory and use testing practices from the quantum circuit testing tools comparison. The best encoding is usually the one whose information flow, costs, and limitations you can explain and measure.

Related Topics

#quantum machine learning#quantum data encoding#quantum feature encoding#amplitude encoding#angle encoding#basis encoding#feature maps#quantum algorithms
Q

Qubit Editorial Team

Quantum Computing Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.