Skip to content

Frameworks overview

Nuclei runs two quantum programming languages:

  • Python, hosting three SDKs — Qiskit, Cirq, and CUDA-Q. The kernel exec()s your code, then inspects the resulting namespace for a circuit object.
  • Q# (Microsoft QDK). Source-mode: the text is compiled by the qdk interpreter and never reaches Python exec().

OpenQASM is not yet supported as an input language (planned). Pasting QASM produces unsupported_framework.

Whatever the framework, the adapter layer normalizes everything into one CircuitSnapshot / SimulationResult shape — the circuit renderer, Bloch sphere, and histogram never see framework-native objects.

The executor tries each adapter’s regex against the source in declaration order — first match wins. Verbatim from ADAPTER_SPECS:

OrderFrameworkDetection regex
1qsharp^\s*(namespace\s+[\w.]+|operation\s+\w+\s*\(|import\s+Std|open\s+Microsoft\.Quantum) (multiline)
2qiskitfrom\s+qiskit\s+import|import\s+qiskit
3cirqimport\s+cirq|from\s+cirq\s+import
4cuda-qimport\s+cudaq|from\s+cudaq\s+import|@cudaq\.kernel

Q# is checked first, deliberately: Q# source would be a syntax error under every Python spec, and none of the Python patterns can false-positive on Q# keywords.

parse / execute / hardware_submit messages accept an optional language hint that beats the regexes:

languageEffect
"qsharp"Routes straight to the Q# adapter — no regex consulted.
"python"Excludes source-mode specs, so Q#-looking text inside Python strings or comments can’t hijack routing. Python regexes still pick the SDK.
omittedPure regex detection (older clients).

Install sizes come from the framework catalog; web availability from the desktop vs web matrix.

FrameworkVendorSimulator~Install (MB)DesktopWeb (/try)
QiskitIBMAerSimulator (exact statevector + sampled counts)220yesno
CirqGooglecirq.Simulator60yesyes (cirq-core via micropip)
CUDA-QNVIDIAcudaq.sample() (+ best-effort get_state)500yesno
Q#Microsoftqdk per-shot interpreter25yeseditor intelligence only — no execution

Every framework feeds the same visualization pipeline; the per-framework pages document what each adapter recognizes, how it simulates, and its sharp edges. Hardware submission rules are provider-specific — see the hardware overview.