Source files: 14

Click here to show/hide file names

Clones detected: 31

301 of 1283 lines are duplicates (23.46%)

Parameters
clustering_threshold = 10
distance_threshold = 5
size_threshold = 5
hashing_depth = 1
clusterize_using_hash = False
clusterize_using_dcup = False

Time elapsed
Construction of AST : 0.29 seconds
Building statement hash : 0.00 seconds
Building patterns : 0.48 seconds
Marking similar statements : 0.46 seconds
Finding similar sequences of statements : 0.16 seconds
Refining candidates : 0.71 seconds
Total time: 2.10
Started at: Mon Aug 1 06:55:24 2016
Finished at: Mon Aug 1 06:55:26 2016

Clone # 1
Distance between two fragments = 1
Clone size = 13
Source file "construction/gatesetconstruction.py"
The first line is 171
Source file "construction/gatesetconstruction.py"
The first line is 455
tensorBlkIndices = {} tensorBlkIndices = {}
startIndex = [] startIndex = []
M = 0 M = 0
assert len(stateSpaceDims) == len(stateSpaceLabels) assert len(blockDims) == len(stateSpaceLabels)
for k, blockDim in enumerate(stateSpaceDims):
    startIndex.append(M)
    M += blockDim
    tensorBlkDim = 1
    for s in stateSpaceLabels[k]:
        tensorBlkIndices[s] = k
        if s.startswith('Q'):
            tensorBlkDim *= 2
        elif s.startswith('L'):
            tensorBlkDim *= 1
        else:
            raise ValueError(('Invalid state space specifier: %s') % (s))
    if tensorBlkDim != blockDim:
        raise ValueError(('State labels %s for tensor product block %d have dimension %d != given dimension %d') % ((stateSpaceLabels[k], k, tensorBlkDim, blockDim)))
for k, blockDim in enumerate(blockDims):
    startIndex.append(M)
    M += blockDim
    tensorBlkDim = 1
    for s in stateSpaceLabels[k]:
        tensorBlkIndices[s] = k
        if s.startswith('Q'):
            tensorBlkDim *= 2
        elif s.startswith('L'):
            tensorBlkDim *= 1
        else:
            raise ValueError(('Invalid state space specifier: %s') % (s))
    if tensorBlkDim != blockDim:
        raise ValueError(('State labels %s for tensor product block %d have dimension %d != given dimension %d') % ((stateSpaceLabels[k], k, tensorBlkDim, blockDim)))



Clone # 2
Distance between two fragments = 1
Clone size = 13
Source file "construction/gatesetconstruction.py"
The first line is 301
Source file "construction/gatesetconstruction.py"
The first line is 813
assert len(args) == 3 assert len(args) == 3
theta = eval(args[0], {'__builtins__': None}, {'pi': _np.pi}) theta = eval(args[0], {'__builtins__': None}, {'pi': _np.pi})
i1 = int(args[1]) i1 = int(args[1])
i2 = int(args[2]) i2 = int(args[2])
ex = (((-1j) * (theta)) * (_bt.sigmax)) / (2) ex = (((-1j) * (theta)) * (_bt.sigmax)) / (2)
Ugate = _spl.expm(ex) Ugate = _spl.expm(ex)
Utot = _np.identity(dmDim, 'complex') Utot = _np.identity(dmDim, 'complex')
Utot[i1,i1] = Ugate[0,0] Utot[i1,i1] = Ugate[0,0]
Utot[i1,i2] = Ugate[0,1] Utot[i1,i2] = Ugate[0,1]
Utot[i2,i1] = Ugate[1,0] Utot[i2,i1] = Ugate[1,0]
Utot[i2,i2] = Ugate[1,1] Utot[i2,i2] = Ugate[1,1]
Utotc = Utot.conjugate() Utotc = Utot.conjugate()
gateBlk = _np.kron(Utot, Utotc) gateTermInStdBasis = _np.kron(Utot, Utotc)



Clone # 3
Distance between two fragments = 0
Clone size = 12
Source file "construction/gatesetconstruction.py"
The first line is 284
Source file "construction/gatesetconstruction.py"
The first line is 233
UcohBlkc = UcohBlk.conjugate() UcohBlkc = UcohBlk.conjugate()
gateBlk = _np.kron(UcohBlk, UcohBlkc) gateBlk = _np.kron(UcohBlk, UcohBlkc)
mapBlk = [] mapBlk = []
s = startIndex[iTensorProdBlk] s = startIndex[iTensorProdBlk]
cohBlkSize = UcohBlk.shape[0] cohBlkSize = UcohBlk.shape[0]
for i in range(cohBlkSize):
    for j in range(cohBlkSize):
        vec_ij_index = (((s) + (i)) * (dmDim)) + ((s) + (j))
        mapBlk.append(vec_ij_index)
for i in range(cohBlkSize):
    for j in range(cohBlkSize):
        vec_ij_index = (((s) + (i)) * (dmDim)) + ((s) + (j))
        mapBlk.append(vec_ij_index)
for i, fi in enumerate(mapBlk):
    for j, fj in enumerate(mapBlk):
        gateTermInStdBasis[fi,fj] = gateBlk[i,j]
for i, fi in enumerate(mapBlk):
    for j, fj in enumerate(mapBlk):
        gateTermInStdBasis[fi,fj] = gateBlk[i,j]



Clone # 4
Distance between two fragments = 4
Clone size = 10
Source file "construction/rpeconstruction.py"
The first line is 433
Source file "construction/rpeconstruction.py"
The first line is 443
_mpl.pyplot.loglog(kList, _np.median(alphaErrorArray, axis=0), label=('N=') + (str(N))) _mpl.pyplot.loglog(kList, _np.median(epsilonErrorArray, axis=0), label=('N=') + (str(N)))
_mpl.pyplot.loglog(kList, (_np.array(kList)) ** (-1.0), '-o', label='1/k') _mpl.pyplot.loglog(kList, (_np.array(kList)) ** (-1.0), '-o', label='1/k')
_mpl.pyplot.xlabel('k') _mpl.pyplot.xlabel('k')
_mpl.pyplot.ylabel('$\\alpha_z - \\widehat{\\alpha_z}$') _mpl.pyplot.ylabel('$\\epsilon_x - \\widehat{\\epsilon_x}$')
_mpl.pyplot.title((((((((((('RPE error in Z angle\n% error in Z angle ') + (str(percentAlphaError))) + ('%, % error in X angle ')) + (str(percentEpsilonError))) + ('%\n% error in SPAM, ')) + (str((100) * (SPAMerror)))) + ('%, X-Z axis error ')) + (str(Yrot))) + ('\nMedian of ')) + (str(jMax))) + (' Trials')) _mpl.pyplot.title((((((((((('RPE error in X angle\n% error in Z angle ') + (str(percentAlphaError))) + ('%, % error in X angle ')) + (str(percentEpsilonError))) + ('%\n% error in SPAM, ')) + (str((100) * (SPAMerror)))) + ('%, X-Z axis error ')) + (str(Yrot))) + ('\nMedian of ')) + (str(jMax))) + (' Trials'))
_mpl.pyplot.legend() _mpl.pyplot.legend()
_mpl.pyplot.show() _mpl.pyplot.show()
_mpl.pyplot.loglog(kList, _np.median(epsilonErrorArray, axis=0), label=('N=') + (str(N))) _mpl.pyplot.loglog(kList, _np.median(thetaErrorArray, axis=0), label=('N=') + (str(N)))
_mpl.pyplot.loglog(kList, (_np.array(kList)) ** (-1.0), '-o', label='1/k') _mpl.pyplot.loglog(kList, (_np.array(kList)) ** (-1.0), '-o', label='1/k')
_mpl.pyplot.xlabel('k') _mpl.pyplot.xlabel('k')



Clone # 5
Distance between two fragments = 2
Clone size = 8
Source file "construction/gatesetconstruction.py"
The first line is 217
Source file "construction/gatesetconstruction.py"
The first line is 263
cohBlk = stateSpaceLabels[iTensorProdBlk] cohBlk = stateSpaceLabels[iTensorProdBlk]
basisInds = [] basisInds = []
for l in cohBlk:
    assert l[0] in ('L', 'Q')
    if l.startswith('L'):
        basisInds.append([0])
    elif l.startswith('Q'):
        basisInds.append([0, 1])
for l in cohBlk:
    assert l[0] in ('L', 'Q')
    if l.startswith('L'):
        basisInds.append([0])
    elif l.startswith('Q'):
        basisInds.append([0, 1])
tensorBlkBasis = list(_itertools.product(, *basisInds)) tensorBlkBasis = list(_itertools.product(, *basisInds))
K = cohBlk.index(label) K1 = cohBlk.index(label1)



Clone # 6
Distance between two fragments = 3
Clone size = 8
Source file "construction/gatesetconstruction.py"
The first line is 487
Source file "construction/gatesetconstruction.py"
The first line is 216
iTensorProdBlk = iTensorProdBlks[0] iTensorProdBlk = tensorBlkIndices[label]
tensorProdBlkLabels = stateSpaceLabels[iTensorProdBlk] cohBlk = stateSpaceLabels[iTensorProdBlk]
basisInds = [] basisInds = []
for l in tensorProdBlkLabels:
    assert l[0] in ('L', 'Q')
    if l.startswith('L'):
        basisInds.append([0])
    elif l.startswith('Q'):
        basisInds.append([0, 1])
for l in cohBlk:
    assert l[0] in ('L', 'Q')
    if l.startswith('L'):
        basisInds.append([0])
    elif l.startswith('Q'):
        basisInds.append([0, 1])
tensorBlkBasis = list(_itertools.product(, *basisInds)) tensorBlkBasis = list(_itertools.product(, *basisInds))



Clone # 7
Distance between two fragments = 4
Clone size = 8
Source file "construction/rpeconstruction.py"
The first line is 433
Source file "construction/rpeconstruction.py"
The first line is 453
_mpl.pyplot.loglog(kList, _np.median(alphaErrorArray, axis=0), label=('N=') + (str(N))) _mpl.pyplot.loglog(kList, _np.median(thetaErrorArray, axis=0), label=('N=') + (str(N)))
_mpl.pyplot.loglog(kList, (_np.array(kList)) ** (-1.0), '-o', label='1/k') _mpl.pyplot.loglog(kList, (_np.array(kList)) ** (-1.0), '-o', label='1/k')
_mpl.pyplot.xlabel('k') _mpl.pyplot.xlabel('k')
_mpl.pyplot.ylabel('$\\alpha_z - \\widehat{\\alpha_z}$') _mpl.pyplot.ylabel('$\\theta_{xz} - \\widehat{\\theta_{xz}}$')
_mpl.pyplot.title((((((((((('RPE error in Z angle\n% error in Z angle ') + (str(percentAlphaError))) + ('%, % error in X angle ')) + (str(percentEpsilonError))) + ('%\n% error in SPAM, ')) + (str((100) * (SPAMerror)))) + ('%, X-Z axis error ')) + (str(Yrot))) + ('\nMedian of ')) + (str(jMax))) + (' Trials')) _mpl.pyplot.title((((((((((('RPE error in X axis angle\n% error in Z angle ') + (str(percentAlphaError))) + ('%, % error in X angle ')) + (str(percentEpsilonError))) + ('%\n% error in SPAM, ')) + (str((100) * (SPAMerror)))) + ('%, X-Z axis error ')) + (str(Yrot))) + ('\nMedian of ')) + (str(jMax))) + (' Trials'))
_mpl.pyplot.legend() _mpl.pyplot.legend()
_mpl.pyplot.show() _mpl.pyplot.show()
_mpl.pyplot.loglog(kList, _np.median(epsilonErrorArray, axis=0), label=('N=') + (str(N))) _mpl.pyplot.loglog(kList, _np.median(PhiFunErrorArray, axis=0), label=('N=') + (str(N)))



Clone # 8
Distance between two fragments = 1
Clone size = 7
Source file "construction/gatesetconstruction.py"
The first line is 488
Source file "construction/gatesetconstruction.py"
The first line is 263
tensorProdBlkLabels = stateSpaceLabels[iTensorProdBlk] cohBlk = stateSpaceLabels[iTensorProdBlk]
basisInds = [] basisInds = []
for l in tensorProdBlkLabels:
    assert l[0] in ('L', 'Q')
    if l.startswith('L'):
        basisInds.append([0])
    elif l.startswith('Q'):
        basisInds.append([0, 1])
for l in cohBlk:
    assert l[0] in ('L', 'Q')
    if l.startswith('L'):
        basisInds.append([0])
    elif l.startswith('Q'):
        basisInds.append([0, 1])
tensorBlkBasis = list(_itertools.product(, *basisInds)) tensorBlkBasis = list(_itertools.product(, *basisInds))



Clone # 9
Distance between two fragments = 0
Clone size = 7
Source file "construction/gatesetconstruction.py"
The first line is 783
Source file "construction/gatesetconstruction.py"
The first line is 765
Ugate = _spl.expm(ex) Ugate = _spl.expm(ex)
if unitaryEmbedding:
    gateTermInFinalBasis = embed_gate_unitary(Ugate, (label))
else:
    Ugatec = Ugate.conjugate()
    gateMx = _np.kron(Ugate, Ugatec)
    pp_gateMx = _bt.std_to_pp(gateMx)
    gateTermInFinalBasis = embed_gate(pp_gateMx, (label))
if unitaryEmbedding:
    gateTermInFinalBasis = embed_gate_unitary(Ugate, (label))
else:
    Ugatec = Ugate.conjugate()
    gateMx = _np.kron(Ugate, Ugatec)
    pp_gateMx = _bt.std_to_pp(gateMx)
    gateTermInFinalBasis = embed_gate(pp_gateMx, (label))



Clone # 10
Distance between two fragments = 3
Clone size = 8
Source file "construction/std1Q_ZN.py"
The first line is 35
Source file "construction/std1Q_XY.py"
The first line is 20
germs = _strc.gatestring_list([('Gz'), ('Gn'), ('Gn', 'Gn', 'Gz', 'Gn', 'Gz'), ('Gn', 'Gz', 'Gn', 'Gz', 'Gz'), ('Gn', 'Gz', 'Gn', 'Gn', 'Gz', 'Gz'), ('Gn', 'Gn', 'Gz', 'Gn', 'Gz', 'Gz'), ('Gn', 'Gn', 'Gn', 'Gz', 'Gz', 'Gz')]) germs = _strc.gatestring_list([('Gy'), ('Gy', 'Gy', 'Gy', 'Gx'), ('Gy', 'Gx', 'Gy', 'Gx', 'Gx', 'Gx'), ('Gy', 'Gx', 'Gy', 'Gy', 'Gx', 'Gx'), ('Gy', 'Gy', 'Gy', 'Gx', 'Gy', 'Gx'), ('Gx'), ('Gx', 'Gy'), ('Gx', 'Gx', 'Gy', 'Gx', 'Gy', 'Gy')])



Clone # 11
Distance between two fragments = 0
Clone size = 7
Source file "construction/gatesetconstruction.py"
The first line is 207
Source file "construction/gatesetconstruction.py"
The first line is 757
assert len(args) == 2 assert len(args) == 2
theta = eval(args[0], {'__builtins__': None}, {'pi': _np.pi}) theta = eval(args[0], {'__builtins__': None}, {'pi': _np.pi})
label = args[1].strip() label = args[1].strip()
assert label.startswith('Q') assert label.startswith('Q')
if gateName == 'X':
    ex = (((-1j) * (theta)) * (_bt.sigmax)) / (2)
elif gateName == 'Y':
    ex = (((-1j) * (theta)) * (_bt.sigmay)) / (2)
elif gateName == 'Z':
    ex = (((-1j) * (theta)) * (_bt.sigmaz)) / (2)
if gateName == 'X':
    ex = (((-1j) * (theta)) * (_bt.sigmax)) / (2)
elif gateName == 'Y':
    ex = (((-1j) * (theta)) * (_bt.sigmay)) / (2)
elif gateName == 'Z':
    ex = (((-1j) * (theta)) * (_bt.sigmaz)) / (2)
Ugate = _spl.expm(ex) Ugate = _spl.expm(ex)



Clone # 12
Distance between two fragments = 2
Clone size = 7
Source file "construction/gatesetconstruction.py"
The first line is 535
Source file "construction/gatesetconstruction.py"
The first line is 358
if basis == 'std':
    return _gate.FullyParameterizedGate(finalGateInStdBasis)
elif basis == 'gm':
    return _gate.FullyParameterizedGate(_bt.std_to_gm(finalGateInStdBasis, blockDims))
elif basis == 'pp':
    return _gate.FullyParameterizedGate(_bt.std_to_pp(finalGateInStdBasis, blockDims))
else:
    raise ValueError(("Invalid 'basis' parameter: %s (must by 'std', 'gm', or 'pp')") % (basis))
if basis == 'std':
    return _gate.FullyParameterizedGate(gateInReducedStdBasis)
elif basis == 'gm':
    return _gate.FullyParameterizedGate(_bt.std_to_gm(gateInReducedStdBasis, stateSpaceDims))
elif basis == 'pp':
    return _gate.FullyParameterizedGate(_bt.std_to_pp(gateInReducedStdBasis, stateSpaceDims))
else:
    raise ValueError(("Invalid 'basis' parameter: %s (must by 'std', 'gm', or 'pp')") % (basis))



Clone # 13
Distance between two fragments = 0
Clone size = 6
Source file "construction/gatesetconstruction.py"
The first line is 725
Source file "construction/gatesetconstruction.py"
The first line is 740
labels = args labels = args
stateSpaceDim = 1 stateSpaceDim = 1
for l in labels:
    if l.startswith('Q'):
        stateSpaceDim *= 2
    elif l.startswith('L'):
        stateSpaceDim *= 1
    else:
        raise ValueError(('Invalid state space label: %s') % (l))
for l in labels:
    if l.startswith('Q'):
        stateSpaceDim *= 2
    elif l.startswith('L'):
        stateSpaceDim *= 1
    else:
        raise ValueError(('Invalid state space label: %s') % (l))



Clone # 14
Distance between two fragments = 4
Clone size = 10
Source file "construction/std1Q_pi4_pi2_XZ.py"
The first line is 32
Source file "construction/std1Q_XZ.py"
The first line is 31
germs = _strc.gatestring_list([('Gx'), ('Gz'), ('Gz', 'Gz', 'Gx'), ('Gz', 'Gz', 'Gx', 'Gz', 'Gx', 'Gx', 'Gx'), ('Gz', 'Gx', 'Gz', 'Gz', 'Gx', 'Gx', 'Gx')]) germs = _strc.gatestring_list([('Gx'), ('Gz'), ('Gz', 'Gx', 'Gx'), ('Gz', 'Gz', 'Gx')])
gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gz'], ['X(pi/4,Q0)', 'Z(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')}) gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gz'], ['X(pi/2,Q0)', 'Z(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')})



Clone # 15
Distance between two fragments = 4
Clone size = 10
Source file "construction/std1Q_XYI.py"
The first line is 17
Source file "construction/std1Q_XY.py"
The first line is 17
fiducials = _strc.gatestring_list([(), ('Gx'), ('Gy'), ('Gx', 'Gx'), ('Gx', 'Gx', 'Gx'), ('Gy', 'Gy', 'Gy')]) fiducials = _strc.gatestring_list([(), ('Gx'), ('Gy'), ('Gx', 'Gx'), ('Gx', 'Gx', 'Gx'), ('Gy', 'Gy', 'Gy')])
germs = _strc.gatestring_list([('Gx'), ('Gy'), ('Gi'), ('Gx', 'Gy'), ('Gx', 'Gy', 'Gi'), ('Gx', 'Gi', 'Gy'), ('Gx', 'Gi', 'Gi'), ('Gy', 'Gi', 'Gi'), ('Gx', 'Gx', 'Gi', 'Gy'), ('Gx', 'Gy', 'Gy', 'Gi'), ('Gx', 'Gx', 'Gy', 'Gx', 'Gy', 'Gy')]) germs = _strc.gatestring_list([('Gy'), ('Gy', 'Gy', 'Gy', 'Gx'), ('Gy', 'Gx', 'Gy', 'Gx', 'Gx', 'Gx'), ('Gy', 'Gx', 'Gy', 'Gy', 'Gx', 'Gx'), ('Gy', 'Gy', 'Gy', 'Gx', 'Gy', 'Gx'), ('Gx'), ('Gx', 'Gy'), ('Gx', 'Gx', 'Gy', 'Gx', 'Gy', 'Gy')])



Clone # 16
Distance between two fragments = 3
Clone size = 6
Source file "construction/std1Q_pi4_pi2_XZ.py"
The first line is 25
Source file "construction/std1Q_pi4_pi2_XZ.py"
The first line is 17
measFiducials = _strc.gatestring_list([(), ('Gx', 'Gx'), ('Gz', 'Gx', 'Gx'), ('Gx', 'Gx', 'Gx', 'Gx'), ('Gx', 'Gx', 'Gx', 'Gx', 'Gx', 'Gx'), ('Gz', 'Gz', 'Gz', 'Gx', 'Gx')]) prepFiducials = _strc.gatestring_list([(), ('Gx', 'Gx'), ('Gx', 'Gx', 'Gz'), ('Gx', 'Gx', 'Gx', 'Gx'), ('Gx', 'Gx', 'Gx', 'Gx', 'Gx', 'Gx'), ('Gx', 'Gx', 'Gz', 'Gz', 'Gz')])



Clone # 17
Distance between two fragments = 3
Clone size = 6
Source file "construction/std1Q_XZ.py"
The first line is 24
Source file "construction/std1Q_XZ.py"
The first line is 17
measFiducials = _strc.gatestring_list([(), ('Gx'), ('Gz', 'Gx'), ('Gx', 'Gx'), ('Gx', 'Gx', 'Gx'), ('Gx', 'Gx', 'Gz', 'Gx')]) prepFiducials = _strc.gatestring_list([(), ('Gx'), ('Gx', 'Gz'), ('Gx', 'Gx'), ('Gx', 'Gx', 'Gx'), ('Gx', 'Gz', 'Gx', 'Gx')])



Clone # 18
Distance between two fragments = 3
Clone size = 6
Source file "construction/std1Q_ZN.py"
The first line is 28
Source file "construction/std1Q_ZN.py"
The first line is 21
measFiducials = _strc.gatestring_list([(), ('Gn'), ('Gn', 'Gn'), ('Gn', 'Gz', 'Gn'), ('Gn', 'Gn', 'Gn'), ('Gn', 'Gn', 'Gn', 'Gz', 'Gn')]) prepFiducials = _strc.gatestring_list([(), ('Gn'), ('Gn', 'Gn'), ('Gn', 'Gz', 'Gn'), ('Gn', 'Gn', 'Gn'), ('Gn', 'Gz', 'Gn', 'Gn', 'Gn')])



Clone # 19
Distance between two fragments = 1
Clone size = 6
Source file "construction/gatesetconstruction.py"
The first line is 253
Source file "construction/gatesetconstruction.py"
The first line is 796
assert label2.startswith('Q') assert label2.startswith('Q')
if gateName == 'CX':
    ex = (((-1j) * (theta)) * (_bt.sigmax)) / (2)
elif gateName == 'CY':
    ex = (((-1j) * (theta)) * (_bt.sigmay)) / (2)
elif gateName == 'CZ':
    ex = (((-1j) * (theta)) * (_bt.sigmaz)) / (2)
if gateName == 'CX':
    ex = (((-1j) * (theta)) * (_bt.sigmax)) / (2.0)
elif gateName == 'CY':
    ex = (((-1j) * (theta)) * (_bt.sigmay)) / (2.0)
elif gateName == 'CZ':
    ex = (((-1j) * (theta)) * (_bt.sigmaz)) / (2.0)
Utarget = _spl.expm(ex) Utarget = _spl.expm(ex)
Ugate = _np.identity(4, 'complex') Ugate = _np.identity(4, 'complex')
Ugate[2:None,2:None] = Utarget Ugate[2:None,2:None] = Utarget



Clone # 20
Distance between two fragments = 4
Clone size = 6
Source file "construction/gatesetconstruction.py"
The first line is 804
Source file "construction/gatesetconstruction.py"
The first line is 784
if unitaryEmbedding:
    gateTermInFinalBasis = embed_gate_unitary(Ugate, (label1, label2))
else:
    Ugatec = Ugate.conjugate()
    gateMx = _np.kron(Ugate, Ugatec)
    pp_gateMx = _bt.std_to_pp(gateMx)
    gateTermInFinalBasis = embed_gate(pp_gateMx, (label1, label2))
if unitaryEmbedding:
    gateTermInFinalBasis = embed_gate_unitary(Ugate, (label))
else:
    Ugatec = Ugate.conjugate()
    gateMx = _np.kron(Ugate, Ugatec)
    pp_gateMx = _bt.std_to_pp(gateMx)
    gateTermInFinalBasis = embed_gate(pp_gateMx, (label))



Clone # 21
Distance between two fragments = 4
Clone size = 6
Source file "construction/gatesetconstruction.py"
The first line is 804
Source file "construction/gatesetconstruction.py"
The first line is 766
if unitaryEmbedding:
    gateTermInFinalBasis = embed_gate_unitary(Ugate, (label1, label2))
else:
    Ugatec = Ugate.conjugate()
    gateMx = _np.kron(Ugate, Ugatec)
    pp_gateMx = _bt.std_to_pp(gateMx)
    gateTermInFinalBasis = embed_gate(pp_gateMx, (label1, label2))
if unitaryEmbedding:
    gateTermInFinalBasis = embed_gate_unitary(Ugate, (label))
else:
    Ugatec = Ugate.conjugate()
    gateMx = _np.kron(Ugate, Ugatec)
    pp_gateMx = _bt.std_to_pp(gateMx)
    gateTermInFinalBasis = embed_gate(pp_gateMx, (label))



Clone # 22
Distance between two fragments = 2
Clone size = 6
Source file "construction/gatesetconstruction.py"
The first line is 674
Source file "construction/gatesetconstruction.py"
The first line is 667
if  parameterization  ==  "static":
  finalGateInFinalBasis  =  _np.dot(full_ppToFinal,
      _np.dot(  finalGate,  full_finalToPP))
  return  _gate.StaticGate(
    _np.real(finalGateInFinalBasis)
    if  realMx  else  finalGateInFinalBasis  )
if  parameterization  ==  "full":
  finalGateInFinalBasis  =  _np.dot(full_ppToFinal,
      _np.dot(  finalGate,  full_finalToPP))
  return  _gate.FullyParameterizedGate(
    _np.real(finalGateInFinalBasis)
    if  realMx  else  finalGateInFinalBasis  )



Clone # 23
Distance between two fragments = 2
Clone size = 5
Source file "construction/stdlists.py"
The first line is 329
Source file "construction/stdlists.py"
The first line is 128
if maxLengthList[0] == 0:
    elgst_listOfLists = [singleGates]
    maxLengthList = maxLengthList[1:]
else:
    elgst_listOfLists = []
if maxLengthList[0] == 0:
    lsgst_listOfLists = [lgstStrings]
    maxLengthList = maxLengthList[1:]
else:
    lsgst_listOfLists = []
Rfn = _getTruncFunction(truncScheme) Rfn = _getTruncFunction(truncScheme)



Clone # 24
Distance between two fragments = 4
Clone size = 5
Source file "construction/std1Q_pi4_pi2_XZ.py"
The first line is 39
Source file "construction/std1Q_ZN.py"
The first line is 15
gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gz'], ['X(pi/4,Q0)', 'Z(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')}) gs_target = _setc.build_gateset([2], [('Q0')], ['Gz', 'Gn'], ['Z(pi/2,Q0)', 'N(pi/2, sqrt(3)/2, 0, -0.5, Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')})



Clone # 25
Distance between two fragments = 4
Clone size = 5
Source file "construction/std1Q_XZ.py"
The first line is 34
Source file "construction/std1Q_ZN.py"
The first line is 15
gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gz'], ['X(pi/2,Q0)', 'Z(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')}) gs_target = _setc.build_gateset([2], [('Q0')], ['Gz', 'Gn'], ['Z(pi/2,Q0)', 'N(pi/2, sqrt(3)/2, 0, -0.5, Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')})



Clone # 26
Distance between two fragments = 4
Clone size = 5
Source file "construction/std1Q_XY.py"
The first line is 30
Source file "construction/std1Q_ZN.py"
The first line is 15
gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gy'], ['X(pi/2,Q0)', 'Y(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')}) gs_target = _setc.build_gateset([2], [('Q0')], ['Gz', 'Gn'], ['Z(pi/2,Q0)', 'N(pi/2, sqrt(3)/2, 0, -0.5, Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')})



Clone # 27
Distance between two fragments = 3
Clone size = 8
Source file "construction/std1Q_pi4_pi2_XZ.py"
The first line is 32
Source file "construction/std1Q_XY.py"
The first line is 20
germs = _strc.gatestring_list([('Gx'), ('Gz'), ('Gz', 'Gz', 'Gx'), ('Gz', 'Gz', 'Gx', 'Gz', 'Gx', 'Gx', 'Gx'), ('Gz', 'Gx', 'Gz', 'Gz', 'Gx', 'Gx', 'Gx')]) germs = _strc.gatestring_list([('Gy'), ('Gy', 'Gy', 'Gy', 'Gx'), ('Gy', 'Gx', 'Gy', 'Gx', 'Gx', 'Gx'), ('Gy', 'Gx', 'Gy', 'Gy', 'Gx', 'Gx'), ('Gy', 'Gy', 'Gy', 'Gx', 'Gy', 'Gx'), ('Gx'), ('Gx', 'Gy'), ('Gx', 'Gx', 'Gy', 'Gx', 'Gy', 'Gy')])



Clone # 28
Distance between two fragments = 3
Clone size = 5
Source file "construction/std1Q_pi4_pi2_XZ.py"
The first line is 39
Source file "construction/std1Q_XY.py"
The first line is 30
gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gz'], ['X(pi/4,Q0)', 'Z(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')}) gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gy'], ['X(pi/2,Q0)', 'Y(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')})



Clone # 29
Distance between two fragments = 2
Clone size = 5
Source file "construction/std1Q_XZ.py"
The first line is 34
Source file "construction/std1Q_XY.py"
The first line is 30
gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gz'], ['X(pi/2,Q0)', 'Z(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')}) gs_target = _setc.build_gateset([2], [('Q0')], ['Gx', 'Gy'], ['X(pi/2,Q0)', 'Y(pi/2,Q0)'], prepLabels=['rho0'], prepExpressions=['0'], effectLabels=['E0'], effectExpressions=['1'], spamdefs={'plus': ('rho0', 'E0'), 'minus': ('rho0', 'remainder')})



Clone # 30
Distance between two fragments = 3
Clone size = 7
Source file "construction/std1Q_ZN.py"
The first line is 35
Source file "construction/std1Q_pi4_pi2_XZ.py"
The first line is 32
germs = _strc.gatestring_list([('Gz'), ('Gn'), ('Gn', 'Gn', 'Gz', 'Gn', 'Gz'), ('Gn', 'Gz', 'Gn', 'Gz', 'Gz'), ('Gn', 'Gz', 'Gn', 'Gn', 'Gz', 'Gz'), ('Gn', 'Gn', 'Gz', 'Gn', 'Gz', 'Gz'), ('Gn', 'Gn', 'Gn', 'Gz', 'Gz', 'Gz')]) germs = _strc.gatestring_list([('Gx'), ('Gz'), ('Gz', 'Gz', 'Gx'), ('Gz', 'Gz', 'Gx', 'Gz', 'Gx', 'Gx', 'Gx'), ('Gz', 'Gx', 'Gz', 'Gz', 'Gx', 'Gx', 'Gx')])



Clone # 31
Distance between two fragments = 3
Clone size = 5
Source file "construction/rpeconstruction.py"
The first line is 447
Source file "construction/rpeconstruction.py"
The first line is 457
_mpl.pyplot.ylabel('$\\epsilon_x - \\widehat{\\epsilon_x}$') _mpl.pyplot.ylabel('$\\theta_{xz} - \\widehat{\\theta_{xz}}$')
_mpl.pyplot.title((((((((((('RPE error in X angle\n% error in Z angle ') + (str(percentAlphaError))) + ('%, % error in X angle ')) + (str(percentEpsilonError))) + ('%\n% error in SPAM, ')) + (str((100) * (SPAMerror)))) + ('%, X-Z axis error ')) + (str(Yrot))) + ('\nMedian of ')) + (str(jMax))) + (' Trials')) _mpl.pyplot.title((((((((((('RPE error in X axis angle\n% error in Z angle ') + (str(percentAlphaError))) + ('%, % error in X angle ')) + (str(percentEpsilonError))) + ('%\n% error in SPAM, ')) + (str((100) * (SPAMerror)))) + ('%, X-Z axis error ')) + (str(Yrot))) + ('\nMedian of ')) + (str(jMax))) + (' Trials'))
_mpl.pyplot.legend() _mpl.pyplot.legend()
_mpl.pyplot.show() _mpl.pyplot.show()
_mpl.pyplot.loglog(kList, _np.median(thetaErrorArray, axis=0), label=('N=') + (str(N))) _mpl.pyplot.loglog(kList, _np.median(PhiFunErrorArray, axis=0), label=('N=') + (str(N)))



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 http://clonedigger.sourceforge.net