Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor QPE bloqs #1297

Merged
merged 9 commits into from
Aug 21, 2024
Merged

Refactor QPE bloqs #1297

merged 9 commits into from
Aug 21, 2024

Conversation

tanujkhattar
Copy link
Collaborator

@tanujkhattar tanujkhattar commented Aug 16, 2024

The PR does a bunch of long pending refactoring in the phase estimation bloqs. At a high level, the following upgrades are done:

  1. A new base class QPEWindowStateBase is introduced and RectangularWindowState and LPResourceState derive from this base class. Helper class methods to determine the number of bits of precision given an epsilon / delta are moved to the window state prep classes since the formulas depend primarily on the window function used.
  2. Both TextbookQPE and QubitizationQPE classes now expect an instance of QPEWindowStateBase to determine the size of phase register and apply the window state prep unitary.
  3. LPResourceState and LPRSInterimPrep bloqs are now implemented using Qualtran native decomposition. The tests are updated and LPRSInterimPrep unitary test assumes an incorrect qubit ordering #1068 is fixed.
  4. As part of doing (3), minor upgrades are made to rest of the bloqs (like ReflectionUsingPrepare now supports symbolic bitsizes in build_call_graph, serialization for CZ basic gate was missing and is now added etc.)

@tanujkhattar tanujkhattar marked this pull request as ready for review August 19, 2024 00:17
@tanujkhattar tanujkhattar linked an issue Aug 19, 2024 that may be closed by this pull request
Copy link
Collaborator

@fdmalone fdmalone left a comment

Choose a reason for hiding this comment

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

LGTM. Some nits

@mpharrigan
Copy link
Collaborator

woo! 🙌 please let me know if there's anything specific you'd like me to review

@tanujkhattar
Copy link
Collaborator Author

Addressed the changes, added bloq examples, autotests and updates notebooks. Merging now.

@tanujkhattar tanujkhattar enabled auto-merge (squash) August 21, 2024 18:09
@tanujkhattar tanujkhattar merged commit c0acc8e into quantumlib:main Aug 21, 2024
8 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LPRSInterimPrep unitary test assumes an incorrect qubit ordering
3 participants