Skip to content

Refactor property keys from string to integer and add estimation improvements#3013

Open
msoeken wants to merge 1 commit intofeature/qrefrom
msoeken/property-keys
Open

Refactor property keys from string to integer and add estimation improvements#3013
msoeken wants to merge 1 commit intofeature/qrefrom
msoeken/property-keys

Conversation

@msoeken
Copy link
Member

@msoeken msoeken commented Mar 12, 2026

This PR replaces string-keyed properties with integer keys defined via a Rust macro, and includes several estimation performance and API improvements.

Property keys

  • New define_properties! macro in isa/property_keys.rs auto-assigns u64 values and generates property_name_to_key
  • Properties on Trace, EstimationResult, and Instruction now use u64 keys instead of String
  • Python property_keys submodule exposes all keys as constants; PropertyKey enum is removed

Estimation improvements

  • LockedISA holds a single read lock for the duration of estimate(), avoiding repeated lock acquisitions
  • ISA cloning is deferred to Pareto-surviving results only, reducing allocation in estimate_parallel
  • EstimationTableStats tracks job counts (total, successful, Pareto-surviving)
  • add_qubit_partition_column() breaks down physical qubits into compute, factory, and memory

Model updates

  • SurfaceCode: configurable one_qubit_gate_depth / two_qubit_gate_depth with per-instruction time factor overrides
  • RoundBasedFactory: deterministic cache key using full instruction serialization

…ion stats, and physical qubit partitioning

- Define property keys via Rust macro in isa/property_keys.rs with auto-assigned u64 values
- Replace String-keyed properties with u64 keys across Trace, EstimationResult, and Python bindings
- Add LockedISA struct for zero-clone read-locked ISA access during estimation
- Defer ISA cloning to Pareto-surviving results in parallel estimation
- Add EstimationTableStats and qubit partition columns (compute/factory/memory)
- Add iter_mut/IntoIterator for &mut ParetoFrontier
- Add float_to_bits/float_from_bits utilities
- Add SurfaceCode one_qubit_gate_depth/two_qubit_gate_depth parameters
- Improve RoundBasedFactory cache key with full instruction serialization
- Export property_name_to_key and property_keys submodule to Python

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant