-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remove public fields from gates #4851
Labels
area/gates
kind/design-issue
A conversation around design
triage/accepted
A consensus emerged that this bug report, feature request, or other action should be worked on
Comments
viathor
added
area/gates
triage/discuss
Needs decision / discussion, bring these up during Cirq Cynque
labels
Jan 18, 2022
tanujkhattar
added
triage/accepted
A consensus emerged that this bug report, feature request, or other action should be worked on
and removed
triage/discuss
Needs decision / discussion, bring these up during Cirq Cynque
labels
Jan 26, 2022
From cirq sync: We should do it. Let's do a deprecation by creating a setter and mark it deprecated. |
CirqBot
pushed a commit
that referenced
this issue
Feb 22, 2022
95-martin-orion
pushed a commit
to 95-martin-orion/Cirq
that referenced
this issue
Mar 2, 2022
This was referenced Mar 8, 2022
CirqBot
pushed a commit
that referenced
this issue
Mar 13, 2022
Change public fields to private, and encapsulate with getters and deprecated setters. xref #4851
CirqBot
pushed a commit
that referenced
this issue
Mar 13, 2022
Change public fields to private, and encapsulate with getters and deprecated setters. xref #4851
CirqBot
pushed a commit
that referenced
this issue
Mar 13, 2022
#4851 for `DensePauliString`. This was *slightly* less straightforward than others. * Required moving `ALLOW_DEPRECATION_IN_TEST` or else a circular dependency was created. * One place externally where setting the field still was necessary. (A factory method in `CliffordGate`). * One member is of type `ndarray`, which is mutable, so we set `flags.writeable = False`
CirqBot
pushed a commit
that referenced
this issue
Mar 13, 2022
#4851 for all the pauli stuff. I skipped BaseDensePauliString because including `cirq._compat` there makes a weird circular dependency.
CirqBot
pushed a commit
that referenced
this issue
Mar 13, 2022
Change public fields to private, and encapsulate with getters and deprecated setters. Closes #4851
rht
pushed a commit
to rht/Cirq
that referenced
this issue
May 1, 2023
rht
pushed a commit
to rht/Cirq
that referenced
this issue
May 1, 2023
) Change public fields to private, and encapsulate with getters and deprecated setters. xref quantumlib#4851
rht
pushed a commit
to rht/Cirq
that referenced
this issue
May 1, 2023
Change public fields to private, and encapsulate with getters and deprecated setters. xref quantumlib#4851
rht
pushed a commit
to rht/Cirq
that referenced
this issue
May 1, 2023
quantumlib#4851 for `DensePauliString`. This was *slightly* less straightforward than others. * Required moving `ALLOW_DEPRECATION_IN_TEST` or else a circular dependency was created. * One place externally where setting the field still was necessary. (A factory method in `CliffordGate`). * One member is of type `ndarray`, which is mutable, so we set `flags.writeable = False`
rht
pushed a commit
to rht/Cirq
that referenced
this issue
May 1, 2023
quantumlib#4851 for all the pauli stuff. I skipped BaseDensePauliString because including `cirq._compat` there makes a weird circular dependency.
rht
pushed a commit
to rht/Cirq
that referenced
this issue
May 1, 2023
Change public fields to private, and encapsulate with getters and deprecated setters. Closes quantumlib#4851
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this issue
Oct 31, 2024
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this issue
Oct 31, 2024
) Change public fields to private, and encapsulate with getters and deprecated setters. xref quantumlib#4851
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this issue
Oct 31, 2024
Change public fields to private, and encapsulate with getters and deprecated setters. xref quantumlib#4851
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this issue
Oct 31, 2024
quantumlib#4851 for `DensePauliString`. This was *slightly* less straightforward than others. * Required moving `ALLOW_DEPRECATION_IN_TEST` or else a circular dependency was created. * One place externally where setting the field still was necessary. (A factory method in `CliffordGate`). * One member is of type `ndarray`, which is mutable, so we set `flags.writeable = False`
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this issue
Oct 31, 2024
quantumlib#4851 for all the pauli stuff. I skipped BaseDensePauliString because including `cirq._compat` there makes a weird circular dependency.
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this issue
Oct 31, 2024
Change public fields to private, and encapsulate with getters and deprecated setters. Closes quantumlib#4851
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/gates
kind/design-issue
A conversation around design
triage/accepted
A consensus emerged that this bug report, feature request, or other action should be worked on
We still have a number of gates and operations that have public fields. These should be private, with public getters if necessary. (And those getters should not return mutable references unless it's something performance critical.) Otherwise this breaks the contracts of FrozenCircuit etc.
Ideally upon fixing this we should create a unit test that checks this to some extent for all gates in Cirq.
This should probably be done before 1.0.
The text was updated successfully, but these errors were encountered: