Skip to content
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

Deprecate Gateset.accept_global_phase_op #5239

Merged
merged 27 commits into from
Apr 18, 2022
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a6e6d78
Deprecate Gateset.accept_global_phase_op
daxfohl Apr 9, 2022
679a4b2
Change gateset accept_global_phase_op default to False.
daxfohl Apr 9, 2022
4d953cc
Fix up uses of Gateset for the breaking GlobalPhaseGate change
daxfohl Apr 9, 2022
4d8bff0
Fix allow fallback to checking for GlobalPhaseGate in gateset
daxfohl Apr 9, 2022
5489cbb
Fix json
daxfohl Apr 9, 2022
eb0527d
format
daxfohl Apr 9, 2022
c463a0c
Physically add a GlobalPhaseGate if allow_global_phase is True, rewor…
daxfohl Apr 9, 2022
a5245e9
fix doc
daxfohl Apr 9, 2022
a7e5c02
Update docs, add inward files
daxfohl Apr 9, 2022
7df5e95
Add json parsing deprecation test
daxfohl Apr 9, 2022
144b897
Add assertions to new test
daxfohl Apr 9, 2022
621e00c
minor refactor
daxfohl Apr 10, 2022
5deea64
Force phase gate removal if allow=False'
daxfohl Apr 13, 2022
71015ae
add global phase to gatesets
daxfohl Apr 13, 2022
68d9951
fix tests in google
daxfohl Apr 13, 2022
1a1ba13
fix tests in google
daxfohl Apr 13, 2022
57a1745
Add warning when default `accept_global_phase_op`
daxfohl Apr 14, 2022
53fd095
Fix pasqal test
daxfohl Apr 14, 2022
ff2b152
Merge branch 'master' into dep-accepts-global-phase
daxfohl Apr 14, 2022
5aca223
format
daxfohl Apr 14, 2022
22d1ed8
Merge branch 'master' into dep-accepts-global-phase
daxfohl Apr 14, 2022
f7c12da
inward json parser
daxfohl Apr 15, 2022
7d45446
coverage
daxfohl Apr 15, 2022
01fdb0b
Fix warnings
daxfohl Apr 17, 2022
a648a61
format
daxfohl Apr 17, 2022
ac31654
Merge branch 'master' into dep-accepts-global-phase
daxfohl Apr 17, 2022
4d152e4
Merge branch 'master' into dep-accepts-global-phase
CirqBot Apr 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add assertions to new test
  • Loading branch information
daxfohl committed Apr 9, 2022
commit 144b89794f141f4f944ba3bb01d467dbf6b94885
6 changes: 4 additions & 2 deletions cirq-core/cirq/ops/gateset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def test_gateset_eq():

def test_from_json_allow_global_phase_deprecated():
with cirq.testing.assert_deprecated('global phase', deadline='v0.16'):
_ = cirq.Gateset._from_json_dict_([], '', True, accept_global_phase_op=True)
x = cirq.Gateset._from_json_dict_([], '', True, accept_global_phase_op=True)
assert x.gates == {cirq.GateFamily(cirq.GlobalPhaseGate)}
with cirq.testing.assert_deprecated('global phase', deadline='v0.16'):
_ = cirq.Gateset._from_json_dict_([], '', True, accept_global_phase_op=False)
x = cirq.Gateset._from_json_dict_([], '', True, accept_global_phase_op=False)
assert not x.gates