Quantum Computing in Kettle ​
This guide introduces quantum computing concepts through Kettle's lens.
What Makes Quantum Different? ​
Classical computers use bits (0 or 1). Quantum computers use qubits that can be in superposition—effectively 0 and 1 simultaneously until measured.
In Kettle, qubits are:
- Linear types—cannot be copied or discarded implicitly
- Effect-tracked—quantum operations require the
Quantumeffect
Familiar Syntax, New Domain ​
Kettle uses the same constructs for quantum code that you already know from classical programming:
| Classical | Quantum | Same Syntax |
|---|---|---|
x = 5 | q = qubit() | Variable binding with = |
x <- double | q <- hadamard | Rebind with <- |
result = compute(x) | result = measure(q) | Function calls |
for i in range(...) | for q in qubits(...) | Loops |
The <- operator you learned in Language Basics works exactly the same way—it applies a transformation and rebinds the result.
Chapters ​
- Qubits - Creating and understanding qubits
- Gates - Manipulating quantum state
- Measurement - Extracting classical information
- Entanglement - Correlated quantum states