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

Open
#3,565 1 comment 0 reactions 1 assignee View on GitHub

@1tnguyen is already working on this.

Since Oct 31, 2025.

Assessment

This issue has not been assessed yet.

Description

stale-notified

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 https://github.com/NVIDIA/cuda-quantum/pull/3450#pullrequestreview-3285634272

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.

Dominant language
C++
Stars
1.1k
Forks
455
Avg merge
1d 22h
Merged PRs (30d)
165

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/cuda-quantum

All issues in NVIDIA/cuda-quantum

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.