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

Make rust Qubit and Clbit the source of truth in a circuit #13269

Open
Tracked by #13264
mtreinish opened this issue Oct 3, 2024 · 0 comments · May be fixed by #13686
Open
Tracked by #13264

Make rust Qubit and Clbit the source of truth in a circuit #13269

mtreinish opened this issue Oct 3, 2024 · 0 comments · May be fixed by #13686
Assignees
Labels
performance Rust This PR or issue is related to Rust code in the repository
Milestone

Comments

@mtreinish
Copy link
Member

Currently we have a Python space Qubit and Clbit class which is the source of truth of bits in a circuit. We also have a rust space Qubit and Clbit struct which are indices representing the order of qubits in the circuit but those indices map back to a Qubit python space object which is used from python to address the bits in the circuit. But this relationship is backwards from a performance perspective because it means we always need to create a python object to handle bits, even when creating a circuit in rust. This leads to a significant performance overhead for things like synthesis functions that are generating circuits where the overhead to create bit objects and map them to indices so we have a rust native bit object to use. We should invert this relationship so we have the pure rust bit as the source of truth and the python space object serves as a reference to that.

@mtreinish mtreinish added performance Rust This PR or issue is related to Rust code in the repository labels Oct 3, 2024
@mtreinish mtreinish added this to the 2.0.0 milestone Oct 3, 2024
@raynelfss raynelfss self-assigned this Oct 22, 2024
@raynelfss raynelfss linked a pull request Jan 17, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Rust This PR or issue is related to Rust code in the repository
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants