Quantum Data Encoding Methods: How to Choose Amplitude, Angle, and Basis Encoding
quantum machine learningquantum data encodingfeature mapsPennyLaneQiskit

Quantum Data Encoding Methods: How to Choose Amplitude, Angle, and Basis Encoding

SSmartQbit Editorial Team
2026-12-01
6 min read

Compare basis, angle, amplitude, and feature-map encoding to choose a practical quantum representation for your dataset and circuit budget.

Choosing a quantum data encoding method is a modeling decision, not just a circuit-design detail. This guide compares basis, angle, amplitude, and feature-map encoding so you can estimate qubit requirements, state-preparation cost, trainability, and measurement implications before building a quantum machine learning experiment.

Overview

Quantum data encoding converts classical inputs into a quantum state that a circuit can process. The choice affects nearly every practical constraint: how many qubits are required, how much circuit depth is added before the trainable layers, how noise may accumulate, and what information can be recovered through measurement.

No encoding is universally best. A small binary dataset may fit naturally into basis encoding, while continuous features are often more convenient with angle encoding. Amplitude encoding can represent many values with relatively few qubits, but preparing the required state may be difficult. A feature map usually combines an encoding rule with rotations and entangling operations to expose relationships between features.

MethodTypical qubit requirementMain costGood starting point for
Basis encodingAbout one qubit per binary featurePreparing computational-basis statesBinary, categorical, or discrete inputs
Angle encodingOften one qubit per feature, unless features are reusedRotation gates and repeated layersScaled continuous features
Amplitude encodingCeiling of log2 of the vector dimensionPreparing and validating the target stateDense vectors when state preparation is available and justified
Feature-map encodingDepends on the underlying map and feature countEncoding plus entanglement and circuit depthSimilarity models, kernels, and variational circuits

These are planning estimates rather than guarantees. Framework implementations, hardware connectivity, decomposition rules, and the selected circuit architecture can change the final gate count and depth.

How to estimate

Use the following workflow before writing the full model.

  1. Define the classical input. Record the number of features, their ranges, whether they are binary or continuous, and whether the feature order has meaning.
  2. Choose a representation. Match the encoding to the data rather than compressing everything into the smallest possible qubit count.
  3. Estimate qubits. For basis encoding, start with one qubit for each binary variable. For angle encoding, start with one qubit for each simultaneously encoded scalar. For amplitude encoding, use n = ceil(log2(d)) qubits for a vector of dimension d, then pad the vector to a power-of-two length when necessary.
  4. Estimate preparation depth. Count feature rotations, controlled operations, entangling layers, and any state-preparation routine. A lower qubit count does not automatically mean a lower total cost.
  5. Check measurement needs. Decide whether the model needs expectation values, sampled bitstrings, probabilities, or overlap estimates. The useful output determines how many observables and circuit executions are required.
  6. Compare against a classical baseline. Keep preprocessing, feature selection, train-validation splits, and evaluation metrics consistent. A quantum circuit should be evaluated as part of a hybrid quantum-classical workflow, not in isolation.

For a practical introduction to the broader experiment design, see the quantum machine learning workflow. When execution choices become relevant, separate simulator testing from hardware runs using a quantum simulator versus real hardware workflow.

Inputs and assumptions

Basis encoding

Basis encoding maps binary values directly to computational-basis states. For example, the bit string 101 becomes a three-qubit state with X gates applied to the qubits representing 1 values. It is easy to inspect and measure, but continuous values must first be discretized or represented through another mechanism. Discretization can discard information, so record the number of levels and the resulting feature expansion.

Angle encoding

Angle encoding maps normalized values to rotation angles such as RY(x) or RZ(x). Scale each feature using a documented rule, such as min-max scaling based only on the training split. Keep the same transformation for validation and test data. If the dataset has more features than available qubits, features can be split across layers through data re-uploading, but this increases depth and may affect optimization.

A minimal PennyLane-style example is:

qml.AngleEmbedding(x, wires=range(n_qubits), rotation="Y")

Check the installed framework version and the operator documentation before copying an API example into production code.

Amplitude encoding

Amplitude encoding places normalized vector values into the amplitudes of a quantum state. A vector with dimension 6 requires padding to dimension 8, so the initial register needs three qubits. The padded vector must then be normalized. The attractive qubit estimate hides an important assumption: preparing an arbitrary amplitude state can require substantial circuit work or a platform-specific preparation routine. Include that preparation cost in your comparison rather than counting qubits alone.

Feature maps

A feature map is usually a circuit pattern that encodes data and may add interactions between features. It is not a single encoding method. A map can use single-qubit rotations, phase terms, and entangling gates. In Qiskit-style workflows, a feature-map circuit may be composed with a trainable ansatz; in PennyLane, an embedding operation may be followed by a variational layer. Inspect the generated circuit and transpiled depth instead of relying only on the feature-map name.

Worked examples

Example 1: Four binary flags

Suppose each record contains four yes-or-no indicators. Basis encoding starts with four qubits and requires X gates for the active flags. Angle encoding could also represent the values, but it adds a rotation convention without providing an obvious benefit. Begin with basis encoding, then test whether a feature map or trainable layer improves validation performance.

Example 2: Six scaled sensor features

For six continuous features, a direct angle-encoding design starts with six qubits and six feature rotations per encoding layer. A two-layer re-uploading design may use three qubits while presenting the features across multiple layers, but the circuit becomes deeper. Compare both designs using the same optimizer budget and measure whether the smaller register actually improves the experiment.

Example 3: A 10-dimensional dense vector

Amplitude encoding needs four qubits because four qubits provide 16 amplitudes. Pad the vector from dimension 10 to 16, normalize it, and document the padding convention. Then estimate the state-preparation gates and the number of measurements needed for the chosen observable. If state preparation dominates the circuit, angle encoding after dimensionality reduction may be a more transparent baseline, even though it uses more qubits.

For kernel-based experiments, encoding choice directly affects the state overlap or similarity being estimated. The quantum kernel methods tutorial can be paired with a circuit inspection and a classical kernel baseline. Test encoding alternatives as controlled experiments rather than changing the encoding, ansatz, optimizer, and dataset preprocessing at the same time.

When to recalculate

Revisit the encoding decision whenever the dataset changes, features are added or removed, preprocessing is redesigned, or the circuit moves from a simulator to a constrained backend. Recalculate after changing the number of re-uploading layers, entanglement pattern, measurement strategy, or state-preparation routine.

Framework releases can also change operator names, supported feature-map constructors, transpilation behavior, or device constraints. Before refreshing an implementation, run a small compatibility test, print the circuit, verify normalization and feature ranges, and compare qubit count, gate count, depth, and output shape with the previous version. Review the recommendations at least annually, and sooner when a major SDK or backend release affects the APIs used by your project.

For a repeatable review, record five values in your experiment notes: feature dimension, encoding type, qubit count, preparation depth, and measurement cost. Then compare validation results with a classical baseline. This makes the encoding choice auditable and gives your team a clear reason to change it when the inputs or circuit budget change.

Related Topics

#quantum machine learning#quantum data encoding#feature maps#PennyLane#Qiskit
S

SmartQbit Editorial Team

Quantum Technology 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.