Skip to content

Implement 'reset after measure' in value semantics (linear use form) #3565

@1tnguyen

Description

@1tnguyen

This pass should be written when the IR is in explicit linear use form (aka, value semantics), as it will be much simpler to understand, write, etc.

It actually becomes trivial. A measurement op must produce 1 or more wires. If those wires are used by anything that is not a sink operation, they are reused. In those case, if the reuse is not a reset operation, then insert a reset operation. Done.

Originally posted by @schweitzpgi in #3450 (review)

Note: the value semantics indeed simplifies the use tracking of qubit wire after measure. There are still some considerations around qubit wire aliasing, i.e., multiple linear wires could be referring to the same physical qubit extracted from a qubit register at a specific index.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions