Quantum DSL basics
Use qubits N, one gate per line, and MEASURE i for output counts.
API
This page documents the existing quantum circuit simulator API shape. It does not add a new API surface.
POST /api/runSimulation accepts quantum DSL and shot count, then returns probabilities, counts, Bloch sphere visualization data, and a circuit diagram when available.
{
"circuit": "qubits 2\nH 0\nCX 0 1\nMEASURE 0\nMEASURE 1",
"shots": 1024
}
{
"probabilities": [{ "state": "00", "probability": 0.5 }],
"counts": { "00": 512, "11": 512 },
"blochVectors": [{ "x": 0, "y": 0, "z": 0 }],
"circuitDiagram": "data:image/svg+xml;base64,..."
}
Use qubits N, one gate per line, and MEASURE i for output counts.
H, X, Y, Z, S, T, CX, and CNOT are supported by the current simulator.
Use the simulator toolbar to copy OpenQASM export for supported quantum DSL gates.
Keep examples small. Statevector simulation grows exponentially with qubit count.