-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename branch and basics of test_s.py
- Loading branch information
1 parent
4be5014
commit d26b71d
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
tests/mqt_test/test_qudits/qudits_circuits/components/instructions/gate_set/test_s.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |