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

Fix global phase for controlled-T, R1 #2112

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Fix global phase for controlled-T, R1 #2112

merged 3 commits into from
Jan 22, 2025

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Jan 21, 2025

The decomposition for controlled-T in the stdlib uses Rz gates that are correct up to a global phase, which is fine for hardware but distracting in simulation. Correcting for that global phase in T fixes the global phase in S, which in turn allows removing a patch that made R1 use a global phase consistent with S.

Fixes #2106

The decomposition for controlled-`T` in the stdlib uses `Rz` gates that are correct up to a global phase, which is fine for hardware but distracting in simulation. Correcting for that global phase in `T` fixes the global phase in `S`, which in turn allows removing a patch that made `R1` use a global phase consistent with `S`.

Fixes #2106
Copy link

Change in memory usage detected by benchmark.

Memory Report for f896233

Test This Branch On Main Difference
compile core + standard lib 19599089 bytes 19600689 bytes -1600 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 62cb3a7

Test This Branch On Main Difference
compile core + standard lib 19595993 bytes 19600689 bytes -4696 bytes

@swernli swernli enabled auto-merge January 22, 2025 19:31
@swernli swernli added this pull request to the merge queue Jan 22, 2025
Merged via the queue into main with commit f086caf Jan 22, 2025
19 checks passed
@swernli swernli deleted the swernli/issue2106 branch January 22, 2025 20:18
idavis pushed a commit that referenced this pull request Feb 2, 2025
The decomposition for controlled-`T` in the stdlib uses `Rz` gates that
are correct up to a global phase, which is fine for hardware but
distracting in simulation. Correcting for that global phase in `T` fixes
the global phase in `S`, which in turn allows removing a patch that made
`R1` use a global phase consistent with `S`.

Fixes #2106
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.

DumpOperation has unexpected global phase for double-controlled-R1 gate
4 participants