Instructions for assignments (english version)
Lab Assignments Instructions — Quantum Programming
The lab assignments (TPs) are provided as Jupyter notebooks. You should read and modify them, then submit your work for grading. Below are several ways to set up an environment in which to run these notebooks.
⚠️ Many of these environments are ephemeral: remember to download your notebook when you finish, or you may lose your work. Save regularly!
1) On the web with Binder
Open the following URL in your browser:
https://mybinder.org/v2/git/https%3A%2F%2Fgogit.univ-orleans.fr%2Flifo%2Fno%2Fqm2/master?urlpath=%2Fnotebooks
2) By cloning the git repository
First clone the git repository:
git clone https://gogit.univ-orleans.fr/lifo/no/qm2
cd qm2
To launch Jupyter with the required libraries, you have several options.
2.1 Using uv
Install the uv package manager (see https://docs.astral.sh/uv/), then start your sessions with:
uv run --with-requirements requirements.txt -- jupyter-notebook
2.2 Using a Python virtual environment
Create and activate a virtual environment, install the dependencies from requirements.txt, then start Jupyter.
For example, with pip:
python3 -m venv qisenv
source qisenv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install --force-reinstall notebook
python3 -m ipykernel install --user --name=qiskitenv
jupyter-nbclassic-extension install rise --py --sys-prefix
jupyter-nbclassic-extension enable rise --py --sys-prefix
jupyter-notebook
2.3 Using Docker with repo2docker
Install the Python package jupyter-repo2docker, then launch the container with:
python3 -m pip install jupyter-repo2docker
python3 -m repo2docker .
2.4 Using Docker directly
The image nopid/qm2 contains everything you need.
docker run --rm -p 8888:8888 nopid/qm2
Open in a browser the URL printed at the end, which looks like:
http://127.0.0.1:8888/?token=MY_LONG_HEX_TOKEN
Submission
- Work directly in the notebooks, save often, and download your
.ipynbbefore closing the session. - Submit the resulting notebook(s) as instructed by your instructor (one file per TP unless told otherwise).
Troubleshooting (FAQ)
1) Binder is “Building…” forever
- Try again later (shared service).
- Use another method (local venv / Docker) if it keeps timing out.
- Check that the repository URL is correct.
2) I don't see the right kernel in Jupyter
- If you created a venv, (re)run:
python3 -m ipykernel install --user --name=qiskitenv
- Restart Jupyter and select the qiskitenv kernel.
3) rise slideshow buttons are missing
- Enable the extension (nbclassic):
jupyter-nbclassic-extension install rise --py --sys-prefix
jupyter-nbclassic-extension enable rise --py --sys-prefix
- Restart Jupyter (or the Docker container).
4) Port 8888 is already in use
- Close any running Jupyter/containers, or use another port:
jupyter-notebook --port 8889
docker run --rm -p 8889:8888 nopid/qm2
5) Can't open the Jupyter URL (the token screen)
- Copy the full URL from the terminal, including the ?token=....
- If remote, ensure SSH/port-forwarding or firewall rules allow access.
6) Very slow pip install / timeouts
- Try a different mirror: pip install -i https://pypi.org/simple -r requirements.txt
- Prefer uv (faster resolver) or use the Docker image.
7) “Permission denied” when installing packages
- Activate your venv (source <venv>/bin/activate).
- Avoid system-wide installs without admin rights; use the venv or Docker.
8) The notebook didn't save / I lost work
- In ephemeral environments (Binder/Docker without volume), always File → Download a copy before closing.
- Locally, confirm you're saving inside your project folder.
9) GPU / special drivers required?
- No GPU is required. The assignements run on CPU (simulators).
10) Qiskit import errors
- Ensure you're in the environment where Qiskit was installed.
- Reinstall from requirements.txt, or run via uv / Docker to get a clean environment.