-
Notifications
You must be signed in to change notification settings - Fork 121
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
AutoQASM freeparameter usage with pulse instruction #794
AutoQASM freeparameter usage with pulse instruction #794
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/autoqasm #794 +/- ##
==================================================
Coverage 100.00% 100.00%
==================================================
Files 166 166
Lines 9878 9870 -8
Branches 2095 2092 -3
==================================================
- Hits 9878 9870 -8 ☔ View full report in Codecov by Sentry. |
@@ -43,6 +43,7 @@ def _pulse_instruction(name: str, frame: Frame, *args) -> None: | |||
""" | |||
program_conversion_context = aq_program.get_program_conversion_context() | |||
program_conversion_context._has_pulse_control = True | |||
program_conversion_context.register_args(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need to be replaced with the new _register_and_convert_parameters
method of utils
. I'm guessing it would only appear as a bug if a FreeParameter appeared in a pulse instruction first, and later was used in a conditional statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional statements later in a program would not be affected by here. In conditional statement, variables are still converted by _register_and_convert_parameters
in the compare operator. I added a unit test that the freeparameter for pulse is later used by a conditional statement. Here, we actually do want the variable to be freeparameter instead of FloatVar.
Issue #, if available:
https://github.com/orgs/amazon-braket/projects/2/views/6?pane=issue&itemId=44479389
Description of changes:
Testing done:
tox
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.