From 0d8fbd4f19999c06bd46ffc63871db70e1f724eb Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Wed, 29 Jul 2020 23:25:29 +0100 Subject: [PATCH] test/lit: Add a test for matrix binary operations No reason to believe other operations won't work the same. (More exhaustive tests to follow using embedding for comparison against NumPy.) --- artiq/test/lit/integration/array_ops.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/artiq/test/lit/integration/array_ops.py b/artiq/test/lit/integration/array_ops.py index cf511d0d8..86014cc0c 100644 --- a/artiq/test/lit/integration/array_ops.py +++ b/artiq/test/lit/integration/array_ops.py @@ -38,3 +38,12 @@ assert c[2] == 0 # assert c[0] == 4.0 # assert c[1] == 2.5 # assert c[2] == 2.0 + + +d = array([[1, 2], [3, 4]]) +e = array([[5, 6], [7, 8]]) +f = d + e +assert f[0][0] == 6 +assert f[0][1] == 8 +assert f[1][0] == 10 +assert f[1][1] == 12