-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
override control
of standard gates where possible
#3631
Conversation
There seems to be a single error which only occurs when running multiple environments with tox that does not seem to occur with e.g. |
This could be due to |
@kdk I kept ccx.py, and other controlled gate modules, for deprecation purposes. Your point, however, helped me to find a conflicting import reference for ToffoliGate which I fixed. This seems to have solved the bug. Thanks! Also, I removed redundant definitions in to be deprecated gate modules. |
* move controlled gate class definitions into base gate module. * fix cyclic imports * update for new crx and cry * linting * linting * linting * minor * wrong import of U3Gate * module level pylint cyclic-import disable * update mapper ground truth * hack to get tox to work * solve bug associated with ToffoliGate import. * avoid multiple definitions * update warning category. * change stack level Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
Attempt to override the
control
method of standard gates which do not cause a cyclic import. This simplifies the logic somewhat inadd_control.py
.Details and comments
This is based off a discussion which occurred in pr #3600 . This pr avoids cyclic import warnings raised by pylint by moving predefined controlled gates into their base modules. This change may break code which imports some controlled gates.