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