Release 0.2 refactor qorc update + some high level modifs#50
Release 0.2 refactor qorc update + some high level modifs#50v-espitalier wants to merge 10 commits intomerlinquantum:release-0.2-refactorfrom
Conversation
… the user within the cli help.
| "seed" : 42, | ||
| "n_photons" : 3, | ||
| "n_modes" : 20, | ||
| "run_seed" : 42, |
There was a problem hiding this comment.
let us keep a ticket to remember to fix that more generally
There was a problem hiding this comment.
Pull request overview
This pull request updates the QORC paper reproduction code to support MerLin v0.2, including API changes, bug fixes, and improvements to the development workflow. The changes include updating the MerLin API calls to use the new measurement_strategy parameter instead of output_mapping_strategy, fixing the remote processor interface, reorganizing dataset utility functions, and standardizing the seed parameter naming from seed to run_seed.
Changes:
- Updated MerLin API to v0.2 with new measurement strategy and parameter requirements (including Pi factor multiplication)
- Fixed remote processor API call (renamed
max_batch_sizetomicrobatch_size) - Moved dataset utility functions from shared to local module
- Renamed
seedparameter torun_seedthroughout configuration files and runner code - Added library version logging for Python, Perceval, and MerLin
- Improved CLI usability by moving
--configflag to end of help output - Translated French comments to English in remote processor module
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| runtime_lib/runtime.py | Adds version logging for Python, Perceval, and MerLin libraries |
| runtime_lib/global_cli.json | Moves --config argument to end for better visibility in CLI help |
| papers/shared/QORC/datasets.py | Removes dataset utility functions (moved to local module), reorganizes imports |
| papers/QORC/requirements.txt | Adds minimum version constraint for merlinquantum (>=0.2.0) |
| papers/QORC/lib/runner.py | Renames seed to run_seed, fixes loop variable naming, adds new parameters for dataset and QPU device |
| papers/QORC/lib/lib_rff_encoding_and_linear_training.py | Adds accuracy logging statements |
| papers/QORC/lib/lib_remote_qorc.py | Translates French comments to English, updates API call from max_batch_size to microbatch_size |
| papers/QORC/lib/lib_qorc_encoding_and_linear_training.py | Updates MerLin API to v0.2 (removes output_size, replaces output_mapping_strategy with measurement_strategy), adds Pi factor multiplication for input tensors |
| papers/QORC/lib/lib_datasets.py | Moves dataset utility functions from shared module to local implementation |
| papers/QORC/configs/xp_rff.json | Renames seed to run_seed |
| papers/QORC/configs/xp_qorc.json | Renames seed to run_seed |
| papers/QORC/configs/defaults.json | Renames seed to run_seed, updates default values for n_photons and n_modes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| device_name = "cpu" | ||
| input_size = ( | ||
| n_modes - 1 | ||
| ) # Nb input features = 11 pour ascella (le premier mode n'a pas de PS) |
There was a problem hiding this comment.
This comment contains French text that should be translated to English for consistency with the rest of the codebase. The comment should read: "Nb input features = 11 for ascella (the first mode doesn't have a PS)"
| ) # Nb input features = 11 pour ascella (le premier mode n'a pas de PS) | |
| ) # Nb input features = 11 for ascella (the first mode doesn't have a PS) |
| "n_photons" : 3, | ||
| "n_modes" : 20, |
There was a problem hiding this comment.
The default values for n_photons and n_modes have been changed (n_photons from 2 to 3, n_modes from 10 to 20). While this might be intentional for the v0.2 update, please verify these are the intended default values, as they will affect the behavior of experiments that don't explicitly specify these parameters.
|
is the code working on the cloud through MerlinProcessor? |
It was recently tested for sim:ascella, so should be good for qpu:ascella too. |
…um/reproduced_papers into release-0.2-refactor_qorc_update
ben9871
left a comment
There was a problem hiding this comment.
the notebook also does not run without adding a cell such as this since the repo notebook is below runtime lib and implementations.
I think it should run easily for the user if they installed the requirements so I'd recommend making sure the path is correct or having some stuff directly in the notebook
"import sys
from pathlib import Path
p = Path.cwd().resolve()
Walk up until we find a directory that contains runtime_lib/
for parent in [p] + list(p.parents):
if (parent / "runtime_lib").is_dir():
sys.path.insert(0, str(parent))
break
else:
raise RuntimeError("Could not find a parent directory containing 'runtime_lib/'")
print("Using workspace root:", parent)
print("runtime_lib found at:", (parent / "runtime_lib").resolve())"
There was a problem hiding this comment.
the configs are currently running multiple versions of the same model in order to make the comparison. While this is economical, the rule is to have 1 config PER run. The figures from the paper are then to be reproduced using .sh files that recombine these
There was a problem hiding this comment.
same here. one config per run
To be investigated. will comment further on this |
Reproduced papers / Qorc update :
High level modifs :