Skip to content

Conversation

raynelfss
Copy link
Contributor

@raynelfss raynelfss commented Apr 3, 2025

Summary

  • Create two parallel structs GateMap and PropsMap to represent the complex mapping happening in GateMap and achieve two things:
    • Make the python side mapping no longer be exposed publicly.
    • Make the mapping python independent and rebuildable upon request.
  • This commit is built on several branches that perform additions to the target and this branch will either be superceded or heavily rebased upon further review.

Details and comments

Tasks

  • Implement python gate map to be rebuildable from rust.
  • Test roundtrip (Python <---> Rust)
  • Rebasing

Pre-requisites

@coveralls
Copy link

coveralls commented Apr 3, 2025

Pull Request Test Coverage Report for Build 14642756012

Details

  • 247 of 271 (91.14%) changed or added relevant lines in 3 files are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.07%) to 88.001%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/target.py 3 4 75.0%
crates/accelerate/src/target_transpiler/synched_map.rs 153 176 86.93%
Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/unitary_synthesis.rs 1 94.78%
crates/qasm2/src/lex.rs 6 92.23%
Totals Coverage Status
Change from base Build 14640289610: 0.07%
Covered Lines: 74321
Relevant Lines: 84455

💛 - Coveralls

- Create two parallel structs `GateMap` and `PropsMap` to represent the complex mapping happening in `GateMap` and achieve two things:
    - Make the python side mapping no longer be exposed publicly.
    - Make the mapping python independent and rebuildable upon request.
- This commit is built on several branches that perform additions to the target and this branch will either be superceded or heavily rebased upon further review.
…w the structure to be re-used.

- Since `Qargs` already implements its custom version of `IntoPyObject`, we are free to just make the custom mappings fully generic.
- `SynchedMap<K, V>` implements a cached `PyDict` that loads modifications done on the rust side back to Python. This synchronization does not apply to changes done in Python just yet. Will be saved for a follow-up.
@mtreinish mtreinish removed this from the 2.1.0 milestone May 28, 2025
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.

3 participants