Qrisp: A Framework for Compilable High-Level Programming of Gate-Based Quantum Computers
Raphael Seidel, Sebastian Bock, René Zander, Matic Petrič, Niklas Steinmann, Nikolay Tcholtchev, Manfred Hauswirth
TL;DR
Qrisp tackles the lack of high-level quantum programming abstractions by introducing a Python-based eDSL centered on QuantumVariables and automated uncomputation, enabling compilation to circuit-level backends. It offers a suite of abstractions—QuantumSession, QuantumArray, QuantumDictionary, and QuantumEnvironments—that let developers encode algorithms at a high level while the compiler exploits structure for resource savings, including MCX-based optimizations. The framework demonstrates practical gains with examples like Shor’s algorithm, showing reduced qubit counts and gate-depth through context-informed compilation and automated qubit management. This work suggests a scalable path for pragmatic quantum software engineering, bridging programming paradigms and hardware constraints, and provides open-source tooling to accelerate adoption and experimentation.
Abstract
While significant progress has been made on the hardware side of quantum computing, support for high-level quantum programming abstractions remains underdeveloped compared to classical programming languages. In this article, we introduce Qrisp, a framework designed to bridge several gaps between high-level programming paradigms in state-of-the-art software engineering and the physical reality of today's quantum hardware. The framework aims to provide a systematic approach to quantum algorithm development such that they can be effortlessly implemented, maintained and improved. We propose a number of programming abstractions that are inspired by classical paradigms, yet consistently focus on the particular needs of a quantum developer. Unlike many other high-level language approaches, Qrisp's standout feature is its ability to compile programs to the circuit level, making them executable on most existing physical backends. The introduced abstractions enable the Qrisp compiler to leverage algorithm structure for increased compilation efficiency. Finally, we present a set of code examples, including an implementation of Shor's factoring algorithm. For the latter, the resulting circuit shows significantly reduced quantum resource requirements, strongly supporting the claim that systematic quantum algorithm development can give quantitative benefits.
