Ejemplo n.º 1
0
def Edis(pair):
    q1 = np.sum(pair[0] * xpGrid[:, 0])
    p1 = np.sum(pair[0] * xpGrid[:, 1])
    q2 = np.sum(pair[1] * xpGrid[:, 0])
    p2 = np.sum(pair[1] * xpGrid[:, 1])
    return qkr.dist(([q1, p1], [q2, p2]))
Ejemplo n.º 2
0
    ax = np.arange(0.,m)*dq
    Qs = np.tile(np.arange(0,m)*dq,(m,1)).T
    Ps = np.tile(np.arange(0,m)*dp,(m,1))
    xpGrid = np.array([[ax[i],ax[j]] for i in range(m) for j in range(m)])
    
    hamil = np.sum([blc(j) for j in np.arange(-int(3.*k/np.pi),1 + int(3.*k/np.pi))], axis=0)
    
    eigs = np.linalg.eig(hamil)
    
    eigVal = eigs[0]
    eigVec = eigs[1]
            
    disMat = np.zeros((m**2,m**2))
    for i in range(m**2):
        for j in range(m**2):
            disMat[i,j] = qkr.dist((xpGrid[i], xpGrid[j]))
            
    pool = mp.Pool(mp.cpu_count())
    eigProbs = np.array(pool.map(phi2Ph, eigVec))
    pool.close()
    
    np.save(foldPref+"/hamil.npy",hamil)
    np.savetxt(foldPref+"/disMat.dat",disMat)
    np.save(foldPref+"/eigs.npy", eigVal)
    np.save(foldPref+"/eigv.npy", eigVec)
    np.savetxt(foldPref+"/xpGrid.dat", xpGrid)
    np.save(foldPref+"/eigPrb.npy", eigProbs)
    

except FileExistsError:
    eigVal = np.load(foldPref+"/eigs.npy")
Ejemplo n.º 3
0
qlis = np.array([[ini[0, 0], ini[1, 0]]])
plis = np.array([[ini[0, 1], ini[1, 1]]])

trajLen = 50
"""
Classical Evolution
"""

for ki in range(trajLen):
    plis = np.concatenate(
        (plis, [np.mod(plis[-1] + k * np.sin(qlis[-1]), 2. * np.pi)]))
    qlis = np.concatenate((qlis, [np.mod(qlis[-1] + plis[-1], 2. * np.pi)]))
st1 = np.transpose([qlis[:, 0], plis[:, 0]])
st2 = np.transpose([qlis[:, 1], plis[:, 1]])
clis = [qkr.dist((s1, s2)) for s1, s2 in zip(st1, st2)]
"""
Quantal Evolution
"""


def blc(l):
    bone = np.array(range(m**2))
    indMat = (bone + l * m**2) - np.transpose([bone])
    sign = (np.complex(0, -1))**indMat
    jvs = sp.jv(indMat, k / hbar)
    phs = np.exp(np.complex(0, -1) * bone**2 * hbar / 2.)
    return np.multiply(np.multiply(sign, jvs), phs)


def phi2Ph(phi):