Stochastic & Neuromorphic Computing  /  Explore  /  Quantum bridge

Quantum × stochastic
measurement is a bitstream

Measure a qubit and you get a $0$ or a $1$ with some probability $p$ — which is exactly the semantics of one bit in a stochastic bitstream. So a quantum circuit is a natural front-end for a stochastic-computing datapath: its measurement probabilities map straight onto SC streams with no re-encoding. This page follows that bridge — the mapping, variational training, entanglement, and realistic hardware noise.

The core idea — a qubit is a stochastic bit source

Prepare a qubit in a superposition and it collapses on measurement to $|1\rangle$ with probability $p$. Repeat, and the sequence of outcomes is a stochastic bitstream whose $1$-density is $p$ — the same object the stochastic-computing pages are built on. A rotation gate sets $p$ continuously, so the quantum layer is a probability source that the SC arithmetic consumes directly.

$$R_y(\theta)|0\rangle = \cos\tfrac{\theta}{2}\,|0\rangle + \sin\tfrac{\theta}{2}\,|1\rangle, \qquad p=\Pr(|1\rangle)=\sin^2\tfrac{\theta}{2}, \qquad p=\tfrac{\langle Z\rangle+1}{2}$$
Live — a rotation angle becomes a bitstream
P(|1⟩) = sin²(θ/2) 0.500  measured density

Turn the angle and the qubit's probability of measuring $|1\rangle$ sweeps from 0 to 1; the row of samples is the resulting bitstream. Switch on the Heron readout noise and a small fraction of bits flip at measurement — the same imperfection a real device has.

01  The mapping — no re-encoding needed

The bridge is almost trivial, which is the point. A measurement probability of $0.7$ is a bitstream that is $1$ about $70\%$ of the time. A whole measurement sequence is a bitstream directly. A multi-qubit state gives several bitstreams at once — and if the qubits are correlated, so are the streams.

$$\Pr(|1\rangle)=0.7 \;\longleftrightarrow\; \text{70\% ones}, \qquad \text{$n$-qubit state} \;\longleftrightarrow\; n\text{ (possibly correlated) streams}$$
Deeper: decode via the Pauli-Z expectation
In practice the quantum layer reports each wire's expectation value $\langle Z\rangle\in[-1,1]$, and the SC front-end reads the probability off it as $p=(\langle Z\rangle+1)/2$. That single line is the entire interface: everything downstream — the AND-gate multiplier, the spiking neuron — treats the quantum output as an ordinary stochastic stream. The quantum device does the sampling a stochastic number generator would otherwise do; the difference is that a quantum circuit can prepare probabilities (and correlations) that are hard to produce classically.
02  Variational quantum front-ends (VQE)

Because the mapping is differentiable-friendly, the quantum circuit can be a trainable front-end. A variational circuit with tunable gate parameters encodes the input, entangles, and measures; its probabilities feed a stochastic-computing classifier, and the whole hybrid is optimised end-to-end — the pattern behind the variational quantum eigensolver (VQE).

Deeper: the hybrid loop
An input $x$ is embedded into rotation angles, a few entangling layers mix the wires, and the per-wire expectations become the SC layer's inputs. The loss is evaluated after the classical stochastic stage, and both halves are updated: the quantum parameters by the exact gradient below, the SC weights by their own pseudo-gradient. The quantum layer is thus a learned feature map whose output is already in the stochastic representation the hardware runs on — no boundary conversion, and a natural path to running the classical half on the FPGA.
03  Exact gradients — the parameter-shift rule

You cannot finite-difference a quantum circuit cheaply, but you do not need to: for the usual gates the gradient of an expectation with respect to a gate angle is exact from just two more circuit evaluations, shifted by $\pm\tfrac{\pi}{2}$. No approximation, no step-size tuning.

$$\frac{\partial \langle H\rangle}{\partial\theta} = \frac{\langle H\rangle_{\theta+\pi/2} - \langle H\rangle_{\theta-\pi/2}}{2\sin(\pi/2)} = \tfrac{1}{2}\Big(\langle H\rangle_{\theta+\pi/2} - \langle H\rangle_{\theta-\pi/2}\Big)$$
Deeper: why it is exact
For a gate generated by an operator with two eigenvalues (a single-qubit rotation), the expectation value is exactly sinusoidal in the gate angle, so two symmetric evaluations recover its derivative with no truncation error — unlike a finite difference, whose accuracy trades against a step size. This makes the quantum half trainable with the same autograd machinery as the classical half, and it composes cleanly with the surrogate-gradient trick used for the spiking layers elsewhere on the site.
04  Entanglement-correlated streams

Independent qubits give independent bitstreams. Entangle them — a Bell pair $|\Phi^+\rangle$ — and their measurement outcomes are correlated, so the two bitstreams are too. That matters directly: stochastic multiplication assumes independent streams, so feeding it correlated ones shifts the result, a "correlation boost" the quantum layer can dial in on purpose.

$$|\Phi^+\rangle = \tfrac{1}{\sqrt2}\big(|00\rangle + |11\rangle\big) \;\Rightarrow\; \text{outcomes always agree} \;\Rightarrow\; \text{AND density} \to p,\ \text{not } p^2$$
Deeper: correlation as a resource
The stochastic-computing pages stress de-correlation as a requirement for the AND multiplier to be exact. Entanglement is the deliberate opposite: it lets the quantum front-end produce streams with a controlled correlation structure that a classical LFSR cannot cheaply make, which the SC stage then reads as a signal rather than an error. It is the clearest example of the bridge doing something a purely classical stochastic pipeline cannot.
05  Realistic noise & error correction

Simulating on ideal qubits flatters the result. SC-NeuroCore carries a calibrated noise model for IBM's Heron r2 device — finite coherence times and asymmetric readout error — so the hybrid is evaluated under conditions a real machine imposes, and quantum error correction can be layered where it earns its overhead.

Heron r2 (2024 calibration): T1 ≈ 300 µs · T2 ≈ 200 µs · readout 0→1 ≈ 1% · readout 1→0 ≈ 2%
Deeper: what the noise does to a bitstream
Coherence decay pulls a prepared probability back toward the mixed state, and asymmetric readout flips a small, direction-dependent fraction of measured bits — the readout error you can toggle in the demo above. Because stochastic computing is already fault-tolerant (a flipped bit moves a density by only $1/L$), modest device noise degrades accuracy gracefully rather than catastrophically, which is part of why the two paradigms fit. Where more fidelity is required, the QEC layer adds redundancy at the usual cost.
Where it fits

The quantum bridge is not a separate stack — it is a probability source that plugs into the front of the same stochastic datapath the rest of the site describes, and its classical half lowers to the same FPGA path. It is one of the clearest differentiators in the toolkit: a place where quantum sampling and neuromorphic hardware share a single representation.

The demo runs an exact single-qubit rotation and Heron-style readout noise in your browser to illustrate the mapping; full hybrid circuits use a quantum simulator (with the calibrated noise model) or real hardware, not this page.