Python sandbox
Write and run Python directly in the browser. The interpreter is Pyodide (CPython compiled to WebAssembly), running in a Web Worker so a long computation never freezes the page; the first visit downloads about 9 MB (runtime, NumPy, autograd), later visits come from the browser cache.
Programs use qcore, a PennyLane-compatible shim on NumPy: import qcore as qml, then qml.device, @qml.qnode, gates such as qml.Hadamard and qml.CNOT, measurements qml.expval, qml.probs, qml.state, and gradients qml.grad computed with the exact parameter-shift rule
A Qiskit-style API is available as from qcore.qiskit import QuantumCircuit, Statevector, execute_counts (Qiskit bit order: qubit 0 is the rightmost bit). qml.show(qnode) draws the circuit below the output. Variables persist between runs until you reset the session; a run is stopped after 15 s.
Loading the editor…