Repository navigation
implemented support for Var, Unary, and Binary operations during qiskit_to_tk conversion - #515
RasmitDevkota wants to merge 7 commits into
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.
Minor thing but we could add a type annotation for _condition and a return type annotation for flatten_condition
|
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 :) |
|
@CalMacCQ what is the state of this? Do you need help? |
|
I split off the fix that @RasmitDevkota made into a separate PR. #524 This change was merged and released some time ago. I personally didn't have plans to work on this anymore. If someone can make a case that these are useful conversions to support and maintain then we can maybe come back to it. |
|
Please reopen and ping me if you think this is still relevant. |
Description
Implements support for Var, Unary, and Binary operations in
_append_if_else_circuitduringqiskit_to_tkconversion.Related issues
Closes #514