override control of standard gates where possible#3631
Merged
Conversation
7 tasks
ajavadia
reviewed
Dec 23, 2019
Contributor
Author
|
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. |
Member
This could be due to |
Contributor
Author
|
@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. |
kdk
reviewed
Jan 24, 2020
kdk
previously approved these changes
Jan 27, 2020
kdk
approved these changes
Jan 30, 2020
faisaldebouni
pushed a commit
to faisaldebouni/qiskit-terra
that referenced
this pull request
Aug 5, 2020
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Attempt to override the
controlmethod 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.