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

Introduce Relabel API #1905

Merged
merged 11 commits into from
Sep 16, 2024
Merged

Introduce Relabel API #1905

merged 11 commits into from
Sep 16, 2024

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Sep 8, 2024

This change introduces an API for relabeling qubits without needing to use any quantum SWAP operations. This notion of relabeling is used in some quantum algorithms when all-to-all connectivity is assumed. The change includes support for label swapping in simulation, circuit generation, and QIR codegen. The Relabel operation takes qubit arrays that represent a permutation of labels without needing to manually break that permutation down into its equivalent two qubit swaps.

This change introduces an API for swapping qubit labels without needing to use any quantum SWAP operations. This notion of relabeling is used in some quantum algorithms when all-to-all connectivity is assumed. The change includes support for label swapping in simulation, circuit generation, and QIR codegen.
Copy link

github-actions bot commented Sep 9, 2024

Change in memory usage detected by benchmark.

Memory Report for d3440cc

Test This Branch On Main Difference
compile core + standard lib 18011996 bytes 18002928 bytes 9068 bytes

library/std/src/canon.qs Outdated Show resolved Hide resolved
Copy link
Member

@ivanbasov ivanbasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resource estimation changes (a comment at tests) look good

@swernli swernli marked this pull request as draft September 9, 2024 19:39
@swernli
Copy link
Collaborator Author

swernli commented Sep 9, 2024

Converting to draft while I tweak the library API. Got some feedback that something that allows for a broader abstraction, like swap of identifiers between two lists, would be helpful for some algorithm.

@swernli swernli changed the title Introduce SwapLabels API Introduce SwapLabels and Relabel APIs Sep 11, 2024
@swernli swernli marked this pull request as ready for review September 11, 2024 07:34
Copy link

Change in memory usage detected by benchmark.

Memory Report for 7f692e8

Test This Branch On Main Difference
compile core + standard lib 18020016 bytes 18002928 bytes 17088 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for b38a5b6

Test This Branch On Main Difference
compile core + standard lib 18020016 bytes 18002928 bytes 17088 bytes

library/std/src/canon.qs Outdated Show resolved Hide resolved
library/std/src/canon.qs Outdated Show resolved Hide resolved
Copy link

Change in memory usage detected by benchmark.

Memory Report for 5373354

Test This Branch On Main Difference
compile core + standard lib 18020032 bytes 18002928 bytes 17104 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 811e014

Test This Branch On Main Difference
compile core + standard lib 18020032 bytes 18002928 bytes 17104 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 4b0317c

Test This Branch On Main Difference
compile core + standard lib 18020032 bytes 18002928 bytes 17104 bytes

@swernli swernli changed the title Introduce SwapLabels and Relabel APIs Introduce Relabel API Sep 16, 2024
Copy link

Change in memory usage detected by benchmark.

Memory Report for bd26205

Test This Branch On Main Difference
compile core + standard lib 18009732 bytes 18002928 bytes 6804 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 49e32d7

Test This Branch On Main Difference
compile core + standard lib 18009732 bytes 18002928 bytes 6804 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 8445c52

Test This Branch On Main Difference
compile core + standard lib 18009732 bytes 18002928 bytes 6804 bytes

@swernli swernli added this pull request to the merge queue Sep 16, 2024
Merged via the queue into main with commit 5d193f4 Sep 16, 2024
18 checks passed
@swernli swernli deleted the swernli/relabel branch September 16, 2024 17:24
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