-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Migrate contrib json tests #7742
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "cirq_type": "BayesianNetworkGate", | ||
| "init_probs": [ | ||
| ["q0", 0.125], | ||
| ["q1", null] | ||
| ], | ||
| "arc_probs": [ | ||
| ["q1", ["q0"], [0.25, 0.5]] | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| cirq.contrib.bayesian_network.BayesianNetworkGate(init_probs=[('q0', 0.125), ('q1', None)], arc_probs=[('q1', ('q0',), [0.25, 0.5])]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| { | ||
| "cirq_type": "QuantumVolumeResult", | ||
| "model_circuit": { | ||
| "cirq_type": "Circuit", | ||
| "moments": [ | ||
| { | ||
| "cirq_type": "Moment", | ||
| "operations": [ | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 0 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 1 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 2 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 3 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 4 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "heavy_set": [ | ||
| 1, | ||
| 2, | ||
| 3 | ||
| ], | ||
| "compiled_circuit": { | ||
| "cirq_type": "Circuit", | ||
| "moments": [ | ||
| { | ||
| "cirq_type": "Moment", | ||
| "operations": [ | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 0 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 1 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 2 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 3 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "cirq_type": "GateOperation", | ||
| "gate": { | ||
| "cirq_type": "HPowGate", | ||
| "exponent": 1.0, | ||
| "global_shift": 0.0 | ||
| }, | ||
| "qubits": [ | ||
| { | ||
| "cirq_type": "LineQubit", | ||
| "x": 4 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "sampler_result": 0.1 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| cirq.contrib.quantum_volume.QuantumVolumeResult(model_circuit=cirq.Circuit(cirq.Moment(cirq.H(cirq.LineQubit(0)), cirq.H(cirq.LineQubit(1)), cirq.H(cirq.LineQubit(2)), cirq.H(cirq.LineQubit(3)), cirq.H(cirq.LineQubit(4)))), heavy_set=[1, 2, 3], compiled_circuit=cirq.Circuit(cirq.Moment(cirq.H(cirq.LineQubit(0)), cirq.H(cirq.LineQubit(1)), cirq.H(cirq.LineQubit(2)), cirq.H(cirq.LineQubit(3)), cirq.H(cirq.LineQubit(4)))), sampler_result=0.1) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "cirq_type": "SwapPermutationGate" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| cirq.contrib.acquaintance.SwapPermutationGate(swap_gate=cirq.SWAP) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,5 +28,6 @@ | |
| resolver_cache=_class_resolver_dictionary(), | ||
| deprecated={}, | ||
| # TODO: #7520 - create .json and .repr for these so they can be tested here | ||
| tested_elsewhere=["QuantumVolumeResult", "SwapPermutationGate", "BayesianNetworkGate"], | ||
| #tested_elsewhere=["QuantumVolumeResult", "SwapPermutationGate", "BayesianNetworkGate"], | ||
| tested_elsewhere=[] | ||
|
||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
_compat.deprecate_attributeswith a deadline ofv1.8instead - similarly as what was done for theXMON(and others) here -Cirq/cirq-google/cirq_google/__init__.py
Lines 175 to 184 in 7e67d66
The
deprecate_attributescall should be the last one in this module.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pavoljuhas
I have tried creating similar to the XMON example provided, can you please review the change and let me know if it is correct or is there any fix needed for the change?
I tried running a basic run with test code but since json_test.py has been removed, I wasn't able to confirm the warning message.