Skip to content

Refactor json_test's TEST_OBJECTS value into test data files #2527

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

Merged
merged 9 commits into from
Nov 14, 2019
383 changes: 148 additions & 235 deletions cirq/protocols/json_test.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions cirq/protocols/json_test_data/AmplitudeDampingChannel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"cirq_type": "AmplitudeDampingChannel",
"gamma": 0.5
}
1 change: 1 addition & 0 deletions cirq/protocols/json_test_data/AmplitudeDampingChannel.repr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cirq.amplitude_damp(gamma=0.5)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cirq_type": "AsymmetricDepolarizingChannel",
"p_x": 0.1,
"p_y": 0.2,
"p_z": 0.3
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cirq.asymmetric_depolarize(p_x=0.1,p_y=0.2,p_z=0.3)
4 changes: 4 additions & 0 deletions cirq/protocols/json_test_data/BitFlipChannel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"cirq_type": "BitFlipChannel",
"p": 0.5
}
1 change: 1 addition & 0 deletions cirq/protocols/json_test_data/BitFlipChannel.repr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cirq.bit_flip(p=0.5)
Loading