Skip to content

Commit

Permalink
rename branch and basics of test_s.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyman-EsteghamatRad committed Apr 5, 2024
1 parent 4be5014 commit d26b71d
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from unittest import TestCase

import numpy as np
from mqt.qudits.qudit_circuits.circuit import QuantumCircuit


def omega_d(d):
return np.e ** (2 * np.pi * 1j / d)


class TestZ(TestCase):
def setUp(self):
self.circuit_23 = QuantumCircuit(1, [2], 0)

def test___array__(self):
s_0 = self.circuit_23.s(0)
matrix_0 = s_0.to_matrix(identities=0)
assert np.allclose(np.array([[1, 0], [0, 1j]]), matrix_0)

def test_validate_parameter(self):
z = self.circuit_23.z(0)
assert z.validate_parameter()

0 comments on commit d26b71d

Please sign in to comment.