-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBreadboard.py
More file actions
50 lines (42 loc) · 1.54 KB
/
Breadboard.py
File metadata and controls
50 lines (42 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#
#Breadboard of the circuit. It includes the declaration of the necessary qubits.
#@version 1.0
#@author: Francisco Orts <francisco.orts@ual.es>
#
from projectq.ops import X
class Breadboard:
def __init__(self, eng):
#Coordinates of point i
self.xi0 = eng.allocate_qubit()
self.xi1 = eng.allocate_qubit()
self.xi2 = eng.allocate_qubit()
self.yi0 = eng.allocate_qubit()
self.yi1 = eng.allocate_qubit()
self.yi2 = eng.allocate_qubit()
#Coordinates of point j
self.xj0 = eng.allocate_qubit()
self.xj1 = eng.allocate_qubit()
self.xj2 = eng.allocate_qubit()
self.yj0 = eng.allocate_qubit()
self.yj1 = eng.allocate_qubit()
self.yj2 = eng.allocate_qubit()
#ancilla inputs
self.ai0 = eng.allocate_qubit()
self.ai1 = eng.allocate_qubit()
self.ai2 = eng.allocate_qubit()
self.ai3 = eng.allocate_qubit()
self.ai4 = eng.allocate_qubit()
self.ai5 = eng.allocate_qubit()
self.bi0 = eng.allocate_qubit()
self.bi1 = eng.allocate_qubit()
self.bi2 = eng.allocate_qubit()
self.bi3 = eng.allocate_qubit()
self.bi4 = eng.allocate_qubit()
self.bi5 = eng.allocate_qubit()
self.bi6 = eng.allocate_qubit()
#Auxiliar qubit for the subtraction. Please, refer to
#qmath.py for more info
self.cin = eng.allocate_qubit()
self.z = eng.allocate_qubit()
#output of the circuit
self.result = eng.allocate_qubit()