Code for the paper Toward Fault-Tolerant Variational Optimization: QAOA under [[4,2,2]] Error Detection presented at Q-WORKS colocated with EuroPar 2026 at Pisa, Italy. A noisy QAOA framework under the [[4,2,2]] error detection code, optimized for large scale execution.
- Install Docker
- Install Nvidia Container Toolkit
- Install Nvidia cuQuantum
- Start the docker container in interactive mode. This also automatically activates a conda env with cirq
sudo docker run --gpus all -v "$(pwd)":/workspace -w /workspace -it --rm nvcr.io/nvidia/cuquantum-appliance:25.11-x86_64cd logical-qaoa/- Run the python script
# If your setup supports NVLink (e.g. NVIDIA GH200)
python -m logical_qaoa.hpc_execution.hpc_execute --nlogical=4 --nshots=10000 --ngpus=4 --split --input circuit.json
# If you need to manually split shots among GPUs (e.g. NVIDIA L40S)
python -m logical_qaoa.hpc_execution.hpc_execute --nlogical=4 --nshots=400 --ngpus=4 --split --no-save --input circuit.json[!note] The
--nlogicalargument corresponds to the number of logical qubits in your circuit. In the sqare max-cut qaoa it is 4.
If results are written to a file they can be found in logical_qaoa/hpc_execution/sim_results/.