1
1
package org .quisl .framework .java .circuits .classical ;
2
2
3
3
import org .quisl .framework .java .circuits .Circuit ;
4
- import org .quisl .framework .java .circuits .common .CircuitPrefixes ;
5
4
import org .quisl .framework .java .circuits .utils .classical .ClassicalMoment ;
5
+ import org .quisl .framework .java .common .ComputingPrefixes ;
6
6
import org .quisl .framework .java .registers .classical .ClassicalRegister ;
7
+ import org .quisl .framework .java .units .computing .classical .binary .deterministic .bits .Bit ;
7
8
8
9
import java .util .Map ;
9
10
import java .util .concurrent .ConcurrentHashMap ;
@@ -16,8 +17,8 @@ public class ClassicalCircuit extends Circuit {
16
17
17
18
public ClassicalCircuit (Long id , ClassicalRegister ... classicalRegisters ) {
18
19
19
- super ( id , CircuitPrefixes . CLASSICAL_CIRCUIT . getCircuitPrefix (),
20
- ( "cl-circ-" + id ), classicalRegisters );
20
+ super ( id , ComputingPrefixes . CLASSICAL_PREFIX . getComputingPrefix (),
21
+ ( "cl-circ-" + id ), classicalRegisters );
21
22
22
23
this .classicalRegisters = new ConcurrentHashMap <>();
23
24
@@ -39,8 +40,7 @@ public ClassicalCircuit(Long id, ClassicalRegister ... classicalRegisters) {
39
40
40
41
public ClassicalCircuit (Long id , String classicalCircuitName , ClassicalRegister ... classicalRegisters ) {
41
42
42
- super ( id , CircuitPrefixes .CLASSICAL_CIRCUIT .getCircuitPrefix (),
43
- classicalCircuitName , classicalRegisters );
43
+ super ( id , ComputingPrefixes .CLASSICAL_PREFIX .getComputingPrefix (), classicalCircuitName , classicalRegisters );
44
44
45
45
this .classicalRegisters = new ConcurrentHashMap <>();
46
46
@@ -61,4 +61,41 @@ public ClassicalCircuit(Long id, String classicalCircuitName, ClassicalRegister
61
61
}
62
62
63
63
64
+ public void NOT (Long bitId ) {
65
+
66
+ boolean isBitFound = false ;
67
+
68
+ Bit bitFound = null ;
69
+
70
+
71
+ for (ClassicalRegister classicalRegister : this .classicalRegisters .values ()) {
72
+
73
+ Map <Long , Bit > classicalRegisterBits = classicalRegister .getBits ();
74
+
75
+ if (classicalRegisterBits .containsKey (bitId )) {
76
+
77
+ isBitFound = true ;
78
+
79
+ bitFound = classicalRegisterBits .get (bitId );
80
+
81
+ break ;
82
+
83
+ }
84
+
85
+ }
86
+
87
+
88
+ if ( isBitFound ) {
89
+
90
+ NOT (bitId );
91
+
92
+ }
93
+ else {
94
+
95
+
96
+
97
+ }
98
+
99
+ }
100
+
64
101
}
0 commit comments