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

Make And a leaf bloq #1513

Merged
merged 4 commits into from
Dec 20, 2024
Merged

Conversation

anurudhp
Copy link
Contributor

@anurudhp anurudhp commented Dec 20, 2024

fixes #1346

also removes the only use of big O in call graph #1368

  • first commit sets FLAG_AND_IS_LEAF=True and fixes all tests
  • second one removes it altogether and cleans up the And bloq code
  • fix t_counts_from_sigma to explicitly count Ands

@anurudhp
Copy link
Contributor Author

@mpharrigan @fdmalone ptal!

@mpharrigan mpharrigan self-requested a review December 20, 2024 17:03
Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

excellent. very nice

@@ -280,10 +279,10 @@ def build_call_graph(self, ssa: 'SympySymbolAllocator') -> 'BloqCountDictT':
in_prep_dag: 1, # in_prep_l^dag
rot: 1, # rotate into system basis listing 4 pg 54
# apply CCZ first then CCCZ, the cost is 1 + 2 Toffolis (step 4e, and 7)
Toffoli(): 1,
ApplyControlledZs(cvs=(1, 1), bitsize=5): 1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

was this incorrect before? I see the change makes it match the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previous test was only checking the sigma for the call graph. I updated it to check for equivalent bloq counts, which flagged this inconsistency.

@mpharrigan mpharrigan merged commit 1bd4f70 into quantumlib:main Dec 20, 2024
8 checks passed
@anurudhp anurudhp deleted the 2024/12/18-and-leaf branch December 20, 2024 18:29
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.

Make And a leaf bloq
2 participants