From e9e27e186ccd92d3ba53377f872c49e0eda29129 Mon Sep 17 00:00:00 2001 From: albi3ro Date: Thu, 11 Aug 2022 10:30:06 -0400 Subject: [PATCH 1/2] add test --- tests/ops/op_math/test_adjoint_op.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/ops/op_math/test_adjoint_op.py b/tests/ops/op_math/test_adjoint_op.py index 4c2bfe22a3c..b381ea72315 100644 --- a/tests/ops/op_math/test_adjoint_op.py +++ b/tests/ops/op_math/test_adjoint_op.py @@ -502,6 +502,15 @@ def test_do_queue_False(self): class TestMatrix: """Test the matrix method for a variety of interfaces.""" + def test_batching_error(self): + """Test that a MatrixUndefinedError is raised if the base is batched.""" + x = qml.numpy.array([0.1, 0.2, 0.3]) + base = qml.RX(x, wires=0) + op = Adjoint(base) + + with pytest.raises(qml.operation.MatrixUndefinedError): + op.matrix() + def check_matrix(self, x, interface): """Compares matrices in a interface independent manner.""" base = qml.RX(x, wires=0) From d576a56c112a01341e1d2f264ca9fed7fe31996a Mon Sep 17 00:00:00 2001 From: Romain Moyard Date: Thu, 11 Aug 2022 16:39:48 +0200 Subject: [PATCH 2/2] Trigger CI