/
duplicated_tools.html
686 lines (677 loc) · 45.9 KB
/
duplicated_tools.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
<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: 10</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>tools/rpetools.py, <BR>tools/rbtools.py, <BR>tools/basistools.py, <BR>tools/chi2fns.py, <BR>tools/__init__.py, <BR>tools/gatetools.py, <BR>tools/likelihoodfns.py, <BR>tools/matrixtools.py, <BR>tools/jamiolkowski.py, <BR>tools/listtools.py</P></div>
<P>Clones detected: 23</P>
<P>236 of 1224 lines are duplicates (19.28%) </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.28 seconds<BR>
Building statement hash : 0.00 seconds<BR>
Building patterns : 0.64 seconds<BR>
Marking similar statements : 0.75 seconds<BR>
Finding similar sequences of statements : 0.10 seconds<BR>
Refining candidates : 0.38 seconds<BR>
Total time: 2.16<BR>
Started at: Mon Aug 1 06:57:04 2016<BR>
Finished at: Mon Aug 1 06:57:06 2016
<P><B>Clone # 1</B><BR>Distance between two fragments = 3 <BR>Clone size = 12<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 602</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 805</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);">gm_to_std_transform_matrix</span>(dimOrBlockDims):<BR>
_, gateDim, blockDims = _processBlockDims(dimOrBlockDims)<BR>
<span style="color: rgb(255, 0, 0);">gmToStd</span> = _np.zeros((gateDim, gateDim), 'complex')<BR>
start = 0<BR>
for blockDim in blockDims:<BR>
mxs = <span style="color: rgb(255, 0, 0);">gm_matrices</span>(blockDim)<BR>
assert len(mxs) == (blockDim) ** (2)<BR>
for j, mx in enumerate(mxs):<BR>
<span style="color: rgb(255, 0, 0);">gmToStd</span>[start:(start) + ((blockDim) ** (2)),(start) + (j)] = mx.flatten()<BR>
start += (blockDim) ** (2)<BR>
assert start == gateDim<BR>
return <span style="color: rgb(255, 0, 0);">gmToStd</span></TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);">pp_to_std_transform_matrix</span>(dimOrBlockDims):<BR>
_, gateDim, blockDims = _processBlockDims(dimOrBlockDims)<BR>
<span style="color: rgb(255, 0, 0);">ppToStd</span> = _np.zeros((gateDim, gateDim), 'complex')<BR>
start = 0<BR>
for blockDim in blockDims:<BR>
mxs = <span style="color: rgb(255, 0, 0);">pp_matrices</span>(blockDim)<BR>
assert len(mxs) == (blockDim) ** (2)<BR>
for j, mx in enumerate(mxs):<BR>
<span style="color: rgb(255, 0, 0);">ppToStd</span>[start:(start) + ((blockDim) ** (2)),(start) + (j)] = mx.flatten()<BR>
start += (blockDim) ** (2)<BR>
assert start == gateDim<BR>
return <span style="color: rgb(255, 0, 0);">ppToStd</span></TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 2</B><BR>Distance between two fragments = 4 <BR>Clone size = 11<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 931</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 724</TD></TR><TR>
<TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape[0]</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape[0]</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);">ppToStd</span> = <span style="color: rgb(255, 0, 0);">pp_to_std_transform_matrix</span>(dimOrBlockDims)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);">gmToStd</span> = <span style="color: rgb(255, 0, 0);">gm_to_std_transform_matrix</span>(dimOrBlockDims)</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);">stdToPP</span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);">ppToStd</span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);">stdToGM</span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);">gmToStd</span>)</TD>
</TR>
<TR>
<TD>
if (len(<span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape) == 2) and (<span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape[0] == <span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape[1]):<BR>
return _np.dot(<span style="color: rgb(255, 0, 0);">ppToStd</span>, _np.dot(<span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>, <span style="color: rgb(255, 0, 0);">stdToPP</span>))<BR>
elif (len(<span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape) == 1) or ((len(<span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape) == 2) and (<span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>.shape[1] == 1)):<BR>
return _np.dot(<span style="color: rgb(255, 0, 0);">ppToStd</span>, <span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span>)<BR>
else:<BR>
raise ValueError('Invalid dimension of object - must be 1 or 2, i.e. a vector or matrix')</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if (len(<span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape) == 2) and (<span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape[0] == <span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape[1]):<BR>
return _np.dot(<span style="color: rgb(255, 0, 0);">gmToStd</span>, _np.dot(<span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>, <span style="color: rgb(255, 0, 0);">stdToGM</span>))<BR>
elif (len(<span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape) == 1) or ((len(<span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape) == 2) and (<span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>.shape[1] == 1)):<BR>
return _np.dot(<span style="color: rgb(255, 0, 0);">gmToStd</span>, <span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span>)<BR>
else:<BR>
raise ValueError('Invalid dimension of object - must be 1 or 2, i.e. a vector or matrix')</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 3</B><BR>Distance between two fragments = 4 <BR>Clone size = 11<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 434</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 385</TD></TR><TR>
<TD>
indxMap = []</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
indxMap = []</TD>
</TR>
<TR>
<TD>
start = 0</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
start = 0</TD>
</TR>
<TR>
<TD>
for blockDim in blockDims:<BR>
for i in range(start, (start) + (blockDim)):<BR>
for j in range(start, (start) + (blockDim)):<BR>
indxMap.append(((dmDim) * (i)) + (j))<BR>
start += blockDim</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
for blockDim in blockDims:<BR>
for i in range(start, (start) + (blockDim)):<BR>
for j in range(start, (start) + (blockDim)):<BR>
indxMap.append(((dmDim) * (i)) + (j))<BR>
start += blockDim</TD>
</TR>
<TR>
<TD>
for <span style="color: rgb(255, 0, 0);">i</span>, <span style="color: rgb(255, 0, 0);">fi</span> in enumerate(indxMap):<BR>
for <span style="color: rgb(255, 0, 0);">j</span>, <span style="color: rgb(255, 0, 0);">fj</span> in enumerate(indxMap):<BR>
mx[<span style="color: rgb(255, 0, 0);">i</span>,<span style="color: rgb(255, 0, 0);">j</span>] = mxInStdBasis[<span style="color: rgb(255, 0, 0);">fi</span>,<span style="color: rgb(255, 0, 0);">fj</span>]</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
for <span style="color: rgb(255, 0, 0);">i</span>, <span style="color: rgb(255, 0, 0);">fi</span> in enumerate(indxMap):<BR>
for <span style="color: rgb(255, 0, 0);">j</span>, <span style="color: rgb(255, 0, 0);">fj</span> in enumerate(indxMap):<BR>
mx[<span style="color: rgb(255, 0, 0);">fi</span>,<span style="color: rgb(255, 0, 0);">fj</span>] = mxInStdBasis[<span style="color: rgb(255, 0, 0);">i</span>,<span style="color: rgb(255, 0, 0);">j</span>]</TD>
</TR>
<TR>
<TD>
return mx</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
return mx</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 4</B><BR>Distance between two fragments = 1 <BR>Clone size = 10<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/jamiolkowski.py"<BR>The first line is 102</TD><TD></TD><TD>Source file "tools/jamiolkowski.py"<BR>The first line is 161</TD></TR><TR>
<TD>
N = <span style="color: rgb(255, 0, 0);">gateMxInStdBasis</span>.shape[0]</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
N = <span style="color: rgb(255, 0, 0);">choiMx</span>.shape[0]</TD>
</TR>
<TR>
<TD>
dmDim = int(round(_np.sqrt(N)))</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
dmDim = int(round(_np.sqrt(N)))</TD>
</TR>
<TR>
<TD>
if choiMxBasis == 'gm':<BR>
BVec = _bt.gm_matrices(dmDim)<BR>
elif choiMxBasis == 'std':<BR>
BVec = _bt.std_matrices(dmDim)<BR>
elif choiMxBasis == 'pp':<BR>
BVec = _bt.pp_matrices(dmDim)<BR>
else:<BR>
raise ValueError(('Invalid choiMxBasis: %s') % (choiMxBasis))</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
if choiMxBasis == 'gm':<BR>
BVec = _bt.gm_matrices(dmDim)<BR>
elif choiMxBasis == 'std':<BR>
BVec = _bt.std_matrices(dmDim)<BR>
elif choiMxBasis == 'pp':<BR>
BVec = _bt.pp_matrices(dmDim)<BR>
else:<BR>
raise ValueError(('Invalid choiMxBasis: %s') % (choiMxBasis))</TD>
</TR>
<TR>
<TD>
assert len(BVec) == N</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
assert len(BVec) == N</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 5</B><BR>Distance between two fragments = 1 <BR>Clone size = 9<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 288</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 777</TD></TR><TR>
<TD>
def is_integer(x):<BR>
return bool(abs((x) - (round(x))) < 1e-06)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
def is_integer(x):<BR>
return bool(abs((x) - (round(x))) < 1e-06)</TD>
</TR>
<TR>
<TD>
if type(<span style="color: rgb(255, 0, 0);">dimOrBlockDims</span>) != int:<BR>
if (type(<span style="color: rgb(255, 0, 0);">dimOrBlockDims</span>) in (list, tuple)) and (len(<span style="color: rgb(255, 0, 0);">dimOrBlockDims</span>) == 1):<BR>
<span style="color: rgb(255, 0, 0);">dimOrBlockDims</span> = <span style="color: rgb(255, 0, 0);">dimOrBlockDims</span>[0]<BR>
else:<BR>
raise ValueError('Dimension for Pauli tensor product matrices must be an *integer* power of 2')</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if type(<span style="color: rgb(255, 0, 0);">dim</span>) != int:<BR>
if (type(<span style="color: rgb(255, 0, 0);">dim</span>) in (list, tuple)) and (len(<span style="color: rgb(255, 0, 0);">dim</span>) == 1):<BR>
<span style="color: rgb(255, 0, 0);">dim</span> = <span style="color: rgb(255, 0, 0);">dim</span>[0]<BR>
else:<BR>
raise ValueError('Dimension for Pauli tensor product matrices must be an *integer* power of 2')</TD>
</TR>
<TR>
<TD>
nQubits = _np.log2(<span style="color: rgb(255, 0, 0);">dimOrBlockDims</span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
nQubits = _np.log2(<span style="color: rgb(255, 0, 0);">dim</span>)</TD>
</TR>
<TR>
<TD>
if not is_integer(nQubits):<BR>
raise ValueError('Dimension for Pauli tensor product matrices must be an integer *power of 2*')</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
if not is_integer(nQubits):<BR>
raise ValueError('Dimension for Pauli tensor product matrices must be an integer *power of 2*')</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 6</B><BR>Distance between two fragments = 4 <BR>Clone size = 8<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 1193</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 1219</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);">stdmx_to_ppvec</span>(m):<BR>
assert (len(m.shape) == 2) and (m.shape[0] == m.shape[1])<BR>
dim = m.shape[0]<BR>
<span style="color: rgb(255, 0, 0);">ppMxs</span> = <span style="color: rgb(255, 0, 0);">pp_matrices</span>(dim)<BR>
v = _np.empty(((dim) ** (2), 1))<BR>
for i, <span style="color: rgb(255, 0, 0);">ppMx</span> in enumerate(<span style="color: rgb(255, 0, 0);">ppMxs</span>):<BR>
v[i,0] = _np.real(_mt.trace(_np.dot(<span style="color: rgb(255, 0, 0);">ppMx</span>, m)))<BR>
return v</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);">stdmx_to_gmvec</span>(m):<BR>
assert (len(m.shape) == 2) and (m.shape[0] == m.shape[1])<BR>
dim = m.shape[0]<BR>
<span style="color: rgb(255, 0, 0);">gmMxs</span> = <span style="color: rgb(255, 0, 0);">gm_matrices</span>(dim)<BR>
v = _np.empty(((dim) ** (2), 1))<BR>
for i, <span style="color: rgb(255, 0, 0);">gmMx</span> in enumerate(<span style="color: rgb(255, 0, 0);">gmMxs</span>):<BR>
v[i,0] = _np.real(_mt.trace(_np.dot(<span style="color: rgb(255, 0, 0);">gmMx</span>, m)))<BR>
return v</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 7</B><BR>Distance between two fragments = 4 <BR>Clone size = 8<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 1219</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 1246</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdmx_to_gmvec</span></span>(m):<BR>
assert (len(m.shape) == 2) and (m.shape[0] == m.shape[1])<BR>
dim = m.shape[0]<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMxs</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gm_matrices</span></span>(dim)<BR>
v = _np.empty(((dim) ** (2), 1))<BR>
for i, <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMx</span></span> in enumerate(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMxs</span></span>):<BR>
v[i,0] = _np.real(_mt.trace(_np.dot(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMx</span></span>, m)))<BR>
return v</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);">stdmx_to_stdvec</span>(m):<BR>
assert (len(m.shape) == 2) and (m.shape[0] == m.shape[1])<BR>
dim = m.shape[0]<BR>
<span style="color: rgb(255, 0, 0);">stdMxs</span> = <span style="color: rgb(255, 0, 0);">std_matrices</span>(dim)<BR>
v = _np.empty(((dim) ** (2), 1))<BR>
for i, <span style="color: rgb(255, 0, 0);">stdMx</span> in enumerate(<span style="color: rgb(255, 0, 0);">stdMxs</span>):<BR>
v[i,0] = _np.real(_mt.trace(_np.dot(<span style="color: rgb(255, 0, 0);">stdMx</span>, m)))<BR>
return v</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 8</B><BR>Distance between two fragments = 4 <BR>Clone size = 8<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 1193</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 1246</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdmx_to_ppvec</span></span>(m):<BR>
assert (len(m.shape) == 2) and (m.shape[0] == m.shape[1])<BR>
dim = m.shape[0]<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMxs</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">pp_matrices</span></span>(dim)<BR>
v = _np.empty(((dim) ** (2), 1))<BR>
for i, <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMx</span></span> in enumerate(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMxs</span></span>):<BR>
v[i,0] = _np.real(_mt.trace(_np.dot(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMx</span></span>, m)))<BR>
return v</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdmx_to_stdvec</span></span>(m):<BR>
assert (len(m.shape) == 2) and (m.shape[0] == m.shape[1])<BR>
dim = m.shape[0]<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMxs</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">std_matrices</span></span>(dim)<BR>
v = _np.empty(((dim) ** (2), 1))<BR>
for i, <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMx</span></span> in enumerate(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMxs</span></span>):<BR>
v[i,0] = _np.real(_mt.trace(_np.dot(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMx</span></span>, m)))<BR>
return v</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 9</B><BR>Distance between two fragments = 4 <BR>Clone size = 7<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 1117</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 1143</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);">ppvec_to_stdmx</span>(v):<BR>
dim = int(_np.sqrt(len(v)))<BR>
<span style="color: rgb(255, 0, 0);">ppMxs</span> = <span style="color: rgb(255, 0, 0);">pp_matrices</span>(dim)<BR>
ret = _np.zeros((dim, dim), 'complex')<BR>
for i, <span style="color: rgb(255, 0, 0);">ppMx</span> in enumerate(<span style="color: rgb(255, 0, 0);">ppMxs</span>):<BR>
ret += (float(v[i])) * (<span style="color: rgb(255, 0, 0);">ppMx</span>)<BR>
return ret</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);">gmvec_to_stdmx</span>(v):<BR>
dim = int(_np.sqrt(len(v)))<BR>
<span style="color: rgb(255, 0, 0);">gmMxs</span> = <span style="color: rgb(255, 0, 0);">gm_matrices</span>(dim)<BR>
ret = _np.zeros((dim, dim), 'complex')<BR>
for i, <span style="color: rgb(255, 0, 0);">gmMx</span> in enumerate(<span style="color: rgb(255, 0, 0);">gmMxs</span>):<BR>
ret += (float(v[i])) * (<span style="color: rgb(255, 0, 0);">gmMx</span>)<BR>
return ret</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 10</B><BR>Distance between two fragments = 4 <BR>Clone size = 7<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 1143</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 1167</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmvec_to_stdmx</span></span>(v):<BR>
dim = int(_np.sqrt(len(v)))<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMxs</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gm_matrices</span></span>(dim)<BR>
ret = _np.zeros((dim, dim), 'complex')<BR>
for i, <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMx</span></span> in enumerate(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMxs</span></span>):<BR>
ret += (float(v[i])) * (<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmMx</span></span>)<BR>
return ret</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);">stdvec_to_stdmx</span>(v):<BR>
dim = int(_np.sqrt(len(v)))<BR>
<span style="color: rgb(255, 0, 0);">stdMxs</span> = <span style="color: rgb(255, 0, 0);">std_matrices</span>(dim)<BR>
ret = _np.zeros((dim, dim), 'complex')<BR>
for i, <span style="color: rgb(255, 0, 0);">stdMx</span> in enumerate(<span style="color: rgb(255, 0, 0);">stdMxs</span>):<BR>
ret += (float(v[i])) * (<span style="color: rgb(255, 0, 0);">stdMx</span>)<BR>
return ret</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 11</B><BR>Distance between two fragments = 4 <BR>Clone size = 7<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 1117</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 1167</TD></TR><TR>
<TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppvec_to_stdmx</span></span>(v):<BR>
dim = int(_np.sqrt(len(v)))<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMxs</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">pp_matrices</span></span>(dim)<BR>
ret = _np.zeros((dim, dim), 'complex')<BR>
for i, <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMx</span></span> in enumerate(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMxs</span></span>):<BR>
ret += (float(v[i])) * (<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppMx</span></span>)<BR>
return ret</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
def <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdvec_to_stdmx</span></span>(v):<BR>
dim = int(_np.sqrt(len(v)))<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMxs</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">std_matrices</span></span>(dim)<BR>
ret = _np.zeros((dim, dim), 'complex')<BR>
for i, <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMx</span></span> in enumerate(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMxs</span></span>):<BR>
ret += (float(v[i])) * (<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdMx</span></span>)<BR>
return ret</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 12</B><BR>Distance between two fragments = 4 <BR>Clone size = 6<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/rpetools.py"<BR>The first line is 320</TD><TD></TD><TD>Source file "tools/rpetools.py"<BR>The first line is 316</TD></TR><TR>
<TD>
try:<BR>
<span style="color: rgb(255, 0, 0);">epsilonTrue</span> = trueGateset.<span style="color: rgb(255, 0, 0);">epsilonTrue</span><BR>
except:<BR>
<span style="color: rgb(255, 0, 0);">epsilonTrue</span> = <span style="color: rgb(255, 0, 0);">extract_epsilon</span>(trueGateset)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
try:<BR>
<span style="color: rgb(255, 0, 0);">alphaTrue</span> = trueGateset.<span style="color: rgb(255, 0, 0);">alphaTrue</span><BR>
except:<BR>
<span style="color: rgb(255, 0, 0);">alphaTrue</span> = <span style="color: rgb(255, 0, 0);">extract_alpha</span>(trueGateset)</TD>
</TR>
<TR>
<TD>
try:<BR>
<span style="color: rgb(255, 0, 0);">thetaTrue</span> = trueGateset.<span style="color: rgb(255, 0, 0);">thetaTrue</span><BR>
except:<BR>
<span style="color: rgb(255, 0, 0);">thetaTrue</span> = <span style="color: rgb(255, 0, 0);">extract_theta</span>(trueGateset)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
try:<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">epsilonTrue</span></span> = trueGateset.<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">epsilonTrue</span></span><BR>
except:<BR>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">epsilonTrue</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">extract_epsilon</span></span>(trueGateset)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 13</B><BR>Distance between two fragments = 0 <BR>Clone size = 6<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/likelihoodfns.py"<BR>The first line is 257</TD><TD></TD><TD>Source file "tools/likelihoodfns.py"<BR>The first line is 378</TD></TR><TR>
<TD>
S = ((countVecMx) / (min_p)) - (totalCntVec[None,None:None])</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
S = ((countVecMx) / (min_p)) - (totalCntVec[None,None:None])</TD>
</TR>
<TR>
<TD>
S2 = ((-0.5) * (countVecMx)) / ((min_p) ** (2))</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
S2 = ((-0.5) * (countVecMx)) / ((min_p) ** (2))</TD>
</TR>
<TR>
<TD>
v = ((countVecMx) * (_np.log(pos_probs))) - ((totalCntVec[None,None:None]) * (pos_probs))</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = ((countVecMx) * (_np.log(pos_probs))) - ((totalCntVec[None,None:None]) * (pos_probs))</TD>
</TR>
<TR>
<TD>
v = _np.minimum(v, 0)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = _np.minimum(v, 0)</TD>
</TR>
<TR>
<TD>
v = _np.where(probs < min_p, ((v) + ((S) * ((probs) - (min_p)))) + ((S2) * (((probs) - (min_p)) ** (2))), v)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = _np.where(probs < min_p, ((v) + ((S) * ((probs) - (min_p)))) + ((S2) * (((probs) - (min_p)) ** (2))), v)</TD>
</TR>
<TR>
<TD>
v = _np.where(countVecMx == 0, (-totalCntVec[None,None:None]) * (_np.where(probs >= a, probs, ((((-1.0) / ((3) * ((a) ** (2)))) * ((probs) ** (3))) + (((probs) ** (2)) / (a))) + ((a) / (3.0)))), v)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = _np.where(countVecMx == 0, (-totalCntVec[None,None:None]) * (_np.where(probs >= a, probs, ((((-1.0) / ((3) * ((a) ** (2)))) * ((probs) ** (3))) + (((probs) ** (2)) / (a))) + ((a) / (3.0)))), v)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 14</B><BR>Distance between two fragments = 0 <BR>Clone size = 6<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/likelihoodfns.py"<BR>The first line is 266</TD><TD></TD><TD>Source file "tools/likelihoodfns.py"<BR>The first line is 395</TD></TR><TR>
<TD>
S = (countVecMx) / (min_p)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
S = (countVecMx) / (min_p)</TD>
</TR>
<TR>
<TD>
S2 = ((-0.5) * (countVecMx)) / ((min_p) ** (2))</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
S2 = ((-0.5) * (countVecMx)) / ((min_p) ** (2))</TD>
</TR>
<TR>
<TD>
v = (countVecMx) * (_np.log(pos_probs))</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = (countVecMx) * (_np.log(pos_probs))</TD>
</TR>
<TR>
<TD>
v = _np.minimum(v, 0)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = _np.minimum(v, 0)</TD>
</TR>
<TR>
<TD>
v = _np.where(probs < min_p, ((v) + ((S) * ((probs) - (min_p)))) + ((S2) * (((probs) - (min_p)) ** (2))), v)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = _np.where(probs < min_p, ((v) + ((S) * ((probs) - (min_p)))) + ((S2) * (((probs) - (min_p)) ** (2))), v)</TD>
</TR>
<TR>
<TD>
v = _np.where(countVecMx == 0, 0.0, v)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
v = _np.where(countVecMx == 0, 0.0, v)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 15</B><BR>Distance between two fragments = 2 <BR>Clone size = 6<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/gatetools.py"<BR>The first line is 44</TD><TD></TD><TD>Source file "tools/gatetools.py"<BR>The first line is 51</TD></TR><TR>
<TD>
evals, U = _np.linalg.eig(<span style="color: rgb(255, 0, 0);">A</span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
evals, U = _np.linalg.eig(<span style="color: rgb(255, 0, 0);">B</span>)</TD>
</TR>
<TR>
<TD>
if len([ev for ev in evals if abs(ev) > 1e-08]) == 1:<BR>
ivec = _np.argmax(evals)<BR>
vec = U[None:None,ivec:(ivec) + (1)]<BR>
F = _np.dot(_np.conjugate(_np.transpose(vec)), _np.dot(<span style="color: rgb(255, 0, 0);">B</span>, vec)).real<BR>
return F</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if len([ev for ev in evals if abs(ev) > 1e-08]) == 1:<BR>
ivec = _np.argmax(evals)<BR>
vec = U[None:None,ivec:(ivec) + (1)]<BR>
F = _np.dot(_np.conjugate(_np.transpose(vec)), _np.dot(<span style="color: rgb(255, 0, 0);">A</span>, vec)).real<BR>
return F</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 16</B><BR>Distance between two fragments = 3 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 875</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 669</TD></TR><TR>
<TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(mxInStdBasis.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == mxInStdBasis.shape[0]</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(mxInStdBasis.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == mxInStdBasis.shape[0]</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);">ppToStd</span> = <span style="color: rgb(255, 0, 0);">pp_to_std_transform_matrix</span>(dimOrBlockDims)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);">gmToStd</span> = <span style="color: rgb(255, 0, 0);">gm_to_std_transform_matrix</span>(dimOrBlockDims)</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);">stdToPP</span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);">ppToStd</span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);">stdToGM</span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);">gmToStd</span>)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 17</B><BR>Distance between two fragments = 1 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 875</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 931</TD></TR><TR>
<TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);">mxInStdBasis</span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);">mxInStdBasis</span>.shape[0]</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span></span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span></span>.shape[0]</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);">ppToStd</span> = <span style="color: rgb(255, 0, 0);">pp_to_std_transform_matrix</span>(dimOrBlockDims)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
<span style="color: rgb(255, 0, 0);">ppToStd</span> = <span style="color: rgb(255, 0, 0);">pp_to_std_transform_matrix</span>(dimOrBlockDims)</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);">stdToPP</span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);">ppToStd</span>)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
<span style="color: rgb(255, 0, 0);">stdToPP</span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);">ppToStd</span>)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 18</B><BR>Distance between two fragments = 4 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 875</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 724</TD></TR><TR>
<TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInStdBasis</span></span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInStdBasis</span></span>.shape[0]</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span></span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span></span>.shape[0]</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppToStd</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">pp_to_std_transform_matrix</span></span>(dimOrBlockDims)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gm_to_std_transform_matrix</span></span>(dimOrBlockDims)</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdToPP</span></span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppToStd</span></span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdToGM</span></span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span>)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 19</B><BR>Distance between two fragments = 4 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 669</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 931</TD></TR><TR>
<TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);">mxInStdBasis</span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);">mxInStdBasis</span>.shape[0]</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span></span></span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInPauliProdBasis</span></span></span>.shape[0]</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gm_to_std_transform_matrix</span></span>(dimOrBlockDims)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppToStd</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">pp_to_std_transform_matrix</span></span>(dimOrBlockDims)</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdToGM</span></span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdToPP</span></span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">ppToStd</span></span>)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 20</B><BR>Distance between two fragments = 1 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 669</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 724</TD></TR><TR>
<TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInStdBasis</span></span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInStdBasis</span></span>.shape[0]</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if dimOrBlockDims is None:<BR>
dimOrBlockDims = int(round(_np.sqrt(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span></span></span>.shape[0])))<BR>
assert (dimOrBlockDims) ** (2) == <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">mxInGellMannBasis</span></span></span>.shape[0]</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gm_to_std_transform_matrix</span></span>(dimOrBlockDims)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span> = <span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gm_to_std_transform_matrix</span></span>(dimOrBlockDims)</TD>
</TR>
<TR>
<TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdToGM</span></span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span>)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">stdToGM</span></span> = _np.linalg.inv(<span style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">gmToStd</span></span>)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 21</B><BR>Distance between two fragments = 0 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/likelihoodfns.py"<BR>The first line is 240</TD><TD></TD><TD>Source file "tools/likelihoodfns.py"<BR>The first line is 358</TD></TR><TR>
<TD>
totalCntVec = _np.sum(countVecMx, axis=0)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
totalCntVec = _np.sum(countVecMx, axis=0)</TD>
</TR>
<TR>
<TD>
a = radius</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
a = radius</TD>
</TR>
<TR>
<TD>
min_p = minProbClip</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
min_p = minProbClip</TD>
</TR>
<TR>
<TD>
if evalTree is None:<BR>
evalTree = gateset.bulk_evaltree(gatestring_list)</TD>
<TD style="width: 10px;" BGCOLOR=AQUA> </TD><TD>
if evalTree is None:<BR>
evalTree = gateset.bulk_evaltree(gatestring_list)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 22</B><BR>Distance between two fragments = 3 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 895</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 689</TD></TR><TR>
<TD>
<span style="color: rgb(255, 0, 0);">pp</span> = _np.dot(<span style="color: rgb(255, 0, 0);">stdToPP</span>, mxInStdBasis)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);">gm</span> = _np.dot(<span style="color: rgb(255, 0, 0);">stdToGM</span>, mxInStdBasis)</TD>
</TR>
<TR>
<TD>
if _np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">pp</span>)) > 1e-08:<BR>
raise ValueError((<span style="color: rgb(255, 0, 0);">'Pauil-product vector has non-zero imaginary part (%g)!'</span>) % (_np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">pp</span>))))</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if _np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">gm</span>)) > 1e-08:<BR>
raise ValueError((<span style="color: rgb(255, 0, 0);">'Gell-Mann vector has non-zero imaginary part (%g)!'</span>) % (_np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">gm</span>))))</TD>
</TR>
<TR>
<TD>
return _np.real(<span style="color: rgb(255, 0, 0);">pp</span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
return _np.real(<span style="color: rgb(255, 0, 0);">gm</span>)</TD>
</TR>
</TABLE> </P> <HR><BR>
<P><B>Clone # 23</B><BR>Distance between two fragments = 4 <BR>Clone size = 5<TABLE NOWRAP WIDTH=100% BORDER=1><TD>Source file "tools/basistools.py"<BR>The first line is 883</TD><TD></TD><TD>Source file "tools/basistools.py"<BR>The first line is 677</TD></TR><TR>
<TD>
<span style="color: rgb(255, 0, 0);">pp</span> = _np.dot(<span style="color: rgb(255, 0, 0);">stdToPP</span>, _np.dot(mxInStdBasis, <span style="color: rgb(255, 0, 0);">ppToStd</span>))</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
<span style="color: rgb(255, 0, 0);">gm</span> = _np.dot(<span style="color: rgb(255, 0, 0);">stdToGM</span>, _np.dot(mxInStdBasis, <span style="color: rgb(255, 0, 0);">gmToStd</span>))</TD>
</TR>
<TR>
<TD>
if _np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">pp</span>)) > 1e-08:<BR>
raise ValueError((<span style="color: rgb(255, 0, 0);">'Pauil-product matrix has non-zero imaginary part (%g)!'</span>) % (_np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">pp</span>))))</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
if _np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">gm</span>)) > 1e-08:<BR>
raise ValueError((<span style="color: rgb(255, 0, 0);">'Gell-Mann matrix has non-zero imaginary part (%g)!'</span>) % (_np.linalg.norm(_np.imag(<span style="color: rgb(255, 0, 0);">gm</span>))))</TD>
</TR>
<TR>
<TD>
return _np.real(<span style="color: rgb(255, 0, 0);">pp</span>)</TD>
<TD style="width: 10px;" BGCOLOR=RED> </TD><TD>
return _np.real(<span style="color: rgb(255, 0, 0);">gm</span>)</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>