Skip to content

Commit

Permalink
Extract BufferedDM/SV/MPS from ActOnDM/SV/MPSArgs (#4979)
Browse files Browse the repository at this point in the history
* Extract BufferedDensityMatrix from ActOnDensityMatrixArgs

* state vector

* clean up code

* clean up code

* clean up code

* format

* docs

* test

* coverage

* improve state vector

* improve state vector

* replace deleted functions

* replace deleted functions

* replace deleted functions

* replace deleted functions

* lint

* mps quantum state

* mps quantum state

* mps quantum state

* mps quantum state

* mps quantum state

* mps quantum state

* mps quantum state

* mps quantum state

* coverage

* fix merge errors

* Code review comments

* Remove todo

Co-authored-by: Orion Martin <[email protected]>
  • Loading branch information
daxfohl and 95-martin-orion authored Mar 21, 2022
1 parent d3c4853 commit e0a64dd
Show file tree
Hide file tree
Showing 8 changed files with 890 additions and 347 deletions.
422 changes: 293 additions & 129 deletions cirq-core/cirq/contrib/quimb/mps_simulator.py

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions cirq-core/cirq/contrib/quimb/mps_simulator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,17 @@ def test_act_on_gate():
args.state_vector().reshape((2, 2, 2)),
cirq.one_hot(index=(0, 1, 0), shape=(2, 2, 2), dtype=np.complex64),
)


def test_deprectated():
q0 = cirq.LineQubit(0)
prng = np.random.RandomState(0)
args = ccq.mps_simulator.MPSState(
qubits=cirq.LineQubit.range(3),
prng=prng,
log_of_measurement_results={},
)
with cirq.testing.assert_deprecated(deadline='0.15'):
args.perform_measurement([q0], prng)
with cirq.testing.assert_deprecated(deadline='0.15'):
args.apply_op(cirq.X(q0), prng)
1 change: 1 addition & 0 deletions cirq-core/cirq/protocols/json_test_data/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
'ActOnArgsContainer',
'ActOnCliffordTableauArgs',
'ActOnDensityMatrixArgs',
'ActOnStabilizerArgs',
'ActOnStabilizerCHFormArgs',
'ActOnStateVectorArgs',
'ApplyChannelArgs',
Expand Down
Loading

0 comments on commit e0a64dd

Please sign in to comment.