Interface defining a pluggable quantum language compiler/adapter:
id: Unique language identifier ("silq","openqasm3","qsharp","quil","openqasm2").name: User-facing display title.extensions: Associated file extension list ([".silq"],[".qasm", ".qasm3"],[".qs"],[".quil"],[".qasm", ".qasm2"]).monacoLanguageId: Monaco editor language syntax ID.capabilities: Supported quantum feature flags (gates,measurement,reset,controlledGates,multiQubitGates).examplePrograms: Canonical runnable code examples for the language.compile(source): Compiles quantum source intoCompilationResult(containingtokens,ast,semantic,ir,qasm,circuit,diagnostics).diagnostics(source): Returns line/column-targetedDiagnostic[]markers.format?(source): Optional formatter.
Central registry for quantum language adapters:
register(adapter): Registers an adapter, preventing duplicates.get(id): Retrieves an adapter by language ID.list(): Lists all registered quantum language adapters.detectByExtension(path): Detects language from filename or file extension.detectByContent(source): Detects language by inspecting headers or grammar keywords.detect(path?, source?): Resolves the appropriate language adapter with Silq fallback.
parse(source), compile(source), diagnostics(source), and generateCircuit(source) form the compiler boundary. SilqCompiler composes the lexer, parser, semantic analyzer, IR, OpenQASM, and circuit stages.
compile(source, languageId?), run(source, shots, languageId?), runIR(ir, shots), measure(qubit), and stop() abstract simulators. StateVectorSimulator executes exact state-vector simulation over 1–12 qubits for all registered quantum languages.
Provides step-by-step historic state inspection and breakpoint management over QuantumIR operations produced by any quantum language adapter.
complete({ prompt, context }) returns a provider response. Provider implementations must obtain secrets from process environment at the trusted backend boundary.
Adapters identify their vendor as IBM Quantum, Google Quantum AI, IonQ, Quantinuum, or Rigetti. The interface specifies execution, status, and cancellation only; no provider credentials or transport details are coupled to the IDE.
Extensions receive commands, languages, themes, snippets, and panels registries during activate(api).