Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<li><a href="/qutip-tutorials/">Tutorials</a></li>
<li><a href="/qutip-benchmark/">Benchmarks</a></li>
<li><a href="/qutip-virtual-lab.html">QuTiP Virtual Lab</a></li>
<li><a href="/try-qutip.html">Try QuTiP</a></li>
<li><a href="/features.html">Features</a></li>
<li><a href="/citing.html">Citing</a></li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ <h2>Quantum Toolbox in Python</h2>
<li><a href="/qutip-tutorials/">Tutorials</a></li>
<li><a href="/qutip-benchmark/">Benchmarks</a></li>
<li><a href="/qutip-virtual-lab.html">QuTiP Virtual Lab</a></li>
<li><a href="/try-qutip.html">Try QuTiP</a></li>
<li><a href="/features.html">Features</a></li>
<li><a href="/citing.html">Citing</a></li>
</ul>
Expand Down
116 changes: 116 additions & 0 deletions try-qutip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
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:

<a class="btn btn-primary" href="/try-qutip/" role="button">Try QuTiP</a>

The button opens a JupyterLite notebook server with the qutip package
preinstalled. It runs entirely in your browser and includes copies of the
<a href="/qutip-tutorials/">QuTiP tutorials</a> 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.

<div class="alert alert-warning" role="alert">
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.
</div>

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 <em>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.</em>
- Notebooks are slow to start, but performance is not too bad after that.

Specific known issues are listed in [try-qutip's GitHub issues](https://github.com/qutip/try-qutip/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](https://github.com/qutip/try-qutip/).

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](https://github.com/qutip/try-qutip/).

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](/qutip-tutorials/).

If you have general questions about how to use QuTiP, email the
[QuTiP mailing list](https://groups.google.com/group/qutip).


## How the try-qutip site is built

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

[JupyterLite](https://github.com/jupyterlite/jupyterlite) is a
version of [JupyterLab](https://github.com/jupyterlab/jupyterlab)
that has been modified work run in the browser as a
[Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API).
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)](https://webassembly.org/) and for
that one needs a suitable compiler, in this case,
[Emscripten](https://emscripten.org).

Lastly, we need to compile QuTiP itself. The amazing team at
[QuantStack](https://quantstack.net/) are building
[emscripten-forge](https://beta.mamba.pm/channels/emscripten-forge/packages/?tab=packages)
which is like [conda-forge](https://conda-forge.org/) but for building packages
for WebAssembly.

With the help of Wolf and Martin from QuantStack, we created a
[QuTiP package on emscripten-forge](https://beta.mamba.pm/channels/emscripten-forge/packages/qutip).
The recipe for building the package can be found in the
[emscripten-forge/recipes](https://github.com/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.