---
title: 'q-sampling: Context-Dependent Sampling Methods'
url: https://www.emergentmind.com/topics/q-sampling
type: topic
---

# q-sampling: Context-Dependent Sampling Methods

In current technical literature, **q-sampling** is not a single standardized notion. In quantum algorithms, it usually denotes preparation of a coherent amplitude encoding of a probability distribution, such as $\ket{\psi_p}=\sum_{i=1}^N \sqrt{p_i}\ket{i}$ or, for reversible Markov chains, a QSAMPLE $\ket{\pi}=\sum_{x\in\Omega}\sqrt{\pi(x)}\ket{x}$ [2506.07724] [2605.23442]. In diffusion MRI, by contrast, q-space sampling denotes the selection of diffusion-encoding wave-vectors or gradient directions used to probe tissue microstructure, with signal formation governed by relations such as $S(q)=\int P(r)e^{-i2\pi q\cdot r}\,dr$ [2009.03008]. Additional established uses include q-boson sampling, perfect sampling of proper $q$-colorings, and sampling the transforms associated with q-Dirac systems [2506.21094] [2511.04982] [1804.06224].

## 1. Terminological scope and core objects

Across the cited literature, the symbol $q$ plays several distinct roles: it may denote **quantum** sampling in the amplitude-encoding sense, the **q-space** wave-vector in diffusion imaging, a **deformation parameter** in q-boson and q-Dirac systems, or the **number of colors** in graph-coloring samplers [2506.07724] [2009.03008] [2506.21094] [2511.04982] [1804.06224]. Accordingly, the phrase *q-sampling* is strongly context-dependent.

| Setting | Sampled object | Canonical representation |
|---|---|---|
| Quantum algorithms | Probability distribution or stationary distribution | $\ket{\psi_p}=\sum_i \sqrt{p_i}\ket{i}$ |
| Diffusion MRI | Gradient directions or q-space signal | $S(q)=\int P(r)e^{-i2\pi q\cdot r}\,dr$ |
| q-deformed or combinatorial systems | q-boson outputs, q-colorings, q-Dirac transforms | Permanent laws, CFTP samplers, interpolation series |

The quantum-algorithmic usage emphasizes **state preparation**: sampling is achieved by measuring a coherently prepared state. The diffusion-MRI usage emphasizes **acquisition design**: the sampling scheme determines which points on a sphere or shell are measured and therefore what angular information is available for reconstruction. The q-deformed and combinatorial usages instead concern **families of sampling problems** parameterized by $q$, where $q$ modifies algebraic relations, spectral transforms, or feasibility thresholds.

This distribution of meanings suggests that *q-sampling* functions less as a single method than as a family of domain-specific sampling frameworks unified only by notation.

## 2. Quantum-state preparation and sampling over quantum state spaces

In the most direct quantum-information sense, q-sampling is the task of preparing a state whose amplitudes encode a target distribution. For a distribution $p=(p_i)_{i=1}^N$, the objective is to prepare
$$
\ket{\psi_p}=\sum_{i=1}^N \sqrt{p_i}\ket{i},
$$
so that computational-basis measurement returns outcome $i$ with probability $p_i$ [2506.07724]. For a reversible, ergodic Markov chain with stationary distribution $\pi$, the corresponding QSAMPLE is
$$
\ket{\pi}=\sum_{x\in\Omega}\sqrt{\pi(x)}\ket{x},
$$
which is the basic primitive used in quantum simulated annealing and related transport procedures [2605.23442].

Ancilla-efficient QSAMPLE preparation for reversible Markov chains has recently been reformulated around a **one-ancilla-qubit** working register. The central ingredients are a qubitized Szegedy walk, a generalized quantum signal processing based spectral projector onto its $1$-eigenspace, and a selective-phase compiler embedded into fixed-point amplitude amplification. In this framework, if $p_{\min}$ is the minimum adjacent-state overlap and $\Delta_{\min}$ the minimum phase gap along the schedule, the total query complexity is
$$
\widetilde O\!\Bigl(\frac{\ell}{\sqrt{p_{\min}\,\Delta_{\min}}}\Bigr),
$$
up to polylogarithmic factors, while the ancilla cost is reduced to one qubit [2605.23442]. The same work states two explicit improvements over the previous Wocjan–Abeyesinghe framework: ancilla overhead is reduced from polylogarithmic in the inverse gap to exactly one qubit, and the overlap dependence improves from inverse minimum overlap to inverse square-root minimum overlap [2605.23442].

A distinct but related usage appears in the **QSampling** online resources for generating classical random samples from the quantum state space by Hamiltonian Monte Carlo. There the target may be the Hilbert–Schmidt measure, the Bures measure, or the Haar measure on pure states, and the state is parameterized either through a Cholesky factorization,
$$
\rho = \frac{T T^\dagger}{\mathrm{Tr}(T T^\dagger)},
$$
or through a spectral parametrization [1612.05180]. The sampling dynamics use a leapfrog integrator and a Metropolis accept-reject step. The documentation reports that sample sizes $\ge 10^6$ are standard, with typical run times for $10^6$ samples of approximately $30\,\mathrm{s}$ for a single qubit, $2\,\mathrm{min}$ for a qutrit, and $5$–$10\,\mathrm{min}$ for two qubits on a $3\,\mathrm{GHz}$ desktop; recommended acceptance rates are approximately $60$–$80\%$ [1612.05180]. In this setting, *sampling* refers not to amplitude encoding but to Monte Carlo traversal of the physical state space.

## 3. Algorithmic variants: proportional, distributed, and variational sampling

One quantum-algorithmic variant is **proportional sampling** from an oracle-specified weight function $c:X\to[0,1)$. The goal is to output $x$ with probability approximately $c(x)/\sum_y c(y)$, given bit-oracle access
$$
O_c\ket{x}\ket{0}^m=\ket{x}\ket{c(x)}.
$$
Laneve’s construction uses quantum signal processing for a **phase-extraction** subroutine, first encoding $\sqrt{c(x)}$ into a phase oracle and then applying a QSP/QET block-encoding followed by amplitude amplification [2303.11077]. For error parameter $\epsilon$, the query complexity is
$$
\widetilde O\!\Bigl(\frac{1}{\bar c\,\sqrt{\epsilon}}\Bigr),
$$
where $\bar c=(1/N)\sum_x c(x)$, and in the worst case $\bar c=\Theta(1/N)$ this becomes $\widetilde O(\sqrt{N}/\sqrt{\epsilon})$ [2303.11077]. The same source contrasts this with a classical $\Omega(N)$ lower bound for normalization in the unstructured setting.

A second variant studies **distributed** quantum sampling. Here $n$ machines store multisets $T_j\subseteq[N]$ with multiplicities $c_{ij}$, while a coordinator has access only to counting oracles. In the oblivious communication model, communication schedules are predetermined rather than adaptive. The target state is
$$
\ket{\psi}=\frac{1}{\sqrt M}\sum_i \sqrt{c_i}\ket{i},
$$
with $c_i=\sum_j c_{ij}$ and $M=\sum_i c_i$ [2506.07724]. Under the assumption $\nu\ge M/(N\varepsilon)$, the exact sequential algorithm uses
$$
O\!\Bigl(n\sqrt{\frac{\nu N}{M}}\Bigr)
$$
queries, whereas the exact parallel algorithm uses
$$
O\!\Bigl(\sqrt{\frac{\nu N}{M}}\Bigr)
$$
parallel queries [2506.07724]. Matching lower bounds show these complexities are optimal in the oblivious model.

A third use of quantum sampling arises in **Quantum Sampling Regression** for variational eigensolving. Rather than iteratively querying a quantum processor as in standard VQE, Quantum Sampling Regression assumes that the map from ansatz parameters $\theta$ to the expectation value $\langle H\rangle$ is a low-bandwidth periodic function and reconstructs it by Fourier regression [2012.02338]. If the maximum harmonic index in parameter $\theta_j$ is $S_j$, then the required grid size is
$$
T=\prod_{j=1}^n (2S_j+1).
$$
Defining $S_{\max}=\max_j S_j$ and $s=\log_2(2S_{\max}+1)$ gives the bound $T\le 2^{sn}$, so QSR uses $O(2^{sn})$ quantum-circuit runs [2012.02338]. The total time model reported for QSR is
$$
O(n^cN^q2^{sn}+2^{3sn}+2^{sn}n^p),
$$
whereas the asymptotic quantum-resource ratio relative to exhaustive-search VQE is $2^{(x-s)n}$ [2012.02338]. On the deuteron binding-energy benchmark, the one-parameter case used $3$ QSR samples versus $24$ VQE samples, and the two-parameter case used $25$ QSR samples versus $183$ VQE samples, with equal or better energy error in both cases [2012.02338]. This suggests that, in low-parameter regimes, sampling-and-regression can substitute for iterative noisy optimization.

## 4. q-Space sampling in diffusion MRI

In diffusion MRI, **q-space** is the space of diffusion-encoding wave-vectors $q$, parameterized in practice by a b-value and a gradient direction. For fixed $b$, the sampling domain is a sphere of gradient orientations; for multi-shell acquisitions it is a set of shells [2009.03008] [2409.02309]. The acquired signal is linked to the ensemble average propagator by
$$
S(q)=\int P(r)e^{-i2\pi q\cdot r}\,dr,
$$
and in the Gaussian regime to the diffusion tensor by the Stejskal–Tanner model
$$
S(b,g)=S_0\exp\bigl(-b\,g^\top D\,g\bigr)
$$
[2009.03008]. The sampling design therefore directly controls what information about tissue microstructure is observable.

A central recent direction is **joint optimization of sampling design and reconstruction model**. In one formulation, a fully sampled diffusion volume $X\in\mathbb{R}^{H\times W\times D\times N}$ is passed through a differentiable sub-sampling layer $S_{\phi,\theta}$ that selects $n\ll N$ directions, and a U-Net $R_\psi$ reconstructs the full-direction volume. The joint learning objective is
$$
\min_{\psi,\phi,\theta}\sum_{X\in\mathrm{Train}}\|R_\psi(S_{\phi,\theta}(X))-X\|_2^2
$$
[2009.03008]. On Human Connectome Project data resampled to $N=90$ directions at $b=1000\,\mathrm{s/mm}^2$, the learned scheme at acceleration factor $AF=3$ improved PSNR from $48.99\pm1.62\,\mathrm{dB}$ to $49.18\pm1.52\,\mathrm{dB}$; in tractography space, the bundle-averaged Bhattacharyya distance was up to $1.3$ points lower than with fixed sampling for $AF=10\ldots30$ [2009.03008]. The same study reports that learned directions alone, even without the reconstruction network, reduce the Bhattacharyya distance by $0.08$–$0.74$ points.

A related end-to-end framework, SSOR, uses a continuous spherical-harmonic representation of the signal,
$$
S(\theta_i,\phi_i)=\sum_{j=1}^R c_j\,Y_j(\theta_i,\phi_i),
$$
with learnable sampling locations $(\theta'_i,\phi'_i)$ and a reconstruction network $R_\psi$ [2401.01662]. Its optimization criterion is
$$
\min_{\psi,\theta,\varphi}\ \|R_\psi(Q_{\theta,\varphi}(x))-x\|_1+\lambda\|R_\psi(Q_{\theta,\varphi}(x))\|_{\mathrm{TV}}.
$$
On HCP data with $90$ directions per shell and acceleration factors $30\times$, $15\times$, and $10\times$, SSOR reports in-distribution results at $b=1000$ of $36.19\,\mathrm{dB}/0.857$ for $n=3$, $38.91\,\mathrm{dB}/0.892$ for $n=6$, and $39.70\,\mathrm{dB}/0.889$ for $n=9$ in PSNR/SSIM, with out-of-distribution gains of approximately $1$–$2\,\mathrm{dB}$ and $0.06$–$0.10$ SSIM over alternatives at $b=2000,3000$ [2401.01662]. This suggests that q-space sampling design is increasingly treated as a trainable front end rather than a fixed protocol.

## 5. q-Space up-sampling and robustness to variable sampling schemes

When only a sparse subset of gradient directions is acquired, the q-sampling problem becomes an **angular up-sampling** problem: given observed DWIs at directions $G_{\mathrm{low}}$, infer the missing signals at $G_{\mathrm{high}}\setminus G_{\mathrm{low}}$ [2409.02309]. QID$^2$ formulates this as a conditional diffusion model for
$$
p(x_*\mid X_{\mathrm{low}},g_*),
$$
where $x_*$ is the missing image at target direction $g_*$ and the conditioning includes low-angular-resolution DWIs and directional embeddings [2409.02309]. The denoiser is a U-Net with cross-attention over reference images and gradient-direction tokens. On HCP single-shell data with $90$ gradient directions, using $R=30$ observed directions and $60$ targets, QID$^2$ reports, for the summarized table at $R=3$, FID $14.1$ versus $24.9$ for qGAN and $29.9$ for cGAN, FA error $0.027$ versus $0.037$ and $0.099$, and FA-map SSIM $0.866$ versus $0.792$ and $0.643$ [2409.02309].

A geometrically structured alternative is **HemiHex** sub-sampling, which tessellates q-space locally around each unknown direction using three known low-angular-resolution neighbors forming a Delaunay triangle on the sphere [2211.00240]. For each unknown direction, the regression input is a $27\times 3$ local spatio-angular patch, flattened to $81$ features, and a fully connected network predicts the missing scalar DWI value [2211.00240]. The reported architecture uses two hidden layers of $128$ and $64$ ReLU units, batch size $256$, and three sequential optimization phases—SGD with momentum, Adam, and RMSProp—with total training time under $10$ minutes on an Intel Core i7 with $16\,\mathrm{GB}$ RAM [2211.00240]. The training curves show a two-order-of-magnitude reduction in MSE and a final RMSE on held-out healthy subjects on the order of $10^{-2}$ [2211.00240].

Robustness to changing q-space schemes is the focus of **SamRobNODDI**, which treats q-space sampling itself as an augmentation variable during training [2411.06444]. Starting from fully sampled multi-shell data, the method combines uniform and random subsampling, fits a truncated spherical-harmonic representation with $L=6$, and imposes a sampling consistency loss
$$
L_{\rm consis}=L_r+L_u+\mu L_{r,u},
$$
with $\mu=0.001$ [2411.06444]. Across $18$ different q-space sampling schemes, SamRobNODDI reports in same-sampling testing a PSNR\_All of $32.61\,\mathrm{dB}$ and SSIM\_All of $0.9878$, slightly exceeding HGT at $32.56\,\mathrm{dB}$ and $0.9875$; under random-sampling testing, it maintains PSNR\_All $32.27\,\mathrm{dB}$ and SSIM\_All $0.9866$, whereas competing deep nets fall to approximately $20$–$22\,\mathrm{dB}$ and $0.92$–$0.94$ [2411.06444]. The same source states a practical recommendation of approximately $40$ total directions, with at least $15$–$20$ per shell, to achieve PSNR $>30\,\mathrm{dB}$ and SSIM $>0.98$.

## 6. q-Deformed, combinatorial, and acronymic extensions

In **q-boson sampling**, $q$ is a deformation parameter in the Arik–Coon commutation relation
$$
a_{q,i}a_{q,i}^\dagger-q\,a_{q,i}^\dagger a_{q,i}=1.
$$
The sampling protocol takes an input Fock configuration, applies a passive interferometer, and measures an output Fock configuration; the output probability is given by a matrix-permanent formula identical in form to standard boson sampling [2506.21094]. The same work identifies a transmon Hamiltonian with a q-boson Hamiltonian through $q\approx 1+\delta$ where $\delta=K/\omega$, and states an informal hardness theorem under exact or relative-error approximate sampling together with non-collapse of the polynomial hierarchy [2506.21094]. Its feasibility discussion reports spectrum agreement for $|K/\omega|\le 0.1$ up to approximately $n=10$, as well as a simulated total-variation error below $5\%$ for a $4$-mode, $n=2$ sampler after depth $10$ [2506.21094].

In sampling proper **$q$-colorings** of a graph, $q$ denotes the number of colors rather than a deformation parameter. For graphs of maximum degree $\Delta$, recent work establishes an asymptotically tight threshold for bounding-chain-based coupling from the past: an efficient Las Vegas perfect-sampling algorithm exists when
$$
q>2.5\,\Delta+2\sqrt{(\log\Delta+1)\,\Delta},
$$
with expected runtime $\tilde O(n\Delta^2)$, while no contractive bounding-chain method can coalesce below $q<2.5\,\Delta$ [2511.04982]. Here *sampling* refers to exact sampling from the uniform distribution over proper colorings.

In the theory of **q-Dirac systems**, sampling takes the form of an interpolation theorem. For the q-type transform
$$
F(\lambda)=\int_0^a f^T(x)\phi(x,\lambda)\,d_qx,
$$
the transform is entire and admits the reconstruction
$$
F(\lambda)=\sum_{n=1}^\infty F(\lambda_n)\,\frac{\omega(\lambda)}{(\lambda-\lambda_n)\omega'(\lambda_n)},
$$
with absolute convergence in $\mathbb C$ and uniform convergence on compact subsets [1804.06224]. This is a q-analogue of classical sampling theory rather than a stochastic-sampling procedure.

A further acronymic usage is **Quadrature Compressive Sampling** for radar signals. QuadCS combines random spectral spreading, bandpass filtering, and low-rate quadrature sampling to acquire compressive I/Q measurements, and the reconstructed signal is recovered by $\ell_1$ methods from a waveform-matched dictionary [1401.1346]. For $K$ targets in observation interval $T$, the paper reports stable reconstruction from $O(K\log(BT/K))$ samples in simulation, an empirical rule
$$
B_{cs}\approx 1.78\,\frac{K}{T}\log\frac{BT}{K},
$$
and an RSNR drop of approximately $3\,\mathrm{dB}$ per octave increase in $K$ together with a $3\,\mathrm{dB}$ RSNR gain per octave increase in compressive bandwidth [1401.1346]. Although this usage is not tied to quantum algorithms or q-space geometry, it remains a recognized technical meaning of “q-sampling” in signal-processing contexts.

Taken together, these literatures show that q-sampling is best understood as a **context-indexed family of sampling concepts**. In quantum computation it centers on coherent amplitude encoding and state transport; in diffusion MRI it centers on directional acquisition design and angular reconstruction; in q-deformed and combinatorial settings it denotes sampling problems whose structure is controlled by a parameter $q$ or by q-analogue operators. The common theme is not a shared implementation, but the central role of sampling architecture in determining what information can be represented, reconstructed, or certified.

Source: https://www.emergentmind.com/topics/q-sampling