Skip to content

Releases: eclipse-qrisp/Qrisp

0.7

16 May 20:25

Choose a tag to compare

Qrisp 0.7

Qrisp 0.7 is here, marking another significant milestone in the evolution of our high-level quantum programming framework. This release continues Qrisp’s mission to make quantum algorithm development more intuitive, efficient, and accessible for researchers and developers alike. While previous updates often focused on a unified theme, Qrisp 0.7 brings a diverse collection of features and improvements, reflecting the rapidly expanding landscape of quantum computing.

With this version, users will find not only innovative new primitives and protocols, but also substantial enhancements to existing workflows and resource management. The integration of advanced compilation techniques, dynamic algorithmic components, and expanded compatibility with the Jasp submodule further solidifies Qrisp’s position as a leading platform for scalable quantum software development. Whether you are exploring cutting-edge quantum algorithms or optimizing large-scale simulations, Qrisp 0.7 delivers the tools and performance to push your projects forward.

Linear Combination Of Unitaries

LCU was initially conceived for improving the precision of Hamiltonian simulations but since then has become a core tool for a diverse field of quantum algorithms including QSP, QSVT, LCHS, and optimization via dynamical simulation. Qrisp 0.7 makes all of the above possible: i.e. LCHS (Linear Combination of Hamiltonian Simulation) utilizing the operators module and our Trotterization for passing the Hamiltonian simulation unitary through the LCU protocol.

The Linear Combination of Unitaries technique relies on a non-unitary feedback loop to add up the unitaries of several user-specified quantum functions. Within the quantum software landscape the importance of LCU has been recognized within some artifacts implementing the "loop body" but to the best of our knowledge no framework implements the means for compiling the whole workflow down to a low-level representation. This changes with Qrisp 0.7.

Using our new LCU primitive it is possible to perform a streamlined and efficient implementation of the workflow using an arbitrary set of user-specified functions.

Dynamic Quantum Switch

The quantum switch is a core component of the LCU protocol and as such is now compatible with Jasp. It is furthermore now possible to specify case functions dynamically, ensuring the scalability of every component involved. Finally an additional compilation technique based on a binary tree has been implemented to ensure state of the art compilation performance.

Dynamic QAOA/VQE and gradient free dynamic optimization

QAOA and VQE are among the most popular hybrid algorithms. The established way of running these is to set up a feedback loop that alternates between a quantum computer and a Python instance performing the classical optimization. While suitable for prototypical implementations, this architecture brings a considerable overhead because (a) entering and running the Python interpreter is slow and (b) using IP networks for connectivity introduces extra latency. For this reason we made the algorithms compatible with Jasp, implying the whole workflow is now compiled into one big QIR expression. We also added JASP-compatability for the gradient-free COBYLA Optimizer. It will now be the Default Option for the jasp.minimize optimization Routine.

Iterative Quantum Phase Estimation

IQPE is a technique that extends the idea of QPE to the dynamic context. By introducing real-time features the eigenvalues of a unitary $U$ can be estimated to $n$ digits of precision using only a single extra ancilla qubit (instead of $n$).

Resource estimation

Estimating the resources of large scale quantum algorithms has become an important field of research, as it provides concrete indicators, which purposes future quantum computers might be suitable for. A variety of frameworks exists for tackling this problem - in many cases however the framework can either (a) not compile/simulate the full algorithm, which makes it hard to verify correctness or (b) can only estimate the resources at limited scale. With Jasp we can now do both! The count_ops decorator uses the tight embedding into classically established compilation infrastructure to compile a binary program that computes the required resources. This allows us to probe algorithms with billions of gates within only a few seconds! By switching out the decorator to jaspify, we can simulate the exact same code without any changes on a smaller scale.

Other Jaspified features

The following features are now compatible with Jasp:

  • QuantumArray.
  • QubitOperator and FermionicOperator expectation value evaluation.
  • QITE.
  • IQAE.
  • MCX implementation by Khattar et. al based on conditionally free ancillae.

New Tutorials

Next to a major visual revamp of the tutorial page, the following tutorials have been added.

  • The HHL tutorial, explaining how to implement the HHL algorithm using Jasp.
  • JaspQAOA tutorial, explaining how to create your own Jasp implementation of QAOA from scratch.

UI Changes

  • QubitOperator.get_measurement is replaced by QubitOperator.expectation_value and will be removed in a future release of Qrisp.

0.6

06 Feb 10:06

Choose a tag to compare

0.6

Qrisp 0.6

The latest 0.6 Qrisp update is centered around Jasp submodule, which significantly enhances scalability by enabling faster compilation for large quantum circuits and seamless integration of real-time classical computations. Additionally, we've incorporated Quantum Monte Carlo techniques with Iterative Quantum Amplitude Estimation for efficient numerical integration. UI improvements, including in-place bit-shift operators for QuantumFloats, round out this release.

Jasp

Jasp allows you to scale up your Qrisp code to previously unseen problem scales with the folowing features:

  • Jaspr: enables an efficient representation of a wide variety of (hybrid algorithms)
  • quantum_kernel: allows to annotate a subroutine as a quantum kernel resulting in parallelization of quantum routines hosted on several QPUs.
  • qache decorator : allows to mark a function as "reusable". Using the qache decorator not only improves the compilation speed, but also enables the compiler to speed up transformation processes.
  • jrange: performs a loop with a dynamic bound.
  • RUS (Repeat Until Success) decorator: repeats a given subroutine followed by a qubit measurement until the measurement returns the value 1.
  • sample: allows to take samples from a state that is specified by a preparation procedure.
  • jaspify decorator: a fast general pupose simulator that can use state sparsity.
  • qjit decorator: calls the Catalyst pipeline to compile and run the program via the Lightning simulator.
  • boolean_simulation decorator: Leverages the Jax pipeline to compile the program into a series of boolean operations. Restricted to programs that require only X, CX, CCX, etc. gates. This simulator can be extremely powerful for verifying the correctness of large classical subroutines, that are called by another quantum function.
  • terminal_sampling decorator: performs a hybrid simulation and afterwards samples from the resulting quantum state. Used to perform accelerated quantum sampling.
  • Much more

All of the above allows for the following:

Improvement in compilation performance

The fundamental problem that many Python based quantum frameworks face is that the Python interpreter is slow compared to what is possible with compiled languages. As an example, a 35 bit modular in-place multiplication takes already ~20 seconds to compile in Qrisp. Considering typical RSA key sizes contain up to 2000 bits, compiling a circuit addressing practically relevant problem scales therefore seems unlikely.

Note that this issue is not restricted to Qrisp but similar numbers can be observed for Qiskit or any other Python based quantum circuit SDK.

Jasp addresses this problem by capturing the computation using Jax infrastructure and subsequently compiling it to QIR using Catalyst and established LLVM infrastructure. Using this pipeline, Jasp achieves industrial grade compilation performance.

Performing classical real-time computations

Apart from the compilation scaling issues, many frameworks (Qrisp included) suffer from the inability to integrate classical real-time computations.

What is a real-time computation? A classical computation that happens during the quantum computation, while the quantum computer stays in superposition. This computation has to happen much faster than the coherence time, so performing that computation by waiting for the Python interpreter to generate a new circuit is impossible.

Real-time computations are essential for many techniques in error correction, such as syndrom decoding or magic state distillation. On the algorithmic level, real-time computations also become more popular since they are so much cheaper than the quantum equivalent. Examples are Gidney’s adder or repeat until success protocols like HHL.

Real-time computations are deeply ingrained into the Jasp archictecture - anything that can be done with Jax can also be a real-time computation.

Static Analysis of quantum programs

Jasp also allows for static analysis of quantum programs. This field encompasses important techniques like quantum resource estimation or formal verification.

Jasp computations are stored within Jaxpr objects, a fully functional, SSA intermediate representation. This enables a variety of analysis and evaluation techniques, such as boolean simulation, which transforms Jasp programs that contain only boolean logic into executable binaries and thus facilitates highly scalable simulations.

This is particularly important for testing and verifying classical code running in superposition on the quantum device.

Jasp tutorial

More details and an user friendly walkthrough through the added functionalities of the Jasp module are provided in documentation or in the Jasp tutorial.

Integration of Quantum Monte Carlo with Iterative QAE

Numerical integration is now available within Qrisp, which allows for approximating integrals not solvable analytically. Such integrals appear in many different places, from chemistry, through many-body physics, to mathematical finance.

This is done by combining Quantum Monte Carlo techniques with a resource efficient amplitude estimation algorithm, which iteratively applies quantum amplitude amplification to find an estimation for the probability of measuring a good state (more info in IQAE

More details and example of using this approach for integrating the function $f(x)=x^2$ w.r.t. the uniform distribution over the interval $[0,1]$ can be found in the tutorial.

UI Changes

  • QuantumFloats are now bitshifted by the in-place bitshift operators <<= and >>=, which describes the behavior better than the previous out-of-place operators << and >>.
  • The in-place bit-shift Operator is now called "injection operator" and facilitates in-place application of out-of-place functions.
  • The mcx function no longer accepts lists and arbitrary QuantumVariables as target. Target values have to be either Qubit or QuantumBool.

Qrisp 0.5

19 Nov 09:20

Choose a tag to compare

Qrisp 0.5

In this update many things revolve around one of the most original purposes of quantum computing: Simulating quantum mechanical systems.

The Operators module

This module allows you to describe operators that are not necessarily unitary or even hermitian. With these tools at hand you can effectively set up two of quantum's most important algorithms Hamiltonian simulation and the Variational Quantum Eigensolver.

For this purpose, Qrisp provides the following classes:

  • QubitOperator is a class that enables the representation and processing of operators acting on a qubit space: $(\mathbb{C}^2)^{\otimes n}$. QubitOperators can be constructed based on a variety of tensor factors including the Pauli-matrices but also projector, creators and annihilators. For the latter Qrisp features a highly performant algorithm for Hamiltonian simulation proposed by Kornell and Selinger.
  • FermionicOperator provides you with the tools to describe and manipulate fermionic systems. This type of system is of particular importance for applications in chemistry because many computations for molecular dynamics involve the simulation of electrons, which are fermions. FermionicOperators can be constructed effortlessly from PySCF data. PySCF is one of the most popular quantum chemistry Python packages.
  • VQEProblem which allows you to quickly formulate and run the VQE algorithm using Hamiltonians expressed through the two operator classes.

Explore these features in the following examples and tutorials: Simulating the dynamics of the $H_2$ molecule, computing the ground state energy of the Hydrogen molecule, determine the molecular potential energy curve of the Hydrogen molecule, simulate the Ising-modell with a disturbance.

QIRO

The QIRO algorithm introduced by J. Finzgar et. al. in Quantum-Informed Recursive Optimization Algorithms (2023) has been implemented.
The algorithm is based on updating the problem instance based on correlations, that are in turn established with a QAOA protocol. For further info have a look at our tutorial on QIRO!
The central data structure of the QIRO module is the QIROProblem class.

Compiler upgrades

  • A significantly faster algorithm for memory management has been implemented. With this feature, managing circuits with thousands of qubits is no problem.
  • The compiler can now also leverage X-Permeability type commutativity relations. More info here.

Algorithmic primitives

  • A module for the efficient treatment of phase polynomials has been implemented.
  • Quantum switch-case can be used to execute a switch statement in superposition.
  • Implemented a Dicke state preparation algorithm.

Minor features

  • It is now possible for backends to specify their own default shot count.
  • Deprecated the QuantumNetworks module.
  • Operations can now receive complex numbers as parameters.
  • QuantumModulus will now use the user-specified adder for all arithmetic evaluations (previously only in-place multiplication).
  • A tutorial for utilizing the Quantum-Backtracking algorithm for solving Sudokus is now available.

Qrisp 0.4

25 Jan 12:16

Choose a tag to compare

Qrisp 0.4

The latest update of Qrisp is (once again) the biggest (so far)! We integrated a large variety of features, but also worked a lot on the classical performance, making Qrisp algorithms more scalable than ever.

Shor's Algorithm and modular arithmetic

With 0.4 we integrated the infrastructure to facility the implementation and compilation of Shor's algorithm. Most notably:

  • The QuantumModulus quantum type, which allows you to utilize modular arithmetic in your algorithms with a minimal amount of knowledge of the underlying circuits.
  • Furthermore, we implemented the qcla introduced by Wang et al.. The previously mentioned arithmetic can be adapted to use this adder (or any other adder for that matter!).
  • We wrote a tutorial for Shor's algorithm in Qrisp and created a dead simple interface for factoring numbers.
  • Decrypt your neighbors pizza delivery order to make them eat pineapples! 😈

As we found out, implementations of Shor's algorithm that are able to return a QuantumCircuit in a finite amount of time are an extremely rare sight. After some searching, we could find some competitors . Check the release notes for a plot of a benchmark.

This demonstrates how powerful the Qrisp version is compared to other compilers/implementations. The presented values for the are averaged over several choices of $a$ per $N$. T-depth and T-count are computed under the (extremely optimistic) assumption that parametrized phase gates can be executed in unit time and unit cost. Without this assumption the Qrisp implementation brings a speed-up of almost 3 orders of magnitude!

Compiler upgrades

The compile function received two important upgrades:

  • Due to another topological ordering step, this function can now reduce the depth in many cases by a significant portion with minimal classical performance overhead.
  • It is now possible to specify the time each gate takes to optimize the overall run time in a physical execution of the quantum circuit. Read more about this feature here. especially enables compilation for fault tolerant backends, as they are expected to be bottlenecked by T-gates.

This plot highlights how the Qrisp compiler evolved compared to the last version (and it's competitors). It shows the circuit depth (as acquired with QuantumCircuit.depth for the QAOA algorithm applied to a MaxCut problem. We benchmarked the code that is available as tutorial.

Find the plot here

Algorithmic primitives

We added the following algorithmic primitives to the Qrisp repertoire:

  • Amplitude amplification is an algorithm, which allows you to boost the probability of measuring your desired solution.
  • Quantum amplitude estimation gives you an estimate of the amplitude of a certain sub-space without having to perform a possibly exponential amount of measurements.
  • The gidney and jones methods for compiling mcx gates with optimal T-depth in a fault-tolerant setting.
  • The Gidney-adder as documented here.

QUBO optimization

QUBO is short for Quadratic Uncostrained Binary Optimization and a problem type, which captures a large class of optimization problems. QUBO instances can now be solved within the QAOA module.

Simulator

The Qrisp simulator received multiple powerfull performance upgrades such as a much faster sparse matrix multiplication algorithm and better statevector factoring. These upgrades facility the simulation of extremely large circuits (in some cases, we observed >200 qubits)!

Network interface

For remote backend queries, Qrisp now uses the network inteface developed in the SequenC project. This project aims to build a uniform, open-source quantum cloud infrastructure. Note that specific backend vendors like IBMQuantum can still be called via VirtualBackends.

Minor features

  • Implemented &, |, and ^ operators for general QuantumVariables.
  • Classical performance upgrade for Qrisp's internal logic synthesis function, facilitating faster execution of many algorithms.
  • CNOT and T-depth can now be inferred from QuantumCircuits via QuantumCircuit.cnot_depth and QuantumCircuit.t_depth
  • Implemented the QAOAProblem.train_function method to reuse QAOA circuits in higher order algorithms.
  • Implemented the QAOAProblem.compile_circuit method to give direct access to the circuit executed by QAOAProblem.run.
  • == and != for QuantumVariable are now compiled using the ConjugationEnvironment enabling a more efficient custom_control.
  • Wrote the inpl_adder_test function to verify a user specified function is a valid adder.

Bug-fixes

  • Fixed a bug that caused false results in some simulations containing a Y-gate.
  • Fixed a bug that prevented proper QFT cancelation within the QuantumSession.compile method in some cases.
  • Fixed a bug that prevented proper verification of correct automatic uncomputation in some cases.
  • Fixed a bug that caused false determination of the unitary of controlled gates with a non-trivial control state.
  • Fixed a bug that caused problems during circuit visualisation on some platforms.
  • Fixed a bug that caused the simulation progressbar to not vanish after the simulation concluded.
  • Fixed a bug that introduced an extra phase in the compilation of dirty-ancillae supported balauca MCX gates.

Qrisp 0.3 - QAOA Integration

06 Oct 16:17

Choose a tag to compare

Qrisp 0.3

We’re excited to present our latest update, packed with a variety of innovative features that will optimize you programming tasks and take them to new heights. Proceed further to explore the innovative enhancements in the latest update of our Qrisp framework!

Quantum Approximate Optimization Algorithm (QAOA) module

QAOA is the predominant quantum algorithm for combinatoric optimization. Within the past months, we developed a module that smoothly integrates many aspects of this algorithm into Qrisp. Together with the established infrastructure, this module enables you to formulate problems independent of the information encoding. As established for Qrisp, algorithmic elements of QAOA can be supplied as Python functions instead of QuantumCircuits, enabling a high degree of code modularity and maintanbility.

The following is new in Qrisp 0.3 with regard to QAOA

  • The QAOAProblem class, which facilitates convenient problem formulation and evaluation.
  • The QAOABenchmark class, which allows you to investigate the performance of your implementations.
  • Various tutorials QAOA101 that cover a lot of content. From the very basics to scientific novelties.
  • 7 different presolved problems from combinatoric optimization.
  • Qiskit runtime services can now be used as a Qrisp backend.

Upgraded Backtracking

Due to a new encoding we could improve the performance of the backtracking module by 300%! The plot below shows the circuit depth for trivial reject and accept functions.

Furthermore the backtracking implementation now has to call the reject function only once per quantum step (previously twice).

Documentation

Powered by the Thebe framework, the Qrisp documentation is now fully interactive. Furthermore we made some stylistic improvements.

Framework interfacing

Qrisp QuantumCircuit can now be export to Pennylane and PyTket.

Minor Features

  • Arithmetic module uses the ConjugationEnvironment.
  • Improved the simulator speed for circuits with many measurements. For many QAOA related tasks, we achieved a x2 speed-up.
  • Implemented precompiled_qc keyword argument for get_measurement methods of QuantumVariable and QuantumArray.
  • Implemented not equal method for general QuantumVariables and increased performance for both: eq and neq.
  • Implemented :meth:custom_control <qrisp.custom_control> decorator.
  • Implemented the Saeedi shifting method <https://arxiv.org/abs/1304.7516>_ for the cyclic_shift function.
  • Improved the substitution speed of large expressions of abstract parameters.

Bug fixes

  • Fixed abstract parameters not being treated properly in session merging.
  • Fixed an error in the decoder of QuantumArray that prevented proper display of bitstring quantum types.
  • Fixed an issue that prevented the progressbar of the statevector simulator from being properly removed if the simulation is trivial.
  • Fixed an error that in some cases caused faulty results for symbolic statevector simulation.
  • Fixed proper error message display for exceptions in :ref:IterationEnvironment.
  • Fixed a bug that caused wrong results for the backtracking algorithm if the reject function did not return equivalent results on non-algorithmic states.
  • Fixed permeability specification for logic synthesis functions.
  • Fixed QuantumDictionary loading for pprm synthesis.