QuBitLang v1.4.0

The Quantum Programming Language
Powering TrueEntropy

A proprietary, human-readable abstraction over quantum circuit definition. Write once - execute on any quantum backend. The technology no competitor can replicate.

Proprietary. Portable. Powerful.

QuBitLang is a high-level quantum programming language designed to make quantum circuit definition as natural as writing Python. It abstracts away the complexity of hardware-specific quantum SDKs while preserving full expressive power.

Unlike raw Qiskit or Cirq, QuBitLang code is human-readable, type-safe, and hardware-portable. The same .ql file that runs on IBM Quantum today will run on Quantinuum or Rigetti tomorrow - with zero code changes.

27 Keywords
8 Quantum Gates
7 Type Categories
25 Max Simulated Qubits
hello_quantum.ql QuBitLang
# Your first QuBitLang program # Creates a Bell state - maximum entanglement QUBIT q1 QUBIT q2 # Superposition on first qubit H(q1) # Entangle the pair CNOT(q1, q2) # Collapse - always correlated MEASURE q1 -> c1 MEASURE q2 -> c2

From Source Code to Quantum Hardware

QuBitLang's full compiler pipeline transforms human-readable circuit definitions into optimised Qiskit code executing on IBM's quantum processors.

01

Lexical Analysis

The Lexer (lexer.py) performs single-pass tokenisation of .ql source files. Handles 27 keyword tokens, Unicode support (π), operator precedence markers, and precise source location tracking for error reporting.

02

Parsing

The Parser (parser.py) uses recursive descent with precedence climbing to build an Abstract Syntax Tree. Handles all control flow constructs (IF/THEN/ENDIF, FOR/ENDFOR, WHILE/ENDWHILE, REPEAT/TIMES/ENDREPEAT, FOR EACH/IN/ENDFOR), function definitions, gate applications, and measurement operations.

03

AST Construction

Immutable, frozen-dataclass AST nodes (ast_nodes.py) with full Visitor pattern support. Every node carries source location metadata for precise error reporting. The AST is the canonical representation used by all subsequent compiler phases.

04

Semantic Analysis

The Semantic Analyser (semantic_analyzer.py) performs type checking across 7 type categories (Qubit, QubitRegister, ClassicalBit, Integer, Float, Boolean, String), scope resolution via a hierarchical symbol table, qubit lifecycle validation (preventing double-measurement), and function signature verification.

05

IR Generation

The IR Builder (ir_builder.py) transforms the validated AST into Quantum Intermediate Representation - a hardware-agnostic QuantumCircuit object containing qubit/classical registers and instruction sequences. Performs constant evaluation, loop unrolling, and function inlining during lowering.

06

Optimisation

The Optimiser applies gate cancellation passes, circuit depth reduction, and ML-based optimisation trained on hardware-specific noise profiles. Reduces gate count while preserving circuit semantics.

07

Code Generation & Execution

The Qiskit Code Generator emits optimised Qiskit circuits targeting IBM Quantum's 156-qubit Heron processors via Qiskit Runtime. The StateVector Simulator (simulator.py) provides local simulation for up to 25 qubits during development.

Clean, Readable, Powerful

Compare QuBitLang's human-readable syntax with raw Qiskit. Same circuit, radically different developer experience.

qrng_hadamard.ql QuBitLang
# QuBitLang - clean, readable DEFINE qrng(n) QUBIT q[n] FOR EACH qubit IN q H(qubit) ENDFOR MEASURE q -> result RETURN result ENDDEFINE qrng(127)
qrng_hadamard.py Qiskit
# Raw Qiskit - verbose, framework-locked from qiskit import QuantumCircuit from qiskit_ibm_runtime import Sampler def qrng(n): qc = QuantumCircuit(n, n) for i in range(n): qc.h(i) for i in range(n): qc.measure(i, i) sampler = Sampler() result = sampler.run(qc) return result qrng(127)

Production QRNG Circuits

Three battle-tested circuit designs for different entropy generation strategies.

Hadamard Standard

The workhorse. Applies H gate to every qubit for perfect superposition, then measures. Maximum throughput, maximum simplicity. Production default.

qrng_hadamard_v2.3.ql

Bell Pair Entangled

Creates entangled qubit pairs using H+CNOT. Measures correlated random bits. Useful for protocols requiring provably correlated randomness.

qrng_bell_pair_v1.0.ql

GHZ State

Greenberger-Horne-Zeilinger maximally entangled states. All qubits correlated. Experimental - enables future multi-party random beacon protocols.

qrng_ghz_state_v1.0.ql

Write Once. Run Anywhere.

QuBitLang's hardware-agnostic IR means your circuits aren't locked to a single vendor. Today it's IBM Quantum. Tomorrow, any quantum backend.

Live

IBM Quantum

156-qubit Heron processors. Production-ready via Qiskit Runtime.

Planned

Quantinuum

H-Series trapped-ion processors. Industry-leading quantum volume.

Planned

Rigetti

Superconducting processors. Multi-chip architecture. Hybrid classical-quantum.

QuBitLang in Every Response

Every API response, every SDK object, every certificate carries QuBitLang provenance metadata. You always know exactly which circuit generated your entropy.

API Response Metadata JSON
"metadata": { "qubitlang_version": "1.4.0", "qubitlang_circuit": "qrng_hadamard_v2.3", "circuit_hash": "sha256:a7f2b9c4...", "quantum_backend": "ibm_fez", "nist_verified": true, "powered_by": "QuBitLang" }

Experience QuBitLang-Powered Entropy

Start generating quantum random numbers with the world's most elegant quantum programming language behind every response.

Get Started Free →

Powered by QuBitLang & IBM Quantum