Skip to content

Latest commit

 

History

History
116 lines (84 loc) · 4.33 KB

try-qutip.md

File metadata and controls

116 lines (84 loc) · 4.33 KB
title
Trying QuTiP in the Browser

Trying QuTiP in the Browser

QuTiP is now available in the browser!

You can open it by clicking on the button below:

Try QuTiP

The button opens a JupyterLite notebook server with the qutip package preinstalled. It runs entirely in your browser and includes copies of the QuTiP tutorials for you to explore. There is no server.

Once JupterLite loads, you'll find the tutorials in the file browser on the left. If you click on a tutorial notebook, you'll need to select the XPython kernel (there is only one option) and then the notebook will open. The first imports will be slightly slow, but after that the performance should be similar to that of running QuTiP locally.

Running QuTiP this way relies on a complex set of underlying layers of software that are still maturing. You can read about some of the caveats and a description of how it was built below.

Contents:

  • What's installed
  • Caveats
  • Contributing
  • How the try-qutip site is built

What's installed

Currently installed packages include:

  • qutip (5.1.1)
  • qutip-qip (0.4.0)
  • qutip-qtrl (0.1.5)
  • numpy (2.2.4)
  • scipy (1.14.1)
  • matplotlib (3.10.1)
  • python (3.13.1)

Caveats

Most QuTiP features already work. These are the known limitations:

  • A recent version of Firefox or Chrome is required.
  • Cython is not yet available so QobjEvo objects cannot currently be usefully compiled.
  • You can save notebooks but, they are stored in your web browser's internal storage and might be lost if, for example, the browser cache is cleared. If you do create notebooks you'd like to keep, please use the download button to save them.
  • Notebooks are slow to start, but performance is not too bad after that.

Specific known issues are listed in try-qutip's GitHub issues. Further issues and bugs may be reported there.

Contributing

If you encounter bugs with QuTiP in the browser that aren't listed in the caveats above, you are welcome to open issues in the try-qutip GitHub repository.

If you know a way to address any of the caveats above, please let us know by open an issue or pull request in the try-qutip GitHub repository.

If you find bugs in a specific tutorial, or would like to add a new tutorial or improve an existing one, please see the contributing section at the bottom of the tutorials page.

If you have general questions about how to use QuTiP, email the QuTiP mailing list.

How the try-qutip site is built

The try-qutip site contains JupyterLite with QuTiP pre-installed.

JupyterLite is a version of JupyterLab that has been modified work run in the browser as a Service Worker. A service worker acts like a web server that runs inside your browser and in this case plays the role of the Jupyter server that would otherwise need to be run locally.

Running this Jupyter server in the browser means running Python and packages such as numpy, SciPy and matplotlib in the browser too. To do that, all of these packages need to be recompiled to WebAssembly (aka WASM) and for that one needs a suitable compiler, in this case, Emscripten.

Lastly, we need to compile QuTiP itself. The amazing team at QuantStack are building emscripten-forge which is like conda-forge but for building packages for WebAssembly.

With the help of Wolf and Martin from QuantStack, we created a QuTiP package on emscripten-forge. The recipe for building the package can be found in the emscripten-forge/recipes repository.

An additional big thank you to Thorsten Beier from QuantStack for fixing numerous small niggles and thus allowing QuTiP 5 to deployed to try-qutip.