During July 2024, Nick Cookson set out to build a quantum programming language. Not a wrapper around an existing SDK. Not a domain-specific library. A real language - with its own syntax, its own compiler, and its own vision for what quantum programming should feel like. This is the story of how QuBitLang came to exist, and how it became the foundation for TrueEntropy.
The Starting Point
Nick had been watching the quantum computing landscape evolve for years. IBM was making real quantum hardware accessible through the cloud. Google had demonstrated quantum supremacy. Startups were racing to build quantum applications. But there was a gap: the tools for writing quantum programs were either too academic or too low-level for practical use.
Qiskit, IBM's quantum SDK, is powerful - but it's a Python library, not a language. Writing a quantum circuit in Qiskit means constructing Python objects, calling methods on quantum registers, and managing classical control flow through Python's own syntax. For a simple circuit, the boilerplate overwhelms the quantum logic. For a complex circuit, the Python layer obscures the quantum structure.
Nick's insight was that quantum programming deserved its own language - one where the syntax reflected the physics, where qubits and gates were first-class citizens, and where the compiler could reason about quantum operations at a level that a general-purpose language couldn't.
Pushing the Boundaries of AI
Building a compiler is one of the most demanding tasks in software engineering. It requires deep knowledge of language theory, type systems, code generation, and optimisation. Nick approached this challenge as an exercise in pushing the boundaries of what AI-assisted development could achieve.
The QuBitLang compiler was built through an intensive collaboration between human design intent and AI implementation capability. Nick defined the language's vision - what it should look like, how it should behave, what guarantees it should provide - and worked with AI tools to implement the full compiler pipeline from lexer to code generator.
The result was not a toy. The QuBitLang compiler is a production system comprising 18+ source files: a lexer with complete token definitions, a recursive-descent parser that builds a rich abstract syntax tree, a semantic analyser with type checking and qubit lifecycle validation, an intermediate representation builder, a circuit optimiser, a Qiskit code generator, and a built-in StateVector simulator.
This was, and remains, one of the most ambitious applications of AI-assisted software engineering: a complete programming language compiler, built from scratch, powering a commercial quantum entropy service.
Designing the Language
QuBitLang's syntax was designed around three principles:
1. Quantum operations should be obvious.
Keywords for quantum operations are uppercase: QUBIT, MEASURE, DEFINE. Gate applications look like function calls: H(q0), CNOT(q0, q1), RZ(q0, 0.785). You can read a QuBitLang circuit and understand the quantum structure at a glance.
2. The compiler should catch errors before execution.
Quantum hardware time is expensive. A circuit that fails on the QPU wastes minutes of queue time and real money. QuBitLang's semantic analyser catches errors at compile time: double-measurement of a qubit, operations on undeclared qubits, type mismatches between quantum and classical values, and scope violations. If your circuit compiles, it's structurally valid.
3. Hardware should be invisible.
QuBitLang circuits describe quantum logic, not hardware specifics. The compiler's IR (intermediate representation) is hardware-agnostic - a sequence of abstract gate operations. The code generator translates this IR to Qiskit circuits, which are then transpiled to native gates for the target QPU. If tomorrow we add support for Quantinuum, the same QuBitLang source runs without modification.
The Compiler Takes Shape
The compiler grew organically through a series of milestones:
The Lexer came first - breaking source text into tokens. QuBitLang has a relatively small keyword set (QUBIT, MEASURE, DEFINE, FOR EACH, IF, RETURN) but a rich set of operators and gate names. The token definitions live in tokens.py, and the lexer in lexer.py handles comments, string literals, numeric constants, and the arrow operator (->) used in MEASURE statements.
The Parser was the first real challenge - building a recursive-descent parser that could handle qubit declarations, gate applications with variable numbers of arguments (single-qubit gates, two-qubit gates, parametric rotations), measurement with classical target assignment, function definitions, loops, and conditionals. The AST node hierarchy in ast_nodes.py captures all of these constructs.
The Semantic Analyser added the safety layer. It traverses the AST and enforces rules that the parser can't: every qubit must be declared before use, no qubit can be measured twice, function calls must match their definitions, and types must be compatible. The symbol table (symbol_table.py) tracks scope, and the type system (type_system.py) distinguishes quantum and classical values.
The IR Builder transformed the validated AST into a flat sequence of quantum operations - the intermediate representation defined in quantum_ir.py. This is the abstraction boundary between the language and the backend. Everything above the IR is language-specific; everything below is backend-specific.
The Optimiser operates on the IR, applying passes like gate cancellation (adjacent inverse gates cancel out) and rotation merging. These reduce circuit depth, which directly improves execution fidelity on noisy quantum hardware.
The Simulator was built for development and testing. A full StateVector simulator that executes QuBitLang circuits locally without quantum hardware. For algorithms like QRNG, where the output is inherently random regardless of the execution platform, the simulator produces statistically equivalent results.
From Language to Product
QuBitLang existed as a standalone language project before TrueEntropy was conceived. The transition happened when Nick realised that the most immediate, commercially viable application of a quantum programming language was quantum random number generation.
The logic was straightforward: QRNG circuits are simple (Hadamard + measurement), the output is immediately useful, the market is real (gambling, cryptography, clinical research), and the quality is verifiable (NIST statistical tests). QuBitLang was the perfect tool for the job - a language that could define QRNG circuits cleanly, compile them efficiently, and execute them on real quantum hardware.
TrueEntropy was born as the product layer on top of QuBitLang. The generate.py runner reads a .ql circuit file, compiles it through the full QuBitLang pipeline, submits the resulting Qiskit circuit to IBM Quantum, extracts measurement bitstrings, verifies them with NIST tests, and feeds them into the entropy pool. Every random number TrueEntropy delivers has been through this pipeline.
Built in Blackpool
QuBitLang and TrueEntropy are built by Interlink Digital Group, headquartered at Lancaster House in Blackpool, UK. Nick Cookson is the CEO and founder - the person who conceived QuBitLang, drove its development, and built the company around it.
The story of QuBitLang is a story about ambition: the ambition to build a real language, not just a library; to target real quantum hardware, not just simulators; to serve real customers, not just researchers. It's also a story about what's possible when human vision and AI capability work together on a hard problem.
QuBitLang started as a question: what would quantum programming look like if it were designed for humans? Two years later, it powers a commercial quantum entropy service. And we're just getting started.