Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@swernli
Copy link
Contributor

@swernli swernli commented Dec 7, 2020

This change includes 3 fixes/updates to the ClassicallyControlled rewrite step:

  1. It adds handling for ExpressionKind.NOT so that those conditions get properly restructured and processed for lifting (fixes Classical Control Rewrite step does not process ExpressionKind.NOT #763)
  2. If a conditional statement has an empty scope, it gets replaced with a call to NoOp instead of being lifted into an empty callable.
  3. Updates the propagation of IsValidScope through the recursive calls to avoid lifting outer conditional scopes when inner scopes are not valid for lifting. The fix here was incorrect, so it was removed and a separate issue Nested Conditional blocks may be incorrectly lifted #768 was filed.

Things left to do before check-in:

  • Add test cases for conditional lifting with NOT (top level and nested condition)
  • Add test case for lifting an empty scope (becomes NoOp)
  • Add test case for nested conditionals that cannot be lifted

This change includes 3 fixes/updates to the ClassicallyControlled rewrite step:
1. It adds handling for ExpressionKind.NOT so that those conditions get properly restructured and processed for lifting (fixes #763)
2. If a conditional statement has an empty scope, it gets replaced with a call to `NoOp` instead of being lifted into an empty callable.
3. Updates the propagation of `IsValidScope` through the recursive calls to avoid lifting outer conditional scopes when inner scopes are not valid for lifting.
@swernli swernli merged commit cb553b7 into main Dec 8, 2020
@swernli swernli deleted the swernli/classical-control-fixes branch February 3, 2022 05:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classical Control Rewrite step does not process ExpressionKind.NOT

3 participants