Beispiel #1
0
 def test_print_method_three_qubits_constant(self):
     gate = AbstractGate('XXY', 3, 10.0, 1, False)
     gate.assign_qubit_indexes([0, 1, 2])
     gate.assign_parameter_indexes([1])
     self.assertEqual(gate.__str__(), 'XXY\t0,1,2\tc1')
Beispiel #2
0
 def test_print_method_one_qubit_constant(self):
     gate = AbstractGate('X', 1, 10.0, 1, False)
     gate.assign_qubit_indexes([0])
     gate.assign_parameter_indexes([1])
     self.assertEqual(gate.__str__(), 'X\t0\tc1')
Beispiel #3
0
 def test_print_method_three_qubits_variational(self):
     gate = AbstractGate('XXY', 3, 10.0, 1, True)
     gate.assign_qubit_indexes([0, 1, 2])
     gate.assign_parameter_indexes([1])
     self.assertEqual(gate.__str__(), 'XXY\t0,1,2\tv1')
Beispiel #4
0
 def test_print_method_one_qubit_variational(self):
     gate = AbstractGate('X', 1, 10.0, 1, True)
     gate.assign_qubit_indexes([0])
     gate.assign_parameter_indexes([1])
     self.assertEqual(gate.__str__(), 'X\t0\tv1')