Qubit states in one line
A single qubit lives in a two-dimensional complex vector space. Any pure state can be written as
|ψ⟩ = α|0⟩ + β|1⟩
with the constraint ∣α∣² + ∣β∣² = 1. Multi-qubit systems are tensor products of these spaces, and gates are unitary operators on them.
Variational circuits
A variational quantum circuit is a gate sequence U(θ) with tunable parameters θ. The circuit prepares a state |ψ(θ)⟩ and we define a classical loss L(θ) based on measurement statistics.
L(θ) = ⟨ψ(θ)| H |ψ(θ)⟩
where H is an observable (for example a Hamiltonian or a task-specific operator). Gradients can be estimated via parameter-shift rules.
Hybrid training loop
A realistic near-term pattern is a hybrid loop: classical networks handle perception and post-processing, while a small quantum circuit is used as a trainable layer or sampler.
def step(x, params_classical, params_quantum):
features = classical_encoder(x, params_classical)
expectation = run_quantum_circuit(features, params_quantum)
logits = classical_head(expectation, params_classical)
loss = loss_fn(logits, target)
loss.backward()
optim.step()
return loss
The quantum circuit is treated as a differentiable component with noisy gradient estimates; the rest of the stack looks like familiar deep learning.
Quantum AI mermaid schema
Systemically, the hybrid model can be drawn as: