This repository contains the code used to collect the data shown in the april fools paper 'Falling with Style: Factoring up to 255 "with" a Quantum Computer'.
Install python dependencies:
pip install -r requirements.txt
Run the tests:
PYTHONPATH=src pytest src
Generate a factoring circuit:
PYTHONPATH=src python src/facto/main_generate_qasm.py --n 15 --g 2
Make the plot shown in the paper:
PYTHONPATH=src python src/facto/main_make_plot.py
Recollect the data from the quantum computer (very manual):
- Consider changing the hardcoded random seed (currently
2025_04_01
) used insrc/facto/main_make_plot.py
. - Set the environment variable
QISKIT_TOKEN
to your ibm quantum token. - Delete the contents of the array in
store_collected_shots_from_jobs
insrc/facto/main_make_plot.py
- Modify the main method of
src/facto/main_make_plot.py
; comment the plot call and uncomment the call torun_problems
andsend_jobs_to_ibm
. - Once the jobs finish submitting a few minutes later, add the printed contents to the
ACTIVE_JOBS
array, then remodify main to only have the call tocollect_job_results
uncommented. - Add the printed job results to the array in
store_collected_shots_from_job
, and clearACTIVE_JOBS
. - Goto step 4, unless no jobs were submitted (indicating no more samples requested for any number)
- Remodify main to only call the plot command, run it, and look at your data