Skip to content

Fix unwanted phase in QROAMClean - #1977

Open
rupasri118 wants to merge 2 commits into
quantumlib:mainfrom
rupasri118:fix-qroamclean-sign
Open

rupasri118 wants to merge 2 commits into
quantumlib:mainfrom
rupasri118:fix-qroamclean-sign

Conversation

@rupasri118

Copy link
Copy Markdown

Summary

Fixes #1968.

QROAMClean used approximate CSwap gates in its swap network, which can introduce unwanted relative phases. This caused the output state to have a negative amplitude for an address that should have a positive amplitude.

This change uses exact CSwap gates in QROAMClean to prevent unwanted phases while preserving approximate CSwap as the default behavior for SwapWithZero.

Changes

  • Use exact CSwap gates in QROAMClean.
  • Preserve approximate CSwap as the default for SwapWithZero.
  • Add a regression test to verify that the output state has the correct positive amplitude.
  • Update T-complexity expectations to account for the exact CSwap implementation.

Testing

  • qroam_clean_test.py — 26 passed, 1 skipped, 1 xfailed.
  • qroam_clean_test.py, swap_with_zero_test.py, and cswap_approx_test.py — 79 passed, 6 skipped, 3 xfailed.

@rupasri118

Copy link
Copy Markdown
Author

Hi @mhucka, could you please take a look at this PR when you get a chance? It fixes the unwanted phase issue in QROAMClean (#1968). I've updated the branch and checked the relevant tests. I'd really appreciate your feedback. Thank you!

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.

QROAMClean puts a sign on some addresses

1 participant