Prepared by Daniel Justice · Carnegie Mellon University · 17-620 Quantum Machine Learning · Fall 2026
© 2026 Daniel Justice for original contributions; third-party materials retain their respective rights. Use and reuse are subject to applicable university policies.
Student-facing quantum machine learning exercises, maintained by The Quantum Turtle.
Lab 2 release checklist: The course environment and student notebook syntax have passed GitHub Actions. Students need read access to this repository (or a copy supplied in Canvas). The student repository is public. The published GHCR image has not yet been verified, so use the build-from-source instructions below.
Install Docker Desktop (Mac or Windows) or Docker Engine with the Compose plugin (Linux). Start Docker and verify the following commands succeed in a terminal:
docker --version
docker compose versionYou also need Git to clone the repository, or you can select Code → Download ZIP on its GitHub page if you have access.
If you can access the GitHub repository, use:
git clone https://github.com/thequantumturtle/quantum-machine-learning.git
cd quantum-machine-learningAlready cloned it? From inside the directory, run git pull instead. Save any unfinished notebook edits first. If you downloaded the repository as a ZIP, extract it, then open a terminal in that folder.
From the repository root (where compose.yaml lives):
docker compose up --buildThe first run downloads a Python base image and installs the course dependencies. It can take longer than later runs. Wait for the terminal to display a local JupyterLab URL containing a token, for example http://127.0.0.1:8888/lab?token=....
Open the tokenized URL printed by your own terminal, not the example URL above. In JupyterLab, open:
labs/lab-02-quantum-encoding/lab.ipynb
Run the imports cell, then work through Lab 2 in notebook order. A completed reference may be released separately through the course Canvas site after class. The repository is mounted into the container, so notebook edits are saved to your local course directory. Lab 2 is ungraded practice. You do not need to submit this notebook or upload anything to Canvas. Save your progress if you wish; quizzes and homework have separate graded submissions.
To stop JupyterLab, press Ctrl+C in the terminal. You can start it again with docker compose up (or docker compose up --build after changing dependencies).
- Cannot open the GitHub repository / 404: Verify the URL is
https://github.com/thequantumturtle/quantum-machine-learning. This student repository is public; if access still fails, ask the instructor for a Canvas copy. - Cannot connect to the Docker daemon: Start Docker Desktop and wait for it to report that the engine is running.
- Port 8888 already in use: Stop another Jupyter/Docker session. Alternatively, change the host-side port in
compose.yamlfrom127.0.0.1:8888:8888to127.0.0.1:8889:8888, then restart and use the URL with port 8889. - ModuleNotFoundError: Make sure you opened JupyterLab from this Docker container and selected its Python 3 kernel, rather than a local Python installation.
- Missing or broken widget: Run the notebook in order, check the imports cell, and restart the kernel if you previously ran an outdated cell.
- Docker rebuild is slow: The first build installs PennyLane and JupyterLab; subsequent launches normally reuse cached layers.
- Windows: Use Docker Desktop's supported Linux-container backend. Open a terminal where the extracted repository is located.
The student CI workflow builds the core Docker image and checks student notebook syntax. The private instructor workflow separately runs complete Lab 2 and HW1 solutions. Automated verification does not replace a first-day student-access test.
The repository has a GitHub Actions workflow named Publish core image to GHCR. It can publish the multi-platform image ghcr.io/thequantumturtle/qml-core:fall-2026-v1. Until the instructor verifies that the image was published and made accessible to students, do not use the pull-only Compose override. The supported first-day command is docker compose up --build.
Lab 3 is an 80-minute, ungraded guided practice lab that connects the squared overlap/fidelity measurements of Lab 2 to kernel classification. Students examine a small one-qubit feature map, build an exact kernel matrix from simulated statevectors, compare a quantum-fidelity SVM to classical linear/RBF SVMs, and explore feature-map choices and finite-shot uncertainty.
No submission required. It uses the existing Docker environment and needs no quantum hardware account.
After saving local notebook changes and updating your course checkout with git pull, run docker compose up --build from the repository root and open:
If you already have JupyterLab running, refresh its file browser after pulling. This repository contains the student exercise notebook only; completed instructor solutions remain private.
The longer coding assignment extends Lab 2. Its starter is at homework/hw-01-quantum-kernel-classification/hw.ipynb. The instructor will announce when the homework is assigned and its due date; having the starter in the repository does not mean it is already due.
Conceptual inspiration: A Practical Guide to Quantum Machine Learning and Quantum Optimization, Chapter 9, and Fall 2026 course lectures. These notebooks are original course exercises, not reproductions of the textbook.
Never commit: instructor answer keys, private assessments, student work, credentials, or instructor-only material to this student repository.