Exemplo n.º 1
0
 def test_single_qubit_gate_init(self):
     single_qubit_gate = AbstractGate('X', 1, 10.0, 1, False)
     self.assertEqual('X', single_qubit_gate.get_name())
     self.assertEqual(1, single_qubit_gate.get_span())
     self.assertEqual(10.0, single_qubit_gate.get_time())
     self.assertEqual(1, single_qubit_gate.get_n_parameters())
     self.assertEqual(False, single_qubit_gate.get_is_variational())
     self.assertEqual('default', single_qubit_gate.get_type())
     self.assertEqual([], single_qubit_gate.get_indexes())
     self.assertEqual([], single_qubit_gate.get_targets())
Exemplo n.º 2
0
 def test_two_qubit_gate_init(self):
     two_qubit_gate = AbstractGate('XX', 2, 10.0, 1, True)
     self.assertEqual('XX', two_qubit_gate.get_name())
     self.assertEqual(2, two_qubit_gate.get_span())
     self.assertEqual(10.0, two_qubit_gate.get_time())
     self.assertEqual(1, two_qubit_gate.get_n_parameters())
     self.assertEqual(True, two_qubit_gate.get_is_variational())
     self.assertEqual('default', two_qubit_gate.get_type())
     self.assertEqual([], two_qubit_gate.get_indexes())
     self.assertEqual([], two_qubit_gate.get_targets())
Exemplo n.º 3
0
 def test_assign_qubit_indexes(self):
     gate = AbstractGate('XXY', 3, 10.0, 1, True)
     gate.assign_qubit_indexes([0, 1, 2])
     self.assertEqual([0, 1, 2], gate.get_targets())