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

Decompose measurement in QIR Base profile processing #2230

Merged
merged 3 commits into from
Mar 19, 2025

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Mar 13, 2025

This change simplifies the decomposition of M and Measure in the stdlib to no longer conditionally compile to different versions based on qubit reuse capability, instead offloading that to QIR processing, which already has similar logic.

One effect of this is simulation and circuit generation will match user expectation and patterns in the Q# code rather than more closely showing what occurs on hardware.

This change simplifies the decomposition of `M` and `Measure` in the stdlib to no longer conditionally compile to different versions based on qubit reuse capability, instead offloading that to QIR processing, which already has similar logic.

One effect of this is simulation and circuit generation will match user expectation and patterns in the Q# code rather than more closely showing what occurs on hardware.
Copy link

Change in memory usage detected by benchmark.

Memory Report for 517a0e1

Test This Branch On Main Difference
compile core + standard lib 19840641 bytes 19841233 bytes -592 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 88ad901

Test This Branch On Main Difference
compile core + standard lib 19840641 bytes 19841233 bytes -592 bytes

@minestarks
Copy link
Member

minestarks commented Mar 13, 2025

Forgot to add before I signed off: Can we update the circuit UI to remove the target profile information since it's no longer relevant?

@swernli
Copy link
Collaborator Author

swernli commented Mar 13, 2025

Forgot to add before I signed off: Can we update the circuit UI to remove the target profile information since it's no longer relevant?

Well, it's no longer relevant for most bits but it could still be relevant for conditionally compiled code from librarys or the user's own code. Since it's not too obtrusive, I'd be in favor of leaving it. But I could be convinced ;).

Copy link

Change in memory usage detected by benchmark.

Memory Report for 01cf761

Test This Branch On Main Difference
compile core + standard lib 19840641 bytes 19841233 bytes -592 bytes

@swernli swernli added this pull request to the merge queue Mar 19, 2025
Merged via the queue into main with commit 44ba5af Mar 19, 2025
18 checks passed
@swernli swernli deleted the swernli/decompose-m-in-qir branch March 19, 2025 17:32
swernli added a commit that referenced this pull request Mar 31, 2025
Now that the measurement decompositions are handled lower in the stack (see #2230), the examples for how measurements show up differently for circuits from Base profile vs Unrestricted no longer make sense. This removes them.

Likewise the section in the wiki on circuits for different profiles should be updated or removed (see https://github.com/microsoft/qsharp/wiki/Circuit-Diagrams-from-Q%23-Code#target-profile)
github-merge-queue bot pushed a commit that referenced this pull request Mar 31, 2025
Now that the measurement decompositions are handled lower in the stack
(see #2230), the examples for how measurements show up differently for
circuits from Base profile vs Unrestricted no longer make sense. This
removes them.

<s>Likewise the section in the wiki on circuits for different profiles
should be updated or removed (see
https://github.com/microsoft/qsharp/wiki/Circuit-Diagrams-from-Q%23-Code#target-profile)</s>
Done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants