def test_z(self): """test 'z' gate """ bk = Backend('qlazy_stabilizer_simulator') qc = QComp(qubit_num=1, backend=bk) res = qc.z(0).run(reset_qubits=False) actual = qc.stab.get_str() expect = " Z\n" self.assertEqual(actual, expect) qc.free()
def test_z(self): """test 'z' gate """ bk = Backend('qlazy_qstate_simulator') qc = QComp(qubit_num=1, backend=bk) res = qc.z(0).run(reset_qubits=False) actual = qc.qstate.amp expect = np.array([1.0, 0.0]) ans = equal_vectors(actual, expect) qc.free() self.assertEqual(ans, True)