---
title: 'Angle Encoding: From Quantum to Geometric Applications'
url: https://www.emergentmind.com/topics/angle-encoding
type: topic
---

# Angle Encoding: From Quantum to Geometric Applications

Searching arXiv for recent papers on angle encoding across quantum computing, transformers, vision, and related domains.
Searching arXiv for “angle encoding” and related recent work.
Angle encoding denotes a class of representations in which information is mapped to angles, rotations, or angle-dependent responses. The term is used in several technically distinct literatures. In quantum machine learning, it usually denotes mapping real-valued features to single-qubit rotations; in quantum algorithms for numerical integration, it denotes the angle map that determines amplitude-oracle complexity; in Transformers, it denotes positional information injected as rotations in embedding space; in detection and geometric learning, it denotes angular descriptors or angle-label parameterizations; and in metasurfaces it denotes the encoding of multiple optical functions into one device, selected by illumination angle [2606.05387] [2506.03737] [1711.02265].

## 1. Core idea and domain-specific meanings

Across these settings, the common motif is that an angle is used as a structured, often periodic control variable. What changes from field to field is the object being rotated, the algebra that constrains the rotation, and the computational or physical cost of realizing it.

| Domain | Encoded quantity | Representative formulation |
|---|---|---|
| Quantum feature maps | Classical feature vector | $U_{\mathrm{enc}}(x)=\bigotimes_k R_Y(\alpha_k x_k)$ |
| QAE-based integration | Grid function values | $\Theta_g(b)=2\arcsin\!\sqrt{g(x_{i(b)})}$ |
| Rotary positional encoding | Position coordinates | $\mathbf{R}(\mathbf{x};\mathcal{A})=\exp(\sum_i \mathbf{A}_i x_i)$ |
| Point-cloud GNNs | Edge geometry | $FE_{ij}=[AM1_{ij},AM2_{ij},AM3_{ij},I_j]$ |
| Arbitrary-oriented detection | OBB orientation | $c=\lfloor\theta/\Delta\theta\rfloor,\ r=\theta-c\Delta\theta$ |
| Angle-multiplexed metasurfaces | Optical function under incidence angle | $\Phi^{(\theta)}(x,y)$ depends on illumination angle |

The shared name can obscure substantial differences. In some settings angle encoding is a data-loading primitive; in others it is a complexity invariant, a positional symmetry mechanism, a way to avoid boundary discontinuity, or a physical multiplexing principle. A recurring implication is that angle encoding is valuable when angular structure matches the symmetry, topology, or hardware constraints of the problem, and much less so when that structure is absent.

## 2. Quantum-state and feature encodings

In quantum machine learning, angle encoding maps each real feature to the angle of a single-qubit rotation, typically about a Pauli axis. A standard layer uses
$$
U_{\mathrm{enc}}(x)=\bigotimes_{k=1}^{D} R_Y(\alpha_k x_k),
$$
while dense-angle encoding packs two features per qubit through
$$
U_{\mathrm{dense}}(x)=\bigotimes_{j=1}^{\lceil D/2\rceil} R_Z(\alpha_{2j-1}x_{2j-1})R_Y(\alpha_{2j}x_{2j}).
$$
Data re-uploading repeats the same angle block between trainable layers, enlarging the accessible Fourier spectrum without increasing qubit count. In the survey taxonomy, standard angle encoding uses $q=D$ qubits, $g_1=D$ single-qubit rotations, $g_2=0$ two-qubit gates in the encoding layer, and depth $d=1$; dense-angle encoding uses $q=\lceil D/2\rceil$ and depth $d=2$ [2606.05387].

This shallow structure is the basis of its NISQ appeal. The same survey gives an encoding-layer fidelity lower bound
$$
F(\rho_{\mathrm{noisy}},|\psi\rangle)\ge (1-p_2)^{g_2}(1-p_1)^{g_1},
$$
and identifies a practical crossover at $p^*\approx10^{-3}$ below which amplitude encoding is viable. For $p\ge 10^{-3}$, shallow angle-based encodings consistently outperform amplitude encoding in practice, despite amplitude encoding’s exponential qubit advantage. The survey also emphasizes the Fourier viewpoint: if a feature $x_k$ is injected $L_k$ times through a Pauli rotation, then the accessible per-dimension frequencies satisfy $|\omega_k|\le L_k$, so re-uploading directly controls expressivity [2606.05387].

Empirical studies treat the embedding itself as a hyperparameter rather than a fixed preprocessing step. In variational quantum classifiers trained on Wine and Diabetes, the choice of rotation gates in the encoding layer materially changed classification performance: under identical topologies, the difference between the best and worst models ranged from $10\%$ to $30\%$, with differences reaching up to $41\%$, and the best Wine result was angle encoding with $R_Y$, $10$ layers, and no re-uploading at $97.50\%\pm2.43$ [2508.00768]. In QCNNs trained on downsampled MNIST and Fashion-MNIST under depolarizing noise, angle encoding used the canonical patchwise map
$$
|\psi(x)\rangle=\bigotimes_{j=1}^{n}R_Y(\pi x_j)|0\rangle,
$$
and on aggressively downsampled $4\times4$ inputs it attained higher accuracy and remained comparatively robust as noise increased; at $8\times8$, however, a hybrid phase/angle scheme could overtake it under moderate noise [2512.12512]. In SPATE, angle encoding appears as the fixed baseline of local single-qubit rotations applied after standardization; it performed well on Circles, but on Moons its encoder-level geometry was weak, with $\mathrm{CKTA}=0.0145\pm0.0060$ versus $0.5057\pm0.0874$ for SPATE [2604.11022].

A different quantum meaning appears in quantum signal processing. There, angle encoding is the angle-finding problem: choosing rotation angles so that interleaved signal-independent and signal-dependent gates synthesize a target polynomial transformation of a unitary. The orthogonal-polynomial formulation derives explicit expressions for Hermite, Jacobi, and Rogers–Szegő families and shows that $2n+2$ rotation angles are required to encode a sequence of polynomials up to degree $n$ [2605.05321]. This use of the term is not feature embedding but analytic synthesis of a polynomial basis through rotation parameters.

## 3. Angle maps in quantum algorithms for integration and similarity

For numerical integration by quantum amplitude estimation, angle encoding becomes an operator-level description of the amplitude oracle. On the uniform grid $\mathcal{X}_n=\{x_i=i/2^n\}$ and with bit-string index $b\in\{0,1\}^n$, the angle map is
$$
\Theta_g(b)=2\,\arcsin\!\bigl(\sqrt{g(x_{i(b)})}\,\bigr)\in[0,\pi],
$$
equivalently
$$
g(x_{i(b)})=\sin^2\!\bigl(\Theta_g(b)/2\bigr).
$$
The encoding operator $G_g$ applies $R_Y(\Theta_g(b))$ to an ancilla conditioned on the index register, and the QAE oracle is
$$
A_g = G_g\,(H^{\otimes n}\otimes I_2).
$$
The ancilla-1 marginal equals the left quadrature sum,
$$
\mathbb{P}(\mathrm{anc}=1;A_g)=\frac{1}{2^n}\sum_{i=0}^{2^n-1} g(x_i).
$$
The paper defines the hierarchy
$$
\mathcal{G}_n^{(d)}=\{g:\mathcal{X}_n\to[0,1]\mid \Theta_g \text{ is multilinear of degree }\le d\},
$$
with membership checkable classically in $O(n2^n)$ time by the Walsh–Hadamard transform. For $g\in\mathcal{G}_n^{(d)}$, the encoding operator factorizes into
$$
G_g=\prod_{\substack{S\subseteq[n]\\|S|\le d}} C^S R_Y\!\bigl(\widehat{\Theta_g}(S)\bigr),
$$
so the number of controlled-$R_Y$ gates is
$$
\sum_{k=0}^{d}\binom{n}{k}.
$$
This interpolates between the affine $d=1$ regime with $n+1$ gates and the generic $d=n$ regime with $2^n$ gates. Combining this structure with classical discretization for $g\in C^\alpha[0,1]$ yields total gate count
$$
O\!\big((\log(1/\varepsilon))^d\,\varepsilon^{-1}\big),
$$
and for $d=1$,
$$
O\!\big(\varepsilon^{-1}\log(1/\varepsilon)\big),
$$
which is asymptotically better than classical Monte Carlo for every $\alpha\ge1$. The paper also proves an unconditional separation: $\mathcal{G}_n^{(1)}$ contains functions of Sobolev regularity $s<1/2$ for which the quantum oracle cost is $O(1/\varepsilon)$, whereas classical deterministic or randomized quadrature requires $\Omega(\varepsilon^{-1/s})$. Experiments on SpinQ Triangulum and IBM Kingston at $n=2$ showed that circuits inside the predicted hierarchy executed successfully, whereas circuits exceeding the Triangulum coherence budget failed as predicted [2604.24289].

A second algorithmic use appears in approximate cosine similarity estimation via an angle-encoding Hadamard test. For normalized $x,y\in\mathbb{R}^d$ with entries in $[-1,1]$, each component is encoded as
$$
|\psi(x_i)\rangle=R_Y(2\arccos x_i)|0\rangle=x_i|0\rangle+\sqrt{1-x_i^2}|1\rangle,
$$
and similarly for $y_i$. Each index $i$ uses a two-qubit Hadamard-test circuit for
$$
U_i=R_Y^\dagger(\theta_i^x)R_Y(\theta_i^y),
$$
so
$$
\mathbb{E}[Z_i]=x_i y_i+\sqrt{1-x_i^2}\sqrt{1-y_i^2}.
$$
Summing the elementwise estimators and approximating the square-root term produces
$$
\hat{s}=\sum_{i=1}^{d}\hat{r}_i-d+1.
$$
The design point is constant circuit depth with respect to vector dimension, full parallelizability across coordinates, and width $2d$ qubits. The manuscript states that the induced bias is non-negative, but the supplied correction via Cauchy–Schwarz gives
$$
\mathrm{Bias}=\sum_{i=1}^{d}\sqrt{1-x_i^2}\sqrt{1-y_i^2}-(d-1)\le 0,
$$
so the estimator is conservative or exact in special cases. In numerical experiments on random normalized vectors, RMSE decreased from $0.8012$ at $d=2$ to $0.0879$ at $d=12$ [2604.15867].

These results sharpen a frequent misconception: in quantum settings, angle encoding does not automatically imply efficient data loading. In integration, the relevant question is not whether a function can be written through angles, but whether its angle map has low multilinear degree; in similarity estimation, shallow angle circuits are obtained only by trading compact width for larger qubit footprint.

## 4. Positional angle encoding in attention architectures

In Transformers, angle encoding most prominently appears as Rotary Positional Encoding. RoPE rotates query and key embeddings so that attention depends on relative position:
$$
\tilde{\mathbf q}(x)=\mathbf R(\theta(x))\mathbf q,\qquad
\tilde{\mathbf k}(y)=\mathbf R(\theta(y))\mathbf k,
$$
with
$$
\tilde{\mathbf q}(x)^\top \tilde{\mathbf k}(y)
= \mathbf q^\top \mathbf R(\theta(y-x))\mathbf k.
$$
ComRoPE generalizes this by defining the rotation through trainable skew-symmetric angle matrices,
$$
\mathbf R(\mathbf x;\mathcal A)=\exp\!\Big(\sum_{i=1}^{N}\mathbf A_i x_i\Big).
$$
The central theorem is that, for $N>1$, the rotation difference can be represented by the location difference if and only if the generators pairwise commute:
$$
[\mathbf A_i,\mathbf A_j]=0,\qquad
\mathbf R(\mathbf x;\mathcal A)^\top \mathbf R(\mathbf y;\mathcal A)=\mathbf R(\mathbf y-\mathbf x;\mathcal A).
$$
This commutativity condition is presented as the algebraic requirement for preserving the RoPE Equation and therefore offset invariance. Two sufficient constructions are given. ComRoPE-AP uses block-diagonal angle matrices in which each axis controls a disjoint subset of blocks; ComRoPE-LD uses linearly dependent blocks of the form $\mathbf B_i=\theta_i(\mathbf P-\mathbf P^\top)$ [2506.03737].

The practical objective is to expand the transformation space beyond hand-crafted $2$D rotations while retaining relative-position robustness. In the reported ImageNet-1K experiments, ComRoPE-LD surpassed LieRE by $1.6\%$ at training resolution and by $2.9\%$ at higher resolution. On MS COCO object detection with a ViT-S backbone, ComRoPE-LD achieved $\mathrm{AP}=44.7$, slightly above LieRE at $44.5$ and APE at $44.0$, while using roughly half the extra parameters of LieRE; ComRoPE variants also converged faster than APE, by approximately $29\%$ fewer iterations. The implementation computes matrix exponentials of small $b\times b$ blocks, with block size $b\in\{2,4,8\}$ and $b=8$ giving the best accuracy under acceptable overhead. The same paper notes that the current overhead of `torch.matrix_exp` remains a limitation [2506.03737].

Here the central controversy is not whether rotations help, but which algebraic constraints are necessary. Standard RoPE uses fixed frequencies, LieRE trains skew-symmetric blocks without enforcing commutativity, and ComRoPE argues that pairwise commutativity is essential for exact offset-invariant behavior in multi-axis settings.

## 5. Angular representations in geometric learning and detection

In 3D point-cloud detection with graph neural networks, angle encoding is used to construct rotation-invariant edge features from point normals and relative displacement. For an edge $(i,j)$ with normals $\mathbf n_i,\mathbf n_j$ and relative vector $\mathbf r_{ij}=\mathbf x_j-\mathbf x_i$, the paper defines
$$
AM1_{ij}=\arccos\!\frac{\mathbf n_i\cdot \mathbf n_j}{\|\mathbf n_i\|\|\mathbf n_j\|},\qquad
AM2_{ij}=\arccos\!\frac{\mathbf r_{ij}\cdot \mathbf n_j}{\|\mathbf r_{ij}\|\|\mathbf n_j\|},
$$
and
$$
AM3_{ij}=\pi-(AM1_{ij}+AM2_{ij}).
$$
The best-performing edge descriptor is the hybrid
$$
FE_{ij}=[\Delta x_{ij},\Delta y_{ij},\Delta z_{ij},AM1_{ij},AM2_{ij},AM3_{ij},I_j].
$$
On the KITTI subset used in the study, Angle + Relative outperformed the relative baseline for Cars by $+27.89$ mAP on Easy, $+39.29$ on Moderate, and $+37.11$ on Hard, while adding only about $0.062$ s total time over Relative [2108.00780].

In arbitrary-oriented object detection, the main difficulty is angle periodicity, ambiguity, and boundary discontinuity. MGAR addresses this through coarse-grained angle classification and fine-grained angle regression under a long-side-based $180^\circ$ convention. With
$$
\Delta\theta=\frac{180^\circ}{C_\theta},\qquad
c=\Big\lfloor\frac{\theta}{\Delta\theta}\Big\rfloor,\qquad
r=\theta-c\Delta\theta,
$$
the model predicts the coarse class and then regresses a transformed residual $t=\sqrt r$, decoding through
$$
\hat{\theta}=\hat c\,\Delta\theta + \hat t^{\,2}.
$$
An IoU-aware FAR-Loss uses
$$
w=|-\log(\mathrm{IoU})|+1,\qquad
L_{\mathrm{IFL}}=w\cdot \mathrm{SmoothL1}(\hat t-t).
$$
On HRSC2016, MGAR with $C_\theta=5$ reached $\mathrm{mAP}_{50}=97.62$, $\mathrm{mAP}_{85}=49.58$, and $\mathrm{mAP}_{50:95}=68.83$, versus $92.02$, $14.97$, and $52.86$ for a regression-only baseline; it also reduced angle-head thickness by about $97\%$ relative to CSL and was fastest on Jetson AGX Xavier among the compared methods [2209.02884].

A closely related classification-based formulation is DCL, which replaces one-hot angle bins by Binary Coded Labels or Gray Coded Labels. With angular range $\mathrm{AR}=180^\circ$ and bin width $\omega$, the number of angle channels becomes
$$
M=\Big\lceil \log_2(\mathrm{AR}/\omega)\Big\rceil,
$$
so prediction-layer thickness drops from
$$
Th_{\mathrm{onehot}}=A\times(\mathrm{AR}/\omega)
$$
to
$$
Th_{\mathrm{bcl}}=Th_{\mathrm{gcl}}=A\times M.
$$
ADARSW reweights the angle loss through
$$
W_{\mathrm{ADARSW}}(\Delta\theta)=|\sin(\alpha(\theta_{gt}-\hat\theta))|,
$$
with $\alpha=1$ for elongated objects and $\alpha=2$ for square-like ones. The reported effect is approximately $3\times$ faster training than CSL, with DCL increasing mAP$_{50}$ on DOTA from about $64.17$ for regression to $66.53$ for BCL and $66.27$ for GCL, and to $67.39$ and $67.02$ with ADARSW [2011.09670].

Directional encoding on the sphere introduces a different geometric problem: Cartesian coordinate charts distort $S^2$ through pole singularities, seams, and area nonuniformity. The hash-sphere construction addresses this by encoding directions on a hierarchical geodesic grid derived from recursive icosahedral subdivision, interpolating learnable per-vertex features with spherical barycentric weights based on spherical triangle areas. The resulting directional encoding
$$
E_{\mathrm{dir}}(d)=[f_0(d);\dots;f_{L-1}(d)]
$$
extends to a $5$D spatio-directional encoding for signals on $\mathbb{R}^3\times S^2$, using joint interpolation over $8$ spatial voxel corners and $3$ directional vertices per level. In neural path guiding, this encoding outperformed the state of the art by up to a factor of $2$ in variance reduction for the same number of samples, and equal-time comparisons reached approximately $2.2\times$ variance reduction in challenging scenes [2603.05079].

Taken together, these literatures show that angular representations are used for two rather different purposes: to gain invariance to rigid rotations and periodicity, and to respect non-Euclidean topology such as $S^2$. Misunderstanding these as the same problem often leads to ineffective Cartesian parameterizations or unstable boundary-sensitive losses.

## 6. Physical realizations, system constraints, and open questions

In optics, angle encoding becomes a physical multiplexing principle. Angle-multiplexed metasurfaces are designed so that under illumination at one incident angle they impose one complex wavefront and under another angle they impose a different independent wavefront. The demonstrated reflective devices use amorphous-silicon U-shaped meta-atoms on a square lattice of $a=450$ nm, above a spacer and aluminum mirror, and are optimized at $\lambda=915$ nm for TE polarization. Full-wave simulation matches target phase pairs by minimizing
$$
\epsilon=\big|e^{i\phi_1}-r_1\big|^2+\big|e^{i\phi_2}-r_2\big|^2.
$$
A grating demonstration produced $-1.85^\circ$ deflection under $0^\circ$ incidence and $+33.2^\circ$ under $30^\circ$ incidence, with measured deflection efficiencies of $30\%$ and $41\%$ relative to a flat Al mirror. A $2$ mm $\times$ $2$ mm hologram projected a Caltech logo at $0^\circ$ and an LMI logo at $30^\circ$, with a continuous scan showing the image morphing between the two holograms [1711.02265].

In atomic metrology, angle information can also be encoded in intrinsic sensor observables rather than prepared as an input state. In the Bell–Bloom all-optical scalar atomic magnetometer, the polar angle $\theta$ between the magnetic field and the probe beam is inferred from the DC probe transmission
$$
V(\theta)=C_0\exp[-C_1\sin^2\theta-C_2\sin^4\theta],
$$
while a frequency-modulated probe induces a light-shift channel
$$
S_{\mathrm{LS}}(\theta)=B_{1,\mathrm{LS}}\cos\theta.
$$
With a measurement time of $100$ ms, the reported polar-angle sensitivity is better than $0.02^\circ$ at optimal orientation, and the accuracy is better than $1^\circ$ over most of the $0^\circ$ to $180^\circ$ range; with two orthogonal sensors, azimuthal angle measurement is also exhibited [2011.08943].

System constraints matter even when angle encoding is algorithmically simple. Hybriqu Encoder isolates the classical stage that converts features to rotation angles, using the mapping $\theta_i=2\pi x_i$ for angle encoding with $R_Z$ gates and a Rust SIMD kernel that processes four double-precision rotations at once on AVX-class lanes. On Apple Silicon, pure angle encoding is reported as $5.4\%$ faster at $64$ qubits, and end-to-end Python-versus-Rust batching gave speedups from about $3.1\times$ at batch size $10$ to roughly $74.56\times$ to $89.87\times$ at batch size $1000$. The same work emphasizes that kernels applying rotations to the entire state vector become memory-bound, so SIMD improves the compute-bound encoding stage more than the subsequent full state update [2604.06270].

Several open problems recur across these fields. In QAE-based integration, the upper bound $\sum_{k=0}^{d}\binom{n}{k}$ is tight at $d=n$, but tightness for $1<d<n$ remains open [2604.24289]. In generalized RoPE, stricter or weaker alternatives to pairwise commutativity remain to be characterized [2506.03737]. In directional encodings, the trade-off between spherical fidelity, hash collisions, and runtime is still being optimized [2603.05079]. In quantum machine learning, angle encoding remains the default robust choice on NISQ hardware, but its periodicity, feature collisions, and qubit scaling continue to motivate dense-angle, re-uploaded, hybrid, and temporally augmented variants [2606.05387].

Angle encoding is therefore best understood not as a single method but as a recurrent design principle: using angular degrees of freedom to exploit periodicity, relative-position symmetries, rotation invariance, manifold structure, or hardware-native control. Its effectiveness depends less on the presence of an angle than on whether the induced angular algebra matches the geometry and cost model of the task.

Source: https://www.emergentmind.com/topics/angle-encoding