Skip to content

Commit

Permalink
Extract BufferedDM/SV/MPS from ActOnDM/SV/MPSArgs (quantumlib#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
2 people authored and tonybruguier committed Apr 19, 2022
1 parent 595586f commit c8364f7
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 c8364f7

Please sign in to comment.