Reproduction of Better than classical? The subtle art of benchmarking quantum machine learning models with free-fermionic models.
With uv installed, run the following commands to install the dependencies:
uv venv .venv
uv sync --devWith python and pip installed, run the following commands to install the dependencies:
python -m venv .venv
source .venv/bin/activate
pip install uv
python -m uv sync --devWith poetry installed, run the following commands to install the dependencies:
python -m venv .venv
source .venv/bin/activate
poetry installTo run a single training, you can run the following command:
python -m <package_name> <your_parameters>and to know the parameters you can use the help command:
python -m <package_name> --helpYou will need to install Docker to run the trainings in a container. You can install Docker by following the instructions here.
To build the docker image of the project you can run the following command:
docker build -t <package_name>:latest .The container can be run in two different modes:
- release: This mode is responsible for running the main.py of the current package.
- it: This is a development mode that is responsible for running the container in the interactive mode.
To run a mode <mode> you can run the following command:
docker run --name <package_name>-<phase> --detach --rm --volume=<data_path>:/<ROOT_DIR>/data -e "MODE=<mode>" <package_name>:latest <your_arguments>where <data_path> is the absolute path in your local machine where you want to store the data generated by the phase.
The <ROOT_DIR> is the root directory of the project.
There is another way you can do all of this. You can use the docker_files/build_image_and_run.py script. This script
will build the image and run the mode you want. You can run the script with the following command:
python docker_files/build_image_and_run.py --mode=<mode>This project uses Snakemake with the SLURM executor plugin to manage job submission on HPC clusters (Alliance Canada / Compute Canada).
- Apptainer (Singularity) module available on the cluster (
module load apptainer/1.4.5) - Project
.sifimage placed underdata/dockerfiles/(see the Deployment section) - Snakemake ≥ 8 and the SLURM executor plugin:
uv add --dev snakemake snakemake-executor-plugin-slurmThe experiment configuration is at data/configs/config_20splits.yaml.
Make sure this file is present on the cluster (it is tracked in the repository,
so a git pull is sufficient).
Preview all jobs that Snakemake would submit without running anything:
uv run python -m snakemake --snakefile workflow/Snakefile --cores 1 -nFrom the login node, launch the full experiment using the bundled SLURM profile:
uv run python -m snakemake --snakefile workflow/Snakefile \
--profile workflow/profiles/slurmSnakemake submits one independent SLURM job per unfinished experiment config.
Jobs whose state.finished file already exists are automatically skipped —
re-running the command safely resumes where it left off.
Common flags:
| Flag | Effect |
|---|---|
-n |
Dry-run: print the job DAG without submitting |
--forceall |
Re-run all jobs, even finished ones |
--rerun-incomplete |
Retry jobs that started but did not finish |
--jobs N |
Override the cap on concurrent SLURM submissions |
squeue -u $USER
squeue -u $USER -h -r -O state | uniq -c # counts by statePer-job logs are written to data/{experiment_name}/logs/snakemake/{hash}.log.
| File | Purpose |
|---|---|
workflow/config.yaml |
Active experiment name, config path, SIF version |
workflow/profiles/slurm/config.yaml |
Default SLURM account, memory, time limit |
workflow/Snakefile |
Rule definitions; add per-rule resources: blocks to override defaults |
To switch to a different experiment, update config_file in workflow/config.yaml
to point to the new config.
The author acknowledges the use of AI-assisted tools during the implementation of this project to assist debugging and improve the quality of the code. AI tools were also used to generate the unit tests. The author has reviewed, edited, and validated all AI-assisted content and assumes full responsibility for the final version of the code.