-
Notifications
You must be signed in to change notification settings - Fork 55
/
duplicated_drivers.html
182 lines (173 loc) · 9.62 KB
/
duplicated_drivers.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<HTML>
<HEAD>
<TITLE> CloneDigger Report </TITLE>
<script type="text/javascript">
function unhide(divID) {
var item = document.getElementById(divID);
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
}
</script>
<style type="text/css">
.hidden { display: none; }
.unhidden { display: block; }
.preformatted {
border: 1px dashed #3c78b5;
font-size: 11px;
font-family: Courier;
margin: 10px;
line-height: 13px;
}
.preformattedHeader {
background-color: #f0f0f0;
border-bottom: 1px dashed #3c78b5;
padding: 3px;
text-align: center;
}
.preformattedContent {
background-color: #f0f0f0;
padding: 3px;
}
<!--
<div class="preformatted"><div class="preformattedContent">
<pre>Clone Digger
</pre>
</div></div>
-->
</style>
</HEAD>
<BODY>
<P>Source files: 3</P>
<a href = "javascript:unhide('files');">Click here to show/hide file names</a><div id="files" class="hidden"><P><B>Source files:</B><BR>drivers/bootstrap.py, <BR>drivers/__init__.py, <BR>drivers/longsequence.py</P></div>
<P>Clones detected: 5</P>
<P>54 of 345 lines are duplicates (15.65%) </P>
<P>
<B>Parameters<BR> </B>
clustering_threshold = 10<BR>
distance_threshold = 5<BR>
size_threshold = 5<BR>
hashing_depth = 1<BR>
clusterize_using_hash = False<BR>
clusterize_using_dcup = False<BR>
</P>
<B>Time elapsed</B><BR>Construction of AST : 0.06 seconds<BR>
Building statement hash : 0.00 seconds<BR>
Building patterns : 0.10 seconds<BR>
Marking similar statements : 0.09 seconds<BR>
Finding similar sequences of statements : 0.02 seconds<BR>
Refining candidates : 0.03 seconds<BR>
Total time: 0.29<BR>
Started at: Mon Aug 1 06:55:47 2016<BR>
Finished at: Mon Aug 1 06:55:47 2016
<P><B>Clone # 1</B><BR>Distance between two fragments = 4 <BR>Clone size = 10<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "drivers/bootstrap.py"<BR>The first line is 399</TD><TD></TD><TD>Source file "drivers/bootstrap.py"<BR>The first line is 393</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);">gateset_decomp_decay_diag</span>(gs):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs.gates.keys()):<BR>
output[i] = _tools.decompose_gate_matrix(gs.gates[gate]).get(<span style="color: rgb(255, 0, 0);">'decay of diagonal rotation terms'</span>, 0)<BR>
return output</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);">gateset_decomp_angle</span>(gs):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs.gates.keys()):<BR>
output[i] = _tools.decompose_gate_matrix(gs.gates[gate]).get(<span style="color: rgb(255, 0, 0);">'pi rotations'</span>, 0)<BR>
return output</TD>
</TR>
<TR>
<TD>
def <span style="color: rgb(255, 0, 0);">gateset_decomp_decay_offdiag</span>(gs):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs.gates.keys()):<BR>
output[i] = _tools.decompose_gate_matrix(gs.gates[gate]).get(<span style="color: rgb(255, 0, 0);">'decay of off diagonal rotation terms'</span>, 0)<BR>
return output</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gateset_decomp_decay_diag</span></span>(gs):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs.gates.keys()):<BR>
output[i] = _tools.decompose_gate_matrix(gs.gates[gate]).get(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">'decay of diagonal rotation terms'</span></span>, 0)<BR>
return output</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 2</B><BR>Distance between two fragments = 4 <BR>Clone size = 10<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "drivers/bootstrap.py"<BR>The first line is 315</TD><TD></TD><TD>Source file "drivers/bootstrap.py"<BR>The first line is 266</TD></TR><TR>
<TD>
print((<span style="color: rgb(255, 0, 0);">'Best SPAM weight is %s'</span>) % (<span style="color: rgb(255, 0, 0);">bestSPAMWeight</span>))</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
print((<span style="color: rgb(255, 0, 0);">'Spam weight %s'</span>) % (<span style="color: rgb(255, 0, 0);">spWind</span>))</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);">listOfBootStrapEstsG0toTargetSmallSpam</span> = []</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);">listOfBootStrapEstsNoOptG0toTargetVarSpam</span> = []</TD>
</TR>
<TR>
<TD>
for gs in listOfBootStrapEstsNoOpt:<BR>
<span style="color: rgb(255, 0, 0);">listOfBootStrapEstsG0toTargetSmallSpam</span>.append(_alg.optimize_gauge(gs, 'target', targetGateset=targetGateset, spamWeight=<span style="color: rgb(255, 0, 0);">bestSPAMWeight</span>, constrainToTP=constrainToTP, targetGatesMetric=gateMetric, targetSpamMetric=spamMetric))</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
for gs in listOfBootStrapEstsNoOpt:<BR>
<span style="color: rgb(255, 0, 0);">listOfBootStrapEstsNoOptG0toTargetVarSpam</span>.append(_alg.optimize_gauge(gs, 'target', targetGateset=targetGateset, spamWeight=<span style="color: rgb(255, 0, 0);">spW</span>, constrainToTP=constrainToTP, targetGatesMetric=gateMetric, targetSpamMetric=spamMetric))</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 3</B><BR>Distance between two fragments = 2 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "drivers/bootstrap.py"<BR>The first line is 380</TD><TD></TD><TD>Source file "drivers/bootstrap.py"<BR>The first line is 417</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);">gateset_jtracedist</span>(gs, gs_target, mxBasis='gm'):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs_target.gates.keys()):<BR>
output[i] = _tools.<span style="color: rgb(255, 0, 0);">jtracedist</span>(gs.gates[gate], gs_target.gates[gate], mxBasis=mxBasis)<BR>
return output</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);">gateset_diamonddist</span>(gs, gs_target, mxBasis='gm'):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs_target.gates.keys()):<BR>
output[i] = _tools.<span style="color: rgb(255, 0, 0);">diamonddist</span>(gs.gates[gate], gs_target.gates[gate], mxBasis=mxBasis)<BR>
return output</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 4</B><BR>Distance between two fragments = 0 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "drivers/bootstrap.py"<BR>The first line is 363</TD><TD></TD><TD>Source file "drivers/bootstrap.py"<BR>The first line is 354</TD></TR><TR>
<TD>
numResamples = len(gsList)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
numResamples = len(gsList)</TD>
</TR>
<TR>
<TD>
gsVecArray = _np.zeros([numResamples], dtype='object')</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
gsVecArray = _np.zeros([numResamples], dtype='object')</TD>
</TR>
<TR>
<TD>
for i in range(numResamples):<BR>
gsVecArray[i] = gsList[i].to_vector()</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
for i in range(numResamples):<BR>
gsVecArray[i] = gsList[i].to_vector()</TD>
</TR>
<TR>
<TD>
output_gs = target_gs.copy()</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
output_gs = target_gs.copy()</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 5</B><BR>Distance between two fragments = 2 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "drivers/bootstrap.py"<BR>The first line is 405</TD><TD></TD><TD>Source file "drivers/bootstrap.py"<BR>The first line is 393</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gateset_decomp_decay_offdiag</span></span>(gs):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs.gates.keys()):<BR>
output[i] = _tools.decompose_gate_matrix(gs.gates[gate]).get(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">'decay of off diagonal rotation terms'</span></span>, 0)<BR>
return output</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gateset_decomp_angle</span></span>(gs):<BR>
output = _np.zeros(3, dtype=float)<BR>
for i, gate in enumerate(gs.gates.keys()):<BR>
output[i] = _tools.decompose_gate_matrix(gs.gates[gate]).get(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">'pi rotations'</span></span>, 0)<BR>
return output</TD>
</TR>
</TABLE> </P> <HR>
<HR>
Clone Digger is aimed to find software clones in Python and Java programs. It is provided under the GPL license and can be downloaded from the site <a href="http://clonedigger.sourceforge.net">http://clonedigger.sourceforge.net</a>
</BODY>
</HTML>