From d73c088df769544066979e15c63fe5113d0cd9e1 Mon Sep 17 00:00:00 2001 From: Didictateur Date: Thu, 26 Oct 2023 16:09:46 +0200 Subject: [PATCH] added test --- Gate_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Gate_test.py diff --git a/Gate_test.py b/Gate_test.py new file mode 100644 index 0000000..de1d4f8 --- /dev/null +++ b/Gate_test.py @@ -0,0 +1,12 @@ +from QElephant.QuBit import * + +## for IQuBit +mq = MuBit(2) +q = mq[1] + +X(q) +assert mq._MuBit__state == [0, 1, 0, 0] +H(q) +assert mq._MuBit__state == [1/math.sqrt(2), -1/math.sqrt(2), 0, 0] +CX(mq, 0, 1) +assert mq._MuBit__state == [1/math.sqrt(2), -1/math.sqrt(2), 0, 0] \ No newline at end of file