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

Optimize memory footprint of OperationType #12567

Closed
mtreinish opened this issue Jun 13, 2024 · 0 comments · Fixed by #12730
Closed

Optimize memory footprint of OperationType #12567

mtreinish opened this issue Jun 13, 2024 · 0 comments · Fixed by #12730
Assignees
Labels
mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library priority: high Rust This PR or issue is related to Rust code in the repository
Milestone

Comments

@mtreinish
Copy link
Member

This type is exceptionally wide for something that we want to be almost entirely StandardGate (which could even be u8 sized). Realistically we're not going to get this below a usize, but that should be achievable by pointer-indirecting the PyInstruction etc variants, and storing the enum discriminant in the 2 low bits of the pointer (if we expand the enum in the future and need more than 2 bits, we'll have to think about our 32-bit platform support).

Originally posted by @jakelishman in #12459 (comment)

@mtreinish mtreinish added priority: high Rust This PR or issue is related to Rust code in the repository mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Jun 13, 2024
@mtreinish mtreinish added this to the 1.2.0 milestone Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library priority: high 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