diff --git a/tests/ops/qubit/test_observables.py b/tests/ops/qubit/test_observables.py index 51c8996bb6f..30481460102 100644 --- a/tests/ops/qubit/test_observables.py +++ b/tests/ops/qubit/test_observables.py @@ -369,8 +369,8 @@ def test_hermitian_decomposition(self, observable): ) A_decomp = qml.Hermitian(observable, wires=list(range(num_wires))).decomposition() - assert np.allclose(A_decomp_static[0].matrix(), observable, rtol=0) - assert np.allclose(A_decomp[0].matrix(), observable, rtol=0) + assert np.allclose(qml.matrix(A_decomp_static[0]), observable, rtol=0) + assert np.allclose(qml.matrix(A_decomp[0]), observable, rtol=0) @pytest.mark.parametrize("observable, eigvals, eigvecs", EIGVALS_TEST_DATA) def test_hermitian_diagonalizing_gates(self, observable, eigvals, eigvecs, tol, mocker):