-
Notifications
You must be signed in to change notification settings - Fork 48
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 Circuit.has_implicit_wireswaps
property
#1772
Conversation
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.
Thanks! Minor comment on the changelog, and I'm not sure why we're seeing the warning that predicates_test.py line 1151 is unreachable?
pytket/docs/changelog.rst
Outdated
@@ -9,6 +9,7 @@ Features: | |||
* Add Python 3.13 support to the ZX module. | |||
* Add :py:meth:`QubitPauliOperator.get_dict` method. | |||
* Add :py:meth:`Circuit.add_circuit_with_map` method. | |||
* Add :py:attr:`Circuit.has_implicit_wireswaps` property. |
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 should be under a new "Unreleased" heading above please.
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.
Done
pytket/tests/predicates_test.py
Outdated
assert c.has_implicit_wireswaps | ||
|
||
# Property should be read-only | ||
with pytest.raises(AttributeError): |
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.
It seems that a linter is complaining that this line is unreachable; I don't really see why...
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 seems to be a known mypy issue. I added an ignore comment; mypy now says the file is OK on my machine but I am not 100% sure this will fix the CI.
Made #1774 to silence the ruff warning. (Only the latest version of ruff detected this.) |
Description
Circuit::has_implicit_wireswaps()
Circuit.implicit_qubit_permutation()
if the test only used the result to check for non-trivial permutationsRelated issues
Closes #1665.
Checklist