Skip to content

Commit 2046773

Browse files
committed
Convert try-qutip page to Markdown.
1 parent 837e4f0 commit 2046773

File tree

2 files changed

+95
-137
lines changed

2 files changed

+95
-137
lines changed

try-qutip.html

Lines changed: 0 additions & 137 deletions
This file was deleted.

try-qutip.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Trying QuTiP in the Browser
3+
---
4+
5+
# Trying QuTiP in the Browser
6+
7+
QuTiP is now available in the browser!
8+
9+
You can open it by clicking on the button below:
10+
11+
<a class="btn btn-primary" href="/try-qutip/" role="button">Try QuTiP</a>
12+
13+
The button opens a JupyterLite notebook server with the qutip package
14+
preinstalled. It runs entirely in your browser and includes copies of the
15+
<a href="/qutip-tutorials/">QuTiP tutorials</a> for you to explore. There is
16+
no server.
17+
18+
Once JupterLite loads, you'll find the tutorials in the file browser on
19+
the left. If you click on a tutorial notebook, you'll need to select the
20+
XPython kernel (there is only one option) and then the notebook will open.
21+
The first imports will be slightly slow, but after that the performance
22+
should be similar to that of running QuTiP locally.
23+
24+
Running QuTiP this way relies on a complex set of underlying layers of
25+
software that are still maturing. You can read about some of the minor
26+
caveats and a description of how it was built below.
27+
28+
Contents:
29+
30+
- Caveats
31+
- Contributing
32+
- How the try-qutip site is built
33+
34+
35+
## Caveats
36+
37+
Most QuTiP features already work. These are the known limitations:
38+
39+
- A recent version of Firefox or Chrome is required.</li>
40+
- QobjEvo objects cannot currently be usefully compiled.</li>
41+
- Cython is not yet availabe.</li>
42+
- You can save notebooks but, they are <em>stored in your web browser's
43+
internal storage and might be lost if, for example, the browser cache
44+
is cleared. If you do create notebooks you'd like to keep, please
45+
use the download button to save them.</em>
46+
- Notebooks are slow to start, but performance is not too bad after that.
47+
- Having to select the XPython kernel all the time is not ideal.
48+
49+
50+
## Contributing
51+
52+
If you encounter bugs with QuTiP in the browser that aren't listed in the
53+
caveats above, you are welcome to open issues in the
54+
[try-qutip GitHub repository](https://github.com/qutip/try-qutip/).
55+
56+
If you know a way to address any of the caveats above, please let us
57+
know by open an issue or pull request in the
58+
[try-qutip GitHub repository](https://github.com/qutip/try-qutip/).
59+
60+
If you find bugs in a specific tutorial, or would like to add a new tutorial
61+
or improve an existing one, please see the contributing section at the bottom
62+
of the [tutorials page](/qutip-tutorials/).
63+
64+
If you have general questions about how to use QuTiP, email the
65+
[QuTiP mailing list](https://groups.google.com/group/qutip).
66+
67+
68+
## How the try-qutip site is built
69+
70+
The try-qutip site contains JupyterLite with QuTiP pre-installed.
71+
72+
[JupyterLite](https://github.com/jupyterlite/jupyterlite) is a
73+
version of [JupyterLab](https://github.com/jupyterlab/jupyterlab)
74+
that has been modified work run in the browser as a
75+
[Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API).
76+
A service worker acts like a web server that runs inside your browser and in this
77+
case plays the role of the Jupyter server that would otherwise need to be run locally.
78+
79+
Running this Jupyter server in the browser means running Python and packages
80+
such as numpy, SciPy and matplotlib in the browser too. To do that, all
81+
of these packages need to be recompiled to
82+
[WebAssembly (aka WASM)](https://webassembly.org/) and for
83+
that one needs a suitable compiler, in this case,
84+
[Emscripten](https://emscripten.org).
85+
86+
Lastly, we need to compile QuTiP itself. The amazing team at
87+
[QuantStac](https://quantstack.net/) are building
88+
[emscripten-forge](https://beta.mamba.pm/channels/emscripten-forge/packages/?tab=packages)
89+
which is like [conda-forge](https://conda-forge.org/) but for building packages for
90+
WebAssembly.
91+
92+
With the help of Wolf and Martin from QuantStack, we created a
93+
[QuTiP package on emscripten-forge](https://beta.mamba.pm/channels/emscripten-forge/packages/qutip).
94+
The recipe for building the package can be found in the
95+
[emscripten-forge/recipes](https://github.com/emscripten-forge/recipes) repository.

0 commit comments

Comments
 (0)