Quantum Equilibria
Quantum Deep Equilibrium Models (QDEQs) place a measured parameterized circuit inside a weight-tied fixed point [90]. SILVA expresses that construction as a source map, a replaceable circuit transition, an equilibrium solver, and a task readout.
From Features to a Fixed Point
Let \(x\) be an image or feature vector. The source adapter produces
At one tied transition, combine the current measured state with the source:
An encoder prepares a statevector, a parameterized unitary transforms it, and a measurement map returns real features:
The QDEQ state satisfies
and the task output is
This is a SILVA point: \(S_\psi\) is the stimulus, the measured circuit is the self-interaction, the root solver establishes the equilibrium, and \(Q_\omega\) is the readout.
Source Architecture Mapping
The source QDEQ implementation uses two settings [90]:
| Part | Four-wire study | Ten-wire study | SILVA object |
|---|---|---|---|
| task | MNIST-4 classification | MNIST, Fashion-MNIST, CIFAR-10 | dataset and readout |
| injected width | \(4^2=16\) | \(10^2=100\) | state_dim=n_qubits**2 |
| encoding | amplitude by default | amplitude by default | encoding="amplitude" |
| fixed circuit | deterministic random layer | deterministic random layer | fixed_depth, fixed_seed |
| trainable gates | RX, RY, RZ, CRX | four repeated gate sets | SILVAStatevectorQuantumCircuit |
| fixed gates | H, SX, CNOT | repeated H, SX, CNOT | circuit block |
| measurement | Pauli-Z on every wire | Pauli-Z on every wire | measured feature vector |
| equilibrium | Broyden or Anderson | Broyden or Anderson | SolverConfig |
| training | direct, warmup, implicit | direct, warmup, implicit | model mode and warmup_steps |
| stability | Jacobian penalty | Jacobian penalty | compute_jacobian=True |
The compact statevector backend implements this gate grammar with ordinary
PyTorch complex tensors. Its memory grows as \(2^q\), so it is intended for
small exact studies. SILVAQuantumCircuitAdapter accepts a real measured
feature module from another simulator or device for larger experiments.
Amplitude Encoding
For \(v\in\mathbb R^d\), pad to \(2^q\) entries and normalize:
The encoded state is
For four wires, the 16-dimensional SILVA state fills the complete statevector. For ten wires, 100 features occupy part of a 1024-amplitude statevector and the remaining amplitudes are zero before normalization.
Trainable Circuit Block
For gate-set index \(i\), the source pattern applies
on the declared wires, followed by fixed H, square-root-X, and CNOT gates. The single-qubit rotations are
Measurement on wire \(j\) returns
The measured vector is interpolated to \(q^2\) features so the transition preserves the equilibrium-state shape.
Compact Executable Model
import torch
from silva_networks import SILVAQuantumDEQ, SILVAStatevectorQuantumCircuit, SolverConfig
circuit = SILVAStatevectorQuantumCircuit(
n_qubits=4,
output_dim=16,
fixed_depth=50,
fixed_seed=1111,
)
model = SILVAQuantumDEQ(
input_dim=16,
output_dim=4,
n_qubits=4,
circuit=circuit,
warmup_steps=100,
direct_steps=10,
config=SolverConfig(
solver="broyden",
max_iter=10,
tol=1e-5,
history=8,
backward_mode="implicit",
backward_solver="broyden",
backward_max_iter=10,
),
)
features = torch.randn(8, 16)
result = model(
features,
training_step=101,
compute_jacobian=True,
return_result=True,
)
loss = result.output.square().mean() + 0.8 * result.jacobian_penalty
loss.backward()
Image Input
The source image reducer maps grayscale \(28\times28\) images to \(q^2\) features:
from silva_networks import SILVAQuantumImageFilter
model = SILVAQuantumDEQ(
input_dim=28 * 28,
output_dim=4,
n_qubits=4,
input_adapter=SILVAQuantumImageFilter(n_qubits=4),
)
images = torch.randn(8, 1, 28, 28)
logits = model(images)
For four wires, the \(28\times28\) image is average-pooled to \(4\times4\). For ten wires, the source stride and padding produce \(10\times10\).
Replace the Circuit Backend
Any module with contract
can be used:
from silva_networks import SILVAQuantumCircuitAdapter
measured_circuit = SILVAQuantumCircuitAdapter(
circuit=my_measured_circuit,
output_dim=100,
)
model = SILVAQuantumDEQ(
input_dim=28 * 28,
output_dim=10,
n_qubits=10,
input_adapter=SILVAQuantumImageFilter(n_qubits=10),
circuit=measured_circuit,
)
The external module owns device execution and measurement. SILVA still owns feature injection, fixed-point solving, backward policy, readout, residuals, and experiment reporting.
Direct, Warmup, and Implicit Training
Direct mode applies the same circuit \(K\) times:
Set mode="direct" to use this path throughout training. With
mode="implicit" and warmup_steps>0, calls whose training_step is below the
warmup boundary use direct steps; later calls use the configured root solver and
backward method. This reproduces the source transition from finite tied depth to
implicit equilibrium.
The Jacobian regularizer estimates
with Rademacher probes. Record its weight, frequency, and number of probes.
Full Experiment Route
The article evaluates four-wire MNIST-4 and ten-wire MNIST, Fashion-MNIST, and CIFAR-10 [90] [91] [92] [81].
- Acquire the official train/test split and record the dataset checksum.
- Match grayscale or color preprocessing, class subset, image normalization, wire count, and encoding.
- Match the fixed circuit seed, trainable gate pattern, direct or implicit schedule, forward and backward solver limits, Jacobian weight, optimizer, learning rate, batch size, and number of updates.
- Run a one-batch direct/implicit agreement check and a gradient check before a complete training run.
- Report accuracy, parameter count, circuit depth, forward residual, iterations, Jacobian estimate, measurement count, runtime, and seeds.
The image datasets are small enough for a workstation: each standard archive is well below one gigabyte. The dominant cost is repeated circuit evaluation and measurement, not dataset storage. A statevector backend scales exponentially in wire count; a device-backed run instead scales with circuit executions and shots.
Where to Go Next
| Question | Page |
|---|---|
| Where is every class documented? | Quantum Equilibria API |
| Where is the complete executable derivation? | QDEQ Lab |
| How do backward choices compare? | Learned Solvers and Backward Approximations |
| How does QDEQ sit beside other families? | Equilibrium Expansion Atlas |