-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add pulse instruction and schedule equality testing #2873
Add pulse instruction and schedule equality testing #2873
Conversation
… the super class of eq.
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.
I see your test at the end, so I know it works fine, but where is the comparison for start times of Instructions happening? The test I'm looking at is test_differnet_time_not_equal
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
… into schedule-equality-check
This test happening in checking that the underlying tuple is equal. It has a form of |
This should be good to go now. |
Azure returned successfully on all jobs: https://dev.azure.com/qiskit-ci/qiskit-terra/_build/results?buildId=1822 it's just the recent issue where the azure<->github communication fails and nothing gets updated. Since the jobs all succeeded I'm going to go ahead and merge this |
This adds pulse instruction and schedule equality testing. This will make writing Schedule tests easier. I also added a small change to return instructions with a fixed ordering. This was required for the initial way I implemented equality testing, but have since refactored so that it is not necessary. Instruction testing verifies that the lhs and rhs have the same Command on the same channels. Schedule testing first ensures that the lhs and rhs each have the same channels and the same number of instructions. Then it verifies that each instruction at each time in the rhs is contained within the rhs. * Add schedule and instruction equality testing. * Modify equality check to be more straight forward. * Updated changelog. * refactor equality checking of Commands to not check name and also use the super class of eq. * Update qiskit/pulse/commands/command.py Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com> * Fix unpythonic equality checks. * Add proper hashes for commands. * Update test/python/pulse/test_schedule.py Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com> * Change equality check to be based on position in .
Summary
This PR adds pulse instruction and schedule equality testing. This will make writing Schedule tests easier.
I also added a small change to return
instructions
with a fixed ordering. This was required for the initial way I implemented equality testing, but have since refactored so that it is not necessary. This feature may still be desired so I have left it in, please let me know if I should remove.Details and comments
Instruction testing verifies that the lhs and rhs have the same Command on the same channels.
Schedule testing first ensures that the lhs and rhs each have the same channels and the same number of instructions. Then it verifies that each instruction at each time in the rhs is contained within the rhs.