harmoniq

Initializing...
gates:
2 steps/s
presets:
10%
20%
80%
50%
50%
entanglement
0.00
Z correlation
0.00
X correlation
0.00

Click a gate, then click a wire position to place it. For CNOT/CZ/iSWAP, click two different qubits at the same step. Right-click to remove.

what is this

Harmoniq sonifies a 3-qubit quantum state. You build a quantum circuit in the editor, and a playhead scrubs through it step by step. At each step the full quantum state is reconstructed from scratch, and its probability distribution is turned into sound. You hear the quantum state evolve in real time.

the quantum state

The system starts with all qubits in |0⟩ (default 3 qubits, adjustable from 1 to 8). With n qubits there are 2n basis states. Each step applies gates that transform the state into a superposition of all basis states, each with a complex probability amplitude. The probabilities always sum to 1. The state vector display shows the full amplitudes — magnitudes and phases — so you can see exactly what the simulator is doing.

two measurement bases

A quantum state looks different depending on how you measure it. Harmoniq reads the state in two complementary bases simultaneously:

  • Z-basis (computational basis) — the "natural" measurement. A Hadamard on one qubit gives a 50/50 split between |0⟩ and |1⟩.
  • X-basis — the "rotated" measurement. The same state that looks uncertain in Z-basis looks completely definite in X-basis, and vice versa. This is the uncertainty principle made audible.

To read X-basis probabilities without collapsing the state, the simulator applies a Hadamard to each qubit, reads probabilities, then reverses with inverse Hadamard.

how probability maps to sound

Each basis state (2n for n qubits) is assigned a note from the selected scale, extending into higher octaves as needed. The mapping adapts when you change the scale, root octave, qubit count, or X-basis octave offset in the sound controls.

All 16 oscillators (8 per basis) run continuously. The probability of each basis state controls its oscillator's volume: gain = sqrt(probability) × scale. The square root gives a perceptually linear loudness curve. Zero probability means silence; equal superposition plays all notes as a chord.

sound controls

  • Z wave / X wave — waveform for each basis layer: sine (pure), triangle (warm overtones), square (hollow, buzzy), or sawtooth (bright, harsh). Changing waveform is like switching instruments.
  • scale — which musical scale the 8 basis states map onto. Options: C major, C minor, pentatonic, whole tone, chromatic, blues, dorian, phrygian. Each distributes the notes differently across the octave.
  • octave — root octave (2–6). Lower octaves produce deep drones; higher octaves are bell-like.
  • X octave — pitch offset for the X-basis layer relative to the root. Default +1 (one octave up) separates the two layers by register. Set to "same" to hear them in unison, or -1 to put X below Z.
  • decay — note attenuation. At 0 (off), notes sustain continuously as a drone. Increasing decay makes notes fade after each step — low values give pad-like tails, high values give short plucks. At 100% decay is ~50ms (percussive).
  • reverb — delay-feedback reverb with a lowpass filter on the tail. 0% is fully dry. Higher values add space and wash.
  • Z vol / X vol / master — independent volume for each basis bus and the master output. Use these to solo one basis or balance the mix.

transport

  • play / stop — starts the playhead from step 0. The circuit loops continuously.
  • speed — how many steps per second the playhead advances (0.5–8). Slower speeds let you hear each state change distinctly; faster speeds blur into a rhythm.
  • − step / + step — remove or add one time step. Removing a step deletes any gates on it.
  • − qubit / + qubit — remove or add a qubit wire (1–8). Adding a qubit doubles the number of basis states and oscillators. Removing one halves them and deletes any gates referencing the removed wire.
  • clear — removes all gates from the circuit without changing the number of steps.

presets

  • full superposition — H on all 3 qubits at step 0. Equal probability across all 8 states in Z-basis; all weight on |000⟩ in X-basis. Listen for the full chord in Z vs. a single note in X.
  • GHZ entangled — H then two CNOTs, creating (|000⟩ + |111⟩)/√2. Maximally entangled: two notes in Z-basis, a complex spread in X-basis.
  • product state — each qubit prepared independently (H, H+T, X+H). All 8 states have nonzero probability but zero correlations between qubits. This is the non-entangled baseline.

what to listen for

  • Single note → chord: Place H on one qubit. Z-basis splits from one note into two; X-basis collapses from spread to focused. Complementarity: sharpness in one basis costs sharpness in the other.
  • Entanglement: H then CNOT. Z-basis plays two notes (Bell state), X-basis spreads wider. Entangled states sound "wider" across bases.
  • Phase gates (Z, T): These change phase without affecting Z-basis probabilities — so Z-basis sound is identical before and after. But X-basis hears the difference immediately. Something invisible in one basis is loud in the other.
  • Scale + decay: Try blues scale with moderate decay for a jazzy plucked feel. Whole tone with no decay for an eerie drone. Pentatonic always sounds consonant.
  • iSWAP: Swaps two qubits and adds phase. Listen for notes trading places across the scale.

the gates

gate n what it does
H 1 Hadamard — creates or destroys superposition. Maps |0⟩ to equal mix of |0⟩+|1⟩.
X 1 Bit flip — swaps |0⟩ and |1⟩. The quantum NOT gate.
Z 1 Phase flip — multiplies |1⟩ by −1. No change to Z-basis probabilities; rotates X-basis.
T 1 Pi/8 gate — phase of eiπ/4 on |1⟩. A gentle Z. Subtle X-basis shifts.
CNOT 2 Controlled-X — flips the target only when control is |1⟩. Creates entanglement from superposition.
CZ 2 Controlled-Z — phase flip when both qubits are |1⟩. Symmetric between the two qubits.
iSWAP 2 Swaps two qubits and adds a phase of i. Creates anti-correlated entanglement.
M 1 Measurement — collapses a qubit in the Z-basis. Creates a mixed state: the simulator branches into all possible outcomes, weighted by probability. Destroys entanglement on the measured qubit but preserves classical correlations.

the visualizations

  • Bar chart — 8 pairs of bars, one per basis state. Blue = Z-basis probability, orange = X-basis. Height is probability (0–1). Note names from the current scale are shown below.
  • Waveforms — three real-time oscilloscope lanes showing the audio signal. Top (blue) is the Z-basis submix, middle (orange) is X-basis, bottom (gray) is the combined master output after reverb.
  • State vector — the full |ψ⟩ = ∑ αi|i⟩ with magnitudes (blue) and phases (purple). Common values are shown symbolically (1/√2, i, eiπ/4, etc.). Zero-amplitude terms are hidden.