Welcome to qujax’s documentation!

qujax is a JAX-based Python library for the classical simulation of quantum circuits. It is designed to be simple, fast and flexible.

It follows a functional programming design by translating circuits into pure functions. This allows qujax to seamlessly and directly interface with JAX, enabling direct access to its powerful automatic differentiation tools, just-in-time compiler, vectorization capabilities, GPU/TPU integration and growing ecosystem of packages.

If you are new to the library, we recommend that you head to the Getting started section of the documentation. More advanced use-cases, including the training of parameterised quantum circuits, can be found in Examples.

The source code can be found on GitHub. The pytket-qujax extension can be used to translate a tket circuit directly into qujax.

Important note: qujax circuit parameters are expressed in units of \(\pi\) (e.g. in the range \([0,2]\) as opposed to \([0, 2\pi]\)).

Install

qujax is hosted on PyPI and can be installed with

pip install qujax

Cite

If you have used qujax in your code or research, we kindly ask that you cite it. You can use the following BibTeX entry for this:

@article{qujax2023,
  author = {Duffield, Samuel and Matos, Gabriel and Johannsen, Melf},
  doi = {10.21105/joss.05504},
  journal = {Journal of Open Source Software},
  month = sep,
  number = {89},
  pages = {5504},
  title = {{qujax: Simulating quantum circuits with JAX}},
  url = {https://joss.theoj.org/papers/10.21105/joss.05504},
  volume = {8},
  year = {2023}
}

Contents