Skip to content

Conversation

@mpharrigan
Copy link
Collaborator

@mpharrigan mpharrigan commented Aug 22, 2024

This logic is slightly inconsistent within itself, but it matches the previous behavior from the t_complexity protocol. We count Controlled(Rotation) as a rotation no matter what the rotation angle is. The ultimate fix is blocked by having explicit representations for all leaf controlled locations (#878).

  • Also make debugging unexpected qubit count failures easier with a helpful wrapping error message that includes the problematic bloq
  • Don't need a hack for Controlled(GlobalPhase) following Controlled GlobalPhase is ZGate #1113
  • Improve hacky logic: multi-bit controls aren't counted as rotations

@mpharrigan mpharrigan requested a review from anurudhp August 22, 2024 20:31
Copy link
Contributor

@anurudhp anurudhp left a comment

Choose a reason for hiding this comment

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

lgtm % doubt regarding Controlled override

ZPowGate,
)

if isinstance(b, Controlled):
Copy link
Contributor

Choose a reason for hiding this comment

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

This branch captures any CtrlSpec right? For non-trivial ctrl-spec, shouldn't we error out? (or use the and-ladder, but perhaps for later) #1290

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, that is an issue; but not a new issue introduced by this PR. Let me see if I can sneak a quick fix in or if it'll be a whole thing; in which case, I will defer to another PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could -- there aren't any places in the unit tests or bloq examples that relies on Controlled(rot, #cvs>1)

@mpharrigan mpharrigan merged commit 9c47157 into quantumlib:main Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants