diff --git a/tests/test_mixed_simulator_device.py b/tests/test_mixed_simulator_device.py index 19a03cf..38de513 100644 --- a/tests/test_mixed_simulator_device.py +++ b/tests/test_mixed_simulator_device.py @@ -445,8 +445,7 @@ def test_basis_state_not_at_beginning_error(self, simulator_device_1_wire): ): simulator_device_1_wire.apply([qml.PauliX(0), qml.BasisState(np.array([0]), wires=[0])]) - @pytest.mark.parametrize("stateprep", (qml.QubitStateVector, qml.StatePrep)) - def test_qubit_state_vector_not_at_beginning_error(self, simulator_device_1_wire, stateprep): + def test_qubit_state_vector_not_at_beginning_error(self, simulator_device_1_wire): """Tests that application of StatePrep raises an error if is not the first operation.""" @@ -454,9 +453,9 @@ def test_qubit_state_vector_not_at_beginning_error(self, simulator_device_1_wire with pytest.raises( qml.DeviceError, - match=f"The operation {stateprep.__name__} is only supported at the beginning of a circuit.", + match=f"The operation StatePrep is only supported at the beginning of a circuit.", ): - simulator_device_1_wire.apply([qml.PauliX(0), stateprep(np.array([0, 1]), wires=[0])]) + simulator_device_1_wire.apply([qml.PauliX(0), qml.StatePrep(np.array([0, 1]), wires=[0])]) @pytest.mark.parametrize("shots", [100]) @@ -475,8 +474,7 @@ def test_basis_state_not_analytic_error(self, simulator_device_1_wire): ): simulator_device_1_wire.apply([qml.BasisState(np.array([0]), wires=[0])]) - @pytest.mark.parametrize("stateprep", (qml.QubitStateVector, qml.StatePrep)) - def test_qubit_state_vector_not_analytic_error(self, simulator_device_1_wire, stateprep): + def test_qubit_state_vector_not_analytic_error(self, simulator_device_1_wire): """Tests that application of StatePrep raises an error if the device is not in analytic mode.""" @@ -486,7 +484,7 @@ def test_qubit_state_vector_not_analytic_error(self, simulator_device_1_wire, st qml.DeviceError, match="The operations StatePrep and QubitStateVector are only supported in analytic mode.", ): - simulator_device_1_wire.apply([stateprep(np.array([0, 1]), wires=[0])]) + simulator_device_1_wire.apply([qml.StatePrep(np.array([0, 1]), wires=[0])]) @pytest.mark.parametrize("shots", [None]) diff --git a/tests/test_qsim_device.py b/tests/test_qsim_device.py index a2977fd..a7483ce 100644 --- a/tests/test_qsim_device.py +++ b/tests/test_qsim_device.py @@ -72,7 +72,6 @@ def circuit(x, y, z): "op, params", [ (qml.StatePrep, np.array([0, 1])), - (qml.QubitStateVector, np.array([0, 1])), (qml.BasisState, np.array([1])), ], ) @@ -108,7 +107,6 @@ def test_adjoint_ops_not_supported(self): [ "StatePrep", "BasisState", - "QubitStateVector", "CRX", "CRY", "CRZ", diff --git a/tests/test_qsimh_device.py b/tests/test_qsimh_device.py index c367f87..f59825b 100644 --- a/tests/test_qsimh_device.py +++ b/tests/test_qsimh_device.py @@ -63,7 +63,6 @@ def circuit(x, y, z): "op, params", [ (qml.StatePrep, np.array([0, 1])), - (qml.QubitStateVector, np.array([0, 1])), (qml.BasisState, np.array([1])), ], ) @@ -98,7 +97,6 @@ def test_adjoint_ops_not_supported(self): "gate", [ "StatePrep", - "QubitStateVector", "BasisState", "CRX", "CRY", diff --git a/tests/test_simulator_device.py b/tests/test_simulator_device.py index eb81411..f9fabb2 100644 --- a/tests/test_simulator_device.py +++ b/tests/test_simulator_device.py @@ -471,8 +471,7 @@ def test_basis_state_not_at_beginning_error(self, simulator_device_1_wire): ): simulator_device_1_wire.apply([qml.PauliX(0), qml.BasisState(np.array([0]), wires=[0])]) - @pytest.mark.parametrize("stateprep", (qml.StatePrep, qml.QubitStateVector)) - def test_qubit_state_vector_not_at_beginning_error(self, simulator_device_1_wire, stateprep): + def test_qubit_state_vector_not_at_beginning_error(self, simulator_device_1_wire): """Tests that application of StatePrep raises an error if is not the first operation.""" @@ -480,9 +479,9 @@ def test_qubit_state_vector_not_at_beginning_error(self, simulator_device_1_wire with pytest.raises( qml.DeviceError, - match=f"The operation {stateprep.__name__} is only supported at the beginning of a circuit.", + match=f"The operation StatePrep is only supported at the beginning of a circuit.", ): - simulator_device_1_wire.apply([qml.PauliX(0), stateprep(np.array([0, 1]), wires=[0])]) + simulator_device_1_wire.apply([qml.PauliX(0), qml.StatePrep(np.array([0, 1]), wires=[0])]) @pytest.mark.parametrize("shots", [1000]) @@ -501,8 +500,7 @@ def test_basis_state_not_analytic_error(self, simulator_device_1_wire): ): simulator_device_1_wire.apply([qml.BasisState(np.array([0]), wires=[0])]) - @pytest.mark.parametrize("stateprep", (qml.QubitStateVector, qml.StatePrep)) - def test_qubit_state_vector_not_analytic_error(self, simulator_device_1_wire, stateprep): + def test_qubit_state_vector_not_analytic_error(self, simulator_device_1_wire): """Tests that application of StatePrep raises an error if the device is not in analytic mode.""" @@ -512,7 +510,7 @@ def test_qubit_state_vector_not_analytic_error(self, simulator_device_1_wire, st qml.DeviceError, match="The operations StatePrep and QubitStateVector are only supported in analytic mode.", ): - simulator_device_1_wire.apply([stateprep(np.array([0, 1]), wires=[0])]) + simulator_device_1_wire.apply([qml.StatePrep(np.array([0, 1]), wires=[0])]) @pytest.mark.parametrize("shots", [None])