Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DetectorDatabase is now implemented with a translation-invariant key system #376

Merged
merged 8 commits into from
Oct 22, 2024

Conversation

nelimee
Copy link
Contributor

@nelimee nelimee commented Oct 18, 2024

This PR fixes #374 and refactor a little bit DetectorDatabase and its accompanying key data-structure _DetectorDatabaseKey to:

  1. be translation free, meaning that now equivalent pairs of subtemplates/plaquettes are mapped to the same database entry.
  2. use a simpler hashing method that is fully contained in the database.py (and not spread in the different data-structures used) and only require that Plaquette.name is a valid way of comparing/hashing plaquettes (i.e., the following assertion should hold: "two plaquettes have the same name iff they are equal").

@nelimee nelimee added enhancement New feature or request, may not be in the task flow backend Issue pertaining to the Python backend (tqec package) database For issues pertaining to user data stored on the cloud labels Oct 18, 2024
@nelimee nelimee self-assigned this Oct 18, 2024
Copy link

Code Coverage

Package Line Rate Complexity Health
src.tqec 97% 0
src.tqec.circuit 97% 0
src.tqec.circuit.detectors 94% 0
src.tqec.circuit.detectors.match_utils 90% 0
src.tqec.compile 95% 0
src.tqec.compile.detectors 83% 0
src.tqec.compile.specs 82% 0
src.tqec.compile.specs.library 100% 0
src.tqec.computation 84% 0
src.tqec.computation.block_graph 91% 0
src.tqec.gallery 100% 0
src.tqec.noise_models 94% 0
src.tqec.plaquette 90% 0
src.tqec.plaquette.library 100% 0
src.tqec.simulation 0% 0
src.tqec.simulation.plotting 0% 0
src.tqec.templates 89% 0
Summary 91% (3839 / 4205) 0

@nelimee nelimee merged commit dba1234 into main Oct 22, 2024
6 checks passed
@nelimee nelimee deleted the fix/detector_database_translation_invariant branch October 22, 2024 07:33
Copy link

🪓 PR closed, deleted preview at https://qchackers.github.io/tqec/pull/376/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issue pertaining to the Python backend (tqec package) database For issues pertaining to user data stored on the cloud enhancement New feature or request, may not be in the task flow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DetectorDatabase is not translation invariant
2 participants