KEMBAR78
Update regtomem to handle more cases by schweitzpgi · Pull Request #2135 · NVIDIA/cuda-quantum · GitHub
Skip to content

Conversation

@schweitzpgi
Copy link
Collaborator

@schweitzpgi schweitzpgi commented Aug 23, 2024

The regtomem pass has pretty limited applicability. It can, under the correct preconditions, recover the quantum reference semantics model. However, it could fail in the presence of control-flow, so was only reliable when the kernel was a single block.

This PR reimplements much of regtomem to make it work with control-flow and the CC dialect's IfOp.

Add a test. The pass will no longer raise a fatal error if the input is in a form that shares quake operations ambiguously between multiple qubits.

A note on borrow/return: running this pass on borrow/return will not preserve the semantics of that form. The map from the virtual reference domain to a borrow set is a surjective function. We make this a quasi-bijective function but re-resolving the scope of the borrow to be global. The extra qubits can be cleaned up by another pass.

See also #2189 for additional improvements.

@schweitzpgi schweitzpgi marked this pull request as draft August 23, 2024 18:21
@schweitzpgi schweitzpgi marked this pull request as ready for review August 23, 2024 18:35
The regtomem pass has pretty limited applicability. It can, under the
correct preconditions, recover the quantum reference semantics model.
However, it could fail in the presence of control-flow, so was only
reliable when the kernel was a single block.

This PR reimplements much of regtomem to make it work with control-flow
and the CC dialect's IfOp.

Add a test. The pass will no longer raise a fatal error if the input is
in a form that shares quake operations ambiguously between multiple
qubits.

A note on borrow/return: running this pass on borrow/return will *not*
preserve the semantics of that form. The map from the virtual reference
domain to a borrow set is a surjective function. We make this a
quasi-bijective function but re-resolving the scope of the borrow to be
global. The extra qubits can be cleaned up by another pass.
@github-actions
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Aug 23, 2024
github-actions bot pushed a commit that referenced this pull request Aug 23, 2024
@github-actions
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@schweitzpgi schweitzpgi enabled auto-merge (squash) August 26, 2024 14:35
@schweitzpgi schweitzpgi merged commit d6585c8 into NVIDIA:main Aug 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 26, 2024
@schweitzpgi schweitzpgi deleted the ch-reg2mem branch August 26, 2024 17:28
@bettinaheim bettinaheim added the release notes Changes need to be captured in the release notes label Nov 19, 2024
@bettinaheim bettinaheim added this to the release 0.9.0 milestone Nov 19, 2024
@bettinaheim bettinaheim changed the title Update regtomem to handle more cases. Update regtomem to handle more cases Nov 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release notes Changes need to be captured in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants