Skip to content

Optimize memory footprint of OperationType #12567

@mtreinish

Description

@mtreinish

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)

Metadata

Metadata

Assignees

Labels

RustThis PR or issue is related to Rust code in the repositorymod: circuitRelated to the core of the `QuantumCircuit` class or the circuit librarypriority: high

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions