Skip to content

Commit

Permalink
Use new quimb TN string format (#5525)
Browse files Browse the repository at this point in the history
  • Loading branch information
95-martin-orion authored Jun 15, 2022
1 parent 40c33d3 commit c504c38
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cirq-core/cirq/contrib/quimb/mps_simulator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_trial_result_str():
)
== """measurements: m=1
output state: TensorNetwork([
Tensor(shape=(2,), inds=('i_0',), tags=set()),
Tensor(shape=(2,), inds=('i_0',), tags=oset([])),
])"""
)

Expand All @@ -297,7 +297,7 @@ def test_trial_result_repr_pretty():
result,
"""measurements: m=1
output state: TensorNetwork([
Tensor(shape=(2,), inds=('i_0',), tags=set()),
Tensor(shape=(2,), inds=('i_0',), tags=oset([])),
])""",
)
cirq.testing.assert_repr_pretty(result, "cirq.MPSTrialResult(...)", cycle=True)
Expand All @@ -311,7 +311,7 @@ def test_empty_step_result():
str(step_result)
== """q(0)=0
TensorNetwork([
Tensor(shape=(2,), inds=('i_0',), tags=set()),
Tensor(shape=(2,), inds=('i_0',), tags=oset([])),
])"""
)

Expand All @@ -324,7 +324,7 @@ def test_step_result_repr_pretty():
step_result,
"""q(0)=0
TensorNetwork([
Tensor(shape=(2,), inds=('i_0',), tags=set()),
Tensor(shape=(2,), inds=('i_0',), tags=oset([])),
])""",
)
cirq.testing.assert_repr_pretty(step_result, "cirq.MPSSimulatorStepResult(...)", cycle=True)
Expand Down Expand Up @@ -394,8 +394,8 @@ def test_simulate_moment_steps_sample():
assert (
str(step)
== """TensorNetwork([
Tensor(shape=(2,), inds=('i_0',), tags=set()),
Tensor(shape=(2,), inds=('i_1',), tags=set()),
Tensor(shape=(2,), inds=('i_0',), tags=oset([])),
Tensor(shape=(2,), inds=('i_1',), tags=oset([])),
])"""
)
samples = step.sample([q0, q1], repetitions=10)
Expand All @@ -415,8 +415,8 @@ def test_simulate_moment_steps_sample():
assert (
str(step)
== """TensorNetwork([
Tensor(shape=(2, 2), inds=('i_0', 'mu_0_1'), tags=set()),
Tensor(shape=(2, 2), inds=('mu_0_1', 'i_1'), tags=set()),
Tensor(shape=(2, 2), inds=('i_0', 'mu_0_1'), tags=oset([])),
Tensor(shape=(2, 2), inds=('mu_0_1', 'i_1'), tags=oset([])),
])"""
)
samples = step.sample([q0, q1], repetitions=10)
Expand Down

0 comments on commit c504c38

Please sign in to comment.