Skip to content

Find a better pattern for implementing control and target keywords and us for control gates. #3011

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

Closed
dabacon opened this issue May 15, 2020 · 3 comments · Fixed by #5471
Closed
Labels
area/gate-compilation kind/health For CI/testing/release process/refactoring/technical debt items triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on

Comments

@dabacon
Copy link
Collaborator

dabacon commented May 15, 2020

Currently CXPowGate has a special override of on which allows one to pass in control and target when turning into a GateOperation. It seems like we never followed up to do this for any other gates, and if we are going to do this we shouldn't do it in a one off manner.

@Strilanc
Copy link
Contributor

At the very least the code can be simplified to def on(self, target, control) instead of the args/kwargs stuff that's there.

I'm fine with deprecating it.

@dabacon dabacon changed the title A single gate uses the fluent 'control' and 'target' args. Should we deprecate this? Find a better pattern for implementing control and target keywords and us for control gates. May 21, 2020
@dabacon
Copy link
Collaborator Author

dabacon commented May 21, 2020

discussed at Cirq Cync: vote was to keep it, but to do it in a way that is not adding this code to every gate.

@balopat balopat added area/gate-compilation kind/health For CI/testing/release process/refactoring/technical debt items triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on and removed needs decision labels Sep 9, 2020
@dstrain115
Copy link
Collaborator

Discussion from cirq cync: cut this.

CirqBot pushed a commit that referenced this issue Jun 8, 2022
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gate-compilation kind/health For CI/testing/release process/refactoring/technical debt items triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants