-
Notifications
You must be signed in to change notification settings - Fork 15
implemented support for Var, Unary, and Binary operations during qiskit_to_tk conversion
#515
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks a lot for the PR :) We can take a detailed look shortly. A couple things
|
qiskit_to_tk conversion
|
Pushed fixes, a few comments:
|
|
Regarding the lints I think that |
| ) | ||
|
|
||
| # Utility method to flatten conditions | ||
| def flatten_condition(_condition): |
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.
Minor thing but we could add a type annotation for _condition and a return type annotation for flatten_condition
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.
Added!
|
Looks like I had to ask ruff to do extra checks to get through the rest of the lint errors, but I think that should cover it. |
|
I think after reformatting the NOQA comments are now on the wrong line which is kinda annyoying. Would also be nice to have a test in |
Yeah, I did notice that some of the formatting decisions didn't make sense, lie how it splits into a newline here: return flatten_condition(_condition.left) ^ flatten_condition(
_condition.right
)Should I leave it this way, or make it more consistent? I've added the
Working on that now, would the standard structure be to test each of the different types of conditions separately, as in having a separate test for Var, Unary, and Binary, or something more compact? I have examples which reach all of the new branches I've created but I'm just not sure about organization. |
Regarding the structure of the tests I don't have a strong opinion really. It would be desirable if the behaviour for Also spotted that the linting is fixed now, thanks! |
|
Happy to help with this if needed. Thanks again for the contribution. |
|
I think its just a test thats needed. Would it help if I added the test case? |
|
Sorry for the late response - some help would definitely be appreciated! I've just been struggling to construct the pytket circuit correctly so that the circuit objects would be equal in the end. |
No worries, I'm going on leave for a few days but I'll get back to you on Monday :) |
|
Looking at this now :) |
Description
Implements support for Var, Unary, and Binary operations in
_append_if_else_circuitduringqiskit_to_tkconversion.Related issues
Closes #514