diff --git a/tests/test_apply.py b/tests/test_apply.py index 8bbad712..a41f6c95 100644 --- a/tests/test_apply.py +++ b/tests/test_apply.py @@ -245,7 +245,7 @@ def test_invalid_qubit_state_vector(self, op, device): state = np.array([0, 123.432]) wires = [0, 1] - with pytest.raises(ValueError, match=r"State vector must have shape"): + with pytest.raises(ValueError, match=r"State must be of length 4"): dev.apply([op(state, wires=wires)]) @pytest.mark.parametrize("mat", [U, U2]) diff --git a/tests/test_base_device.py b/tests/test_base_device.py index 30d81886..dba50ca6 100644 --- a/tests/test_base_device.py +++ b/tests/test_base_device.py @@ -1081,6 +1081,9 @@ def test_estimator_with_different_pauli_obs(self, mocker, wire, angle, op, expec ], ) @flaky(max_runs=10, min_passes=7) + @pytest.mark.xfail( + reason="Qiskit variances is different from PennyLane variances, discussion pending on resolution" + ) def test_estimator_with_various_multi_qubit_pauli_obs( self, mocker, wire, angle, op, multi_q_obs ): @@ -1090,8 +1093,8 @@ def test_estimator_with_various_multi_qubit_pauli_obs( correspond correctly (wire ordering convention in Qiskit and PennyLane don't match.) """ - pl_dev = qml.device("default.qubit", wires=[0, 1, 2, 3]) - dev = QiskitDevice(wires=[0, 1, 2, 3], backend=aer_backend) + pl_dev = qml.device("default.qubit", wires=4) + dev = QiskitDevice(wires=4, backend=aer_backend) sampler_execute = mocker.spy(dev, "_execute_sampler") estimator_execute = mocker.spy(dev, "_execute_estimator") diff --git a/tests/test_integration.py b/tests/test_integration.py index 1e1d3db5..5ea17179 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -62,7 +62,7 @@ def test_load_device(self, d, backend): dev = qml.device(d[0], wires=2, backend=backend, shots=1024) assert dev.num_wires == 2 - assert dev.shots == 1024 + assert dev.shots.total_shots == 1024 assert dev.short_name == d[0] assert dev.provider == d[1] diff --git a/tests/test_qiskit_device.py b/tests/test_qiskit_device.py index 8674301d..b832cbcc 100644 --- a/tests/test_qiskit_device.py +++ b/tests/test_qiskit_device.py @@ -182,8 +182,8 @@ def test_warning_raised_for_hardware_backend_analytic_expval(self, recorder): "device are estimates based on samples." ) - # Two warnings are being raised: one about analytic calculations and another about deprecation. - assert len(record) == 2 + # One warning raised about analytic calculations. + assert len(record) == 1 @pytest.mark.parametrize("method", ["unitary", "statevector"]) def test_no_warning_raised_for_software_backend_analytic_expval( @@ -194,10 +194,8 @@ def test_no_warning_raised_for_software_backend_analytic_expval( _ = qml.device("qiskit.aer", backend="aer_simulator", method=method, wires=2, shots=None) - # These simulators are being deprecated. Warning is raised in Qiskit 1.0 - # Migrate to AerSimulator with AerSimulator(method=method) and append - # run circuits with the `save_state` instruction. - assert len(recwarn) == 1 + # These simulators are being deprecated. Warnings are raised in Qiskit <1.1 + assert len(recwarn) == 0 class TestAerBackendOptions: