コード例 #1
0
ファイル: TDEigenK.py プロジェクト: charleslian/PYRAMIDS
#/usr/bin/python
"""
Created on Fri Jul 22 09:54:42 2016
@author: Chao (Charles) Lian
@email: [email protected]
"""

import matplotlib.pyplot as plt
from pyramids.io.result import getTDEig
from pyramids.plot.setting import getPropertyFromPosition
from pyramids.plot.setting import setProperty
from pyramids.plot.setting import getColors
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import os
colors = getColors(5)
#ti = 3; tf = 1000; 
#selectTime =range(ti,tf) # initial timestep and final timestep
#selectBand = [0]# initial band and final band
selectKpts = [0]#[0,1,4,6,7]# initial band and final band

numK = len(selectKpts)
fig, axs  = plt.subplots(1,len(selectKpts),sharex=True,figsize=(8,6)) 



#print eig.shape, time.shape,
#for diri, directory in enumerate(['TDDFT','BOMD']):
#os.chdir(directory)
time, eig = getTDEig()
#print time.shape
コード例 #2
0
"""
Created on Thu Sep 22 15:36:43 2016

@author: moomin
"""
import numpy as np
from scipy.fftpack import fft, ifft
import pyramids.plot.PlotUtility as pu 
from pyramids.plot.setting import getPropertyFromPosition, setProperty, getColors
from pyramids.io.fdf import tdapOptions
import pyramids.io.result as dp
import matplotlib.pyplot as plt
import os
from scipy.interpolate import interp1d
fig, ax = plt.subplots(1,1,sharey=True,sharex=True,figsize=(7,15)) 
colors = getColors(7)
dumping = 0.01
width = 186.0
fieldE = 0.01
xlimits = [0,30] 
ylimits = None
def huskyOnTheFly(index,folder):
    count = 0
    for i, direct in enumerate(['x','y','z']):
        #print os.listdir('.')
        if not os.path.exists(direct):
            continue
        
        os.chdir(direct)
        timeArray, efield = dp.getEField()  
        
コード例 #3
0
ファイル: ipiScan.py プロジェクト: charleslian/PYRAMIDS
  timeEn, T, E_ks, E_tot, Vol, P  = dP.getEnergyTemperaturePressure()
  deltaE =  (E_tot[2:,] - E_tot[2])
  
  return [(index, folder), (timeEf, eField), (timeEl, exe), (timeEn,deltaE)]
#------------------------------------------------------------------------------

fig, axs = plt.subplots(2,2,sharex=True,sharey=False,figsize=(8,6))
axs = axs.flatten()
SaveName = __file__.split('/')[-1].split('.')[0]

pimdData = getPIMDdata()
axs[ipiTemp].plot(pimdData[:,0],pimdData[:,2])

data = scanFolder(action)
#print data[-1][0][0]
c = ma.getColors(data[-1][0][0]+1)


maxElectrons = []
maxEnergies = []
minEnergies = []

for [(index, folder), (timeEf, eField), (timeEl, exe), (timeEn,deltaE)] in data:
  #ax = axs[efield]
  #ax.plot(timeEf,eField[:,2], c=c[index],
  #      label=folder,lw=2,alpha=0.8) 
  #eField = float(folder) * 13.6/0.529
  ax = axs[exElectron]
  ax.plot(timeEl,exe,'-',alpha=0.8,
          #label=r'%5.2f $V/\AA$' % eField,c=c[index],
          markerfacecolor='w',lw=2)
コード例 #4
0
"""
Created on Thu Sep 22 15:36:43 2016

@author: moomin
"""
import numpy as np
from scipy.fftpack import fft, ifft
import pyramids.plot.PlotUtility as pu
from pyramids.plot.setting import getPropertyFromPosition, setProperty, getColors
from pyramids.io.fdf import tdapOptions
import pyramids.io.result as dp
import matplotlib.pyplot as plt
import os
from scipy.interpolate import interp1d
fig, ax = plt.subplots(1, 1, sharey=True, sharex=True, figsize=(7, 15))
colors = getColors(7)
dumping = 0.01
width = 186.0
fieldE = 0.01
xlimits = [0, 30]
ylimits = None


def huskyOnTheFly(index, folder):
    count = 0
    for i, direct in enumerate(['x', 'y', 'z']):
        #print os.listdir('.')
        if not os.path.exists(direct):
            continue

        os.chdir(direct)
コード例 #5
0
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import pyramids.io.result as dP
import pyramids.plot.setting as ma
import pyramids.plot.PlotUtility as pu
#------------------------------------------------------------------------------
time, exe = dP.getProjectedPartition()
time, eigen = dP.getAdiabaticEigenvalue()

#print eigen[:,1,:]
#h**o = dP.getHomo()
#print h**o
print exe.shape, eigen.shape
c = ma.getColors(exe.shape[2], cmap='brg')

norm = 50.0  #/np.max(exe[:,:,:] -  exe[0,:,:])
#print norm
kpts = [0]
for kpt in kpts:
    fig, ax = plt.subplots(1, 1, sharex=True, sharey=False, figsize=(8, 6))
    SaveName = __file__.split('/')[-1].split('.')[0] + str(kpt)
    h**o = 0
    for i, band in enumerate(eigen[0, kpt, :]):
        #print band
        if band < 0:
            h**o = i

    evolvingBands = range(0, h**o + 40)
    X, Y = np.meshgrid(time, eigen[0, kpt, evolvingBands])
    Z = np.transpose(exe[0, kpt, evolvingBands] - exe[:, kpt, evolvingBands])
コード例 #6
0
ファイル: NewSpectra.py プロジェクト: cndaqiang/py3ramids
Created on Wed Jun 29 12:59:03 2016

@author: cl-iop
"""

import numpy as np
import matplotlib.pyplot as plt
import pyramids.io.result as dp
import pyramids.plot.setting as ma
import os

fig, axs = plt.subplots(2, 1, sharex=False, sharey=False, figsize=(6, 8))
SaveName = __file__.split('/')[-1].split('.')[0]

startStep = 10
c = ma.getColors(4)
scandir = ('x', 'y')
for idir, direct in enumerate(scandir):
    os.chdir(direct)

    ax = axs[0]
    time, T, E_ks, E_tot, Vol, P = dp.getEnergyTemperaturePressure()
    dipoles = dp.getDipole()
    dipoles[:, idir] = (dipoles[:, idir] - dipoles[0, idir]
                        )  #* np.exp(-0.01*time)
    ax.plot(time, dipoles[:, idir], label=direct)
    ax.grid(which=u'major', axis='x')
    ax.grid(which=u'major', axis='y')

    ax = axs[1]
    N = dipoles.shape[0]
コード例 #7
0
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import pyramids.io.result as dP
import pyramids.plot.setting as ma

#------------------------------------------------------------------------------
fig, axs = plt.subplots(3, 1, sharex=True, sharey=False, figsize=(8, 6))
SaveName = __file__.split('/')[-1].split('.')[0]
c = ma.getColors(2, cmap='brg')
#------------------------------------------------------------------------------
Time, exe = dP.getExcitedElectrons()
ax = axs[0]
ax.plot(Time,
        exe - exe[0],
        '.',
        alpha=0.8,
        c='b',
        markerfacecolor='w',
        lw=2,
        label='Excited Electrons')
kargs = ma.getPropertyFromPosition(
    ylabel=r'n(e)',
    title='',
    xlimits=None,
)
ma.setProperty(ax, **kargs)
#------------------------------------------------------------------------------
ax = axs[1]
time, T, E_ks, E_tot, Vol, P = dP.getEnergyTemperaturePressure()
deltaE = (E_ks[2:] - E_ks[2])
コード例 #8
0
cut = [0]
specialKPoints = [r'$M$',r'$\Gamma$',r'$K$',r'$\Gamma$']
for i in range(667,38,-37):
  kpath.append(i)
cut.append(len(kpath))
for i in range(36,421,35):
  kpath.append(i+1) 
  kpath.append(i) 
cut.append(len(kpath))
for i in range(421,649,38):
  kpath.append(i)
  kpath.append(i+1) 
cut.append(len(kpath))
kpath = np.array(kpath) - 1 

c = ma.getColors(exe.shape[2] - h**o + 1,cmap='brg')
evolvingBands = range(0, h**o + 9)

x = np.arange(kpath.shape[0])
excited = np.abs(exe[1,kpath,:] -  exe[0,kpath,:])
norm = 2.0/np.max(exe[:,kpath,:] -  exe[0,kpath,:])
eigenvalue = eigen[0,kpath,:]

print eigenvalue.shape, excited.shape, x.shape

line = []
scatter = []
for band in evolvingBands:
  if band < h**o:
    part = excited[:,band]
    s = ax.fill_between(x, eigenvalue[:,band] - norm*part, 
コード例 #9
0
ファイル: ipiAve.py プロジェクト: charleslian/PYRAMIDS
  exe  -= exe[0]
  timeEn, T, E_ks, E_tot, Vol, P  = dP.getEnergyTemperaturePressure()
  deltaE =  (E_tot[2:,] - E_tot[2])
  return [(index, folder), (timeEf, eField), (timeEl, exe), (timeEn[2:],deltaE)]
#------------------------------------------------------------------------------

fig, axs = plt.subplots(2,1,sharex=True,sharey=False,figsize=(6,8))
SaveName = __file__.split('/')[-1].split('.')[0]

#pimdData = getPIMDdata()
#axs[-1].plot(pimdData[:,0],pimdData[:,4])

data = scanFolder(action)

rows = data[-1][0][0]+1
c = ma.getColors(rows)
exSteps = min([line[2][0].shape[0] for line in data])
exAve = np.zeros(exSteps)
enSteps = min([line[3][0].shape[0] for line in data])
enAve = np.zeros(enSteps)


for [(index, folder), (timeEf, eField), (timeEl, exe), (timeEn,deltaE)] in data:
  exAve += exe[:exSteps]/rows
  enAve += deltaE[:enSteps]/rows



axs[0].plot(timeEl[:exSteps],exAve,label='4 Beads')
axs[1].plot(timeEn[:enSteps],enAve,label='4 Beads')
コード例 #10
0
@author: cl-iop
"""

from graphene import *
import pyramids.plot.setting as ma
import matplotlib.pyplot as plt
fig, axs = plt.subplots(2,1,sharex=False,sharey=False,figsize=(12,10))

#k = (0.0,1.0) #(np.sqrt(0.5),np.sqrt(0.5))
numSample = 20
args={'t0':20.0,'sigma': 8.0, 'omega':2.0, 'phi':0.0, 'parity':1, 'vFermi' : 1}
args['times'] = np.linspace(0.0, 50.0, 500.0)
args['A'] = 0.2
thetas = np.linspace(0,np.pi/2,numSample)
colors = ma.getColors(numSample)

function = []
for index, theta in enumerate(thetas):
  args['kpoint'] = (np.cos(theta), np.sin(theta))
  ax = axs[1]
  #label = r'$A = $ %2.1f eV'% (A)
  ax.plot(args['times'], HCoeff(args['times'],args), color=colors[index])
  
  result, proj0, proj1 = excitation(args)
  ax = axs[0]
  #title = r'k$_x$ = %2.1f, k$_y$ = %2.1f'% (k[0],k[1])
  ax.plot(result.times, proj1, '-', color=colors[index])
  
  function.append(proj1[-1])
    
コード例 #11
0
cut = [0]
specialKPoints = [r'$M$', r'$\Gamma$', r'$K$', r'$\Gamma$']
for i in range(667, 38, -37):
    kpath.append(i)
cut.append(len(kpath))
for i in range(36, 421, 35):
    kpath.append(i + 1)
    kpath.append(i)
cut.append(len(kpath))
for i in range(421, 649, 38):
    kpath.append(i)
    kpath.append(i + 1)
cut.append(len(kpath))
kpath = np.array(kpath) - 1

c = ma.getColors(exe.shape[2] - h**o + 1, cmap='brg')
evolvingBands = range(0, h**o + 9)

x = np.arange(kpath.shape[0])
excited = np.abs(exe[1, kpath, :] - exe[0, kpath, :])
norm = 2.0 / np.max(exe[:, kpath, :] - exe[0, kpath, :])
eigenvalue = eigen[0, kpath, :]

print eigenvalue.shape, excited.shape, x.shape

line = []
scatter = []
for band in evolvingBands:
    if band < h**o:
        part = excited[:, band]
        s = ax.fill_between(x,
コード例 #12
0
ファイル: NewSpectra.py プロジェクト: charleslian/PYRAMIDS
@author: cl-iop
"""

import numpy as np
import matplotlib.pyplot as plt
import pyramids.io.result as dp
import pyramids.plot.setting as ma
import os


fig, axs = plt.subplots(2,1,sharex=False,sharey=False,figsize=(6,8))
SaveName = __file__.split('/')[-1].split('.')[0]

startStep = 10
c = ma.getColors(4)
scandir = ('x','y')
for idir, direct in enumerate(scandir):
  os.chdir(direct)  
  
  ax = axs[0]
  time, T, E_ks, E_tot, Vol, P  = dp.getEnergyTemperaturePressure()
  dipoles = dp.getDipole()
  dipoles[:,idir] = (dipoles[:,idir] - dipoles[0,idir]) #* np.exp(-0.01*time)
  ax.plot(time,dipoles[:,idir],label=direct)
  ax.grid(which=u'major',axis='x')
  ax.grid(which=u'major',axis='y')
  
  ax = axs[1]
  N = dipoles.shape[0]
  timeStep = (time[-1] - time[0]) / (N-1)
コード例 #13
0
SaveName = __file__.split('/')[-1].split('.')[0]
from matplotlib import pyplot as plt
import numpy as np
fig, ax = plt.subplots(1,1,sharex=True,sharey=False,figsize=(8,6))
from pyramids.plot.PlotUtility import scanFolder

data = scanFolder(plotEigenvalues)
y0 = data[0][1].flatten()
numBand = y0.shape[0]

x = []
y = []
for x1,y1,h**o in data:
  x.append(x1)
  y.append(y1.flatten()-y0)
  
y = np.array(y)

plotedBand = h**o + 0
colors = ma.getColors(plotedBand)
for i in range(plotedBand):
  ax.plot(x,y[:,i],'-o',color=colors[i],label=str(i)+' + '+str(y0[i]))

args = ma.getPropertyFromPosition(xlabel=r'$\varepsilon(a.u.)$',
                                  ylabel=r'Eigenvalues(eV)')
ma.setProperty(ax,**args)
plt.tight_layout()

for save_type in ['.pdf']:
  filename = SaveName + save_type
  plt.savefig(filename,orientation='portrait',dpi=600)
コード例 #14
0

#        
#Excitation
TotalStep,nkstot,npol,nbnd,wk,norm = qeout.Readnorm()
h**o=qeout.GetHomo()
time=np.arange(TotalStep)*edt

#画哪些k点的激发
ksample=np.arange(nkstot)
Nksample=ksample.shape[0]
exciteelectron=np.zeros((TotalStep,Nksample))
hole=np.zeros((TotalStep,Nksample))    #if only "=", change hole will chenge exciteelectron

#目前程序还未只是SOC,所以npol=1,不用考虑太多
colors = setfig.getColors(Nksample)
for ik in ksample:
   exciteelectron[:,ik]=norm[:,ik,h**o:nbnd].sum(axis=1) #*wk[ik] 
               #py index from 0, for ik ,so sum(axis=1 not 2)
               #h**o:nbnd
   hole[:,ik]=(norm[0,ik,0:h**o]-norm[:,ik,0:h**o]).sum(axis=1) #*wk[ik]  #py index from 0
   axs[1,0].plot(time,exciteelectron[:,ik],label='Kpoint'+str(ksample[ik]),color=colors[ik])
   #axs[1].plot(time,hole[:,ik])

axs[1,0].legend()

kargs=setfig.getPropertyFromPosition(ylabel=r'Excitation',
                                   xlabel='Time(fs)',
                                   title='(c) Excitation at each kpoint',
                                   #hline=[0.0],
                                   xlimits=[0,None],
コード例 #15
0
ファイル: IntenseScan.py プロジェクト: charleslian/PYRAMIDS
"""
Created on Mon Dec 19 11:58:44 2016

@author: cl-iop
"""

from graphene import *
import pyramids.plot.setting as ma
import matplotlib.pyplot as plt
fig, axs = plt.subplots(2,1,sharex=False,sharey=False,figsize=(12,10))

k = (0.0,1.0) #(np.sqrt(0.5),np.sqrt(0.5))
numSample = 20
thetas = np.linspace(0,np.pi/2,numSample)
intensities = 0.2*np.sin(thetas)
colors = ma.getColors(intensities.shape[0])

args={'t0':20.0,'sigma': 8.0, 'omega':2.0, 'phi':0.0, 'parity':1, 'vFermi' : 1}

args['times'] = np.linspace(0.0, 50.0, 500.0)
args['kpoint'] = k

function = []
for index, A in enumerate(intensities):
  ax = axs[1]
  args['A'] = A
  #label = r'$A = $ %2.1f eV'% (A)
  ax.plot(args['times'], HCoeff(args['times'],args), color=colors[index])
  
  result, proj0, proj1 = excitation(args)
  ax = axs[0]
コード例 #16
0
ファイル: EELS.py プロジェクト: charleslian/PYRAMIDS
  zoomV = EELS.zoomV

if zoomX is not None:
  zoomX[0] = Q[0]
  
v = [mainV, zoomV]
x = [mainX, zoomX]
y = [mainY, zoomY]



nContour = 400 #Q.shape[0] * 5
cmap = 'jet'
ax = axs[0]
ax1 = axs[1]
c = ma.getColors(Q.shape[0])
#print np.sqrt(np.abs(np.log(Q)))
print atoms.cell
#Q = np.array(Q)
latticeVector = np.linalg.norm(atoms.cell[0,:])/(2*np.pi)
print latticeVector
dispersion = Q*np.sqrt(np.abs(np.log(Q*latticeVector)))


print dispersion
maxE = np.ones(Q.shape[0])*3.5*dispersion + 0.3


def d1dispersion(q,A,a=1):
  return A*q*np.sqrt(np.abs(np.log(q*a)))
コード例 #17
0
ファイル: ExciBandAnima.py プロジェクト: charleslian/PYRAMIDS
fig, ax = plt.subplots(1,1,sharex=False,sharey=True,figsize=(8,6))
SaveName = __file__.split('/')[-1].split('.')[0] 

kpath = ls.kpath
cut = ls.cut
print kpath
specialKPoints = ls.specialKPoints

x = ls.x

h**o = dP.getHomo()
evolvingBands = range(0, h**o + 7)

time, exe = dP.getProjectedPartition()
time, eigen = dP.getAdiabaticEigenvalue()
colors = ma.getColors(5,cmap='gnuplot') 

#for index, step in enumerate(ls.selectedTimeStep):
excited = np.abs(exe[0,kpath,:] - exe[0,kpath,:])
norm = ls.norm/np.max(exe[:,kpath,:] - exe[0,kpath,:])
eigenvalue = eigen[0,kpath,:]
line = [] 
scatter = []
for i in evolvingBands:
  if i < h**o:
    part = excited[:,i]
    if ls.drawfill:
      s = ax.fill_between(x, eigenvalue[:,i] - norm*part, 
                          eigenvalue[:,i] + norm*part,
                          lw=0.0,color='b',alpha=0.7)
    else:                    
コード例 #18
0
from pyramids.plot.PlotUtility import scanFolder
import pyramids.plot.setting as ma
import pyramids.process.struct as pps

#--------------------------------------------------------------------------------------------
def action(index,folder):
  dataCurFolder = []
  dataCurFolder.append([index, folder])
  dataCurFolder.append(dp.getEnergyTemperaturePressure(ave=True))
  dataCurFolder.append(dp.getEField())
  return dataCurFolder
  
#--------------------------------------------------------------------------------------------
fig, axs = plt.subplots(2,1,sharex=True,sharey=False,figsize=(10,8))#
data = scanFolder(action)
c = ma.getColors(len(data))

for line in data:
  index, folder = line[0]
  ax = axs[1]
  cts = ax.plot(line[1][0], line[1][2] - line[1][2][0], lw=3, label=folder, c=c[index])
  kargs=ma.getPropertyFromPosition(xlabel='Time (fs)', ylabel=r'E/atom (eV)', title='Excitation Energy')
  ma.setProperty(ax,**kargs)
  ax = axs[0]
  if index == 5:  
    cts = ax.plot(line[2][0], line[2][1][:,2], lw=1, c=c[index], label = '400 nm')
    kargs=ma.getPropertyFromPosition(xlabel='Time (fs)', ylabel=r'$\varepsilon$ (a.u.)', title='Electric Field') 
  #plt.colorbar(cts,ax=ax)
    ma.setProperty(ax,**kargs)
  #--------------------------------------------------------------------------------------------
  
コード例 #19
0
ファイル: TDEigenK.py プロジェクト: cndaqiang/py3ramids
#/usr/bin/python
"""
Created on Fri Jul 22 09:54:42 2016
@author: Chao (Charles) Lian
@email: [email protected]
"""

import matplotlib.pyplot as plt
from pyramids.io.result import getTDEig
from pyramids.plot.setting import getPropertyFromPosition
from pyramids.plot.setting import setProperty
from pyramids.plot.setting import getColors
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import os
colors = getColors(5)
#ti = 3; tf = 1000;
#selectTime =range(ti,tf) # initial timestep and final timestep
#selectBand = [0]# initial band and final band
selectKpts = [0]  #[0,1,4,6,7]# initial band and final band

numK = len(selectKpts)
fig, axs = plt.subplots(1, len(selectKpts), sharex=True, figsize=(8, 6))

#print eig.shape, time.shape,
#for diri, directory in enumerate(['TDDFT','BOMD']):
#os.chdir(directory)
time, eig = getTDEig()
#print time.shape
print eig
for k in selectKpts:
コード例 #20
0
from pyramids.plot.PlotUtility import scanFolder

data = scanFolder(plotEigenvalues)
y0 = data[0][1].flatten()
numBand = y0.shape[0]

x = []
y = []
for x1, y1, h**o in data:
    x.append(x1)
    y.append(y1.flatten() - y0)

y = np.array(y)

plotedBand = h**o + 0
colors = ma.getColors(plotedBand)
for i in range(plotedBand):
    ax.plot(x,
            y[:, i],
            '-o',
            color=colors[i],
            label=str(i) + ' + ' + str(y0[i]))

args = ma.getPropertyFromPosition(xlabel=r'$\varepsilon(a.u.)$',
                                  ylabel=r'Eigenvalues(eV)')
ma.setProperty(ax, **args)
plt.tight_layout()

for save_type in ['.pdf']:
    filename = SaveName + save_type
    plt.savefig(filename, orientation='portrait', dpi=600)
コード例 #21
0
exEnergy = 1

def action(index, folder):
#------------------------------------------------------------------------------
  timeEn, T, E_ks, E_tot, Vol, P  = dP.getEnergyTemperaturePressure()
  deltaE =  (E_tot[2:,] - E_tot[2])
  return [(index, folder), (timeEn[2:], deltaE, T[2:])]
#------------------------------------------------------------------------------

fig, axs = plt.subplots(2,1,sharex=True,sharey=False,figsize=(6,8))
SaveName = __file__.split('/')[-1].split('.')[0]


data = scanFolder(action)
#print data[-1][0][0]
chenc = ma.getColors(5)[1:-1]

#print data

maxElectrons = []
maxEnergies = []
minEnergies = []

for [(index, folder), (timeEn,deltaE, T)] in data:
  eField = float(folder) * 13.6/0.529
  ax = axs[exTemp]        
  ax.plot(timeEn, T,'-', c=c[index], 
          lw=2, alpha=1)
          
  ax = axs[exEnergy]
  ax.plot(timeEn, deltaE,'-', c=c[index],
コード例 #22
0
"""
Created on Mon Dec 19 11:58:44 2016

@author: cl-iop
"""

from graphene import *
import pyramids.plot.setting as ma
import matplotlib.pyplot as plt
fig, axs = plt.subplots(2, 1, sharex=False, sharey=False, figsize=(12, 10))

k = (0.0, 1.0)  #(np.sqrt(0.5),np.sqrt(0.5))
numSample = 20
thetas = np.linspace(0, np.pi / 2, numSample)
intensities = 0.2 * np.sin(thetas)
colors = ma.getColors(intensities.shape[0])

args = {
    't0': 20.0,
    'sigma': 8.0,
    'omega': 2.0,
    'phi': 0.0,
    'parity': 1,
    'vFermi': 1
}

args['times'] = np.linspace(0.0, 50.0, 500.0)
args['kpoint'] = k

function = []
for index, A in enumerate(intensities):
コード例 #23
0
    timeEl, exe = dP.getExcitedElectrons()
    exe -= exe[0]
    timeEn, T, E_ks, E_tot, Vol, P = dP.getEnergyTemperaturePressure()
    deltaE = (E_ks[2:, ] - E_ks[2])

    return [(index, folder), (timeEf, eField), (timeEl, exe), (timeEn, deltaE)]


#------------------------------------------------------------------------------

fig, axs = plt.subplots(1, 2, sharex=True, sharey=False, figsize=(10, 6))
SaveName = __file__.split('/')[-1].split('.')[0]

data = scanFolder(action)
#print data[-1][0][0]
c = ma.getColors(data[-1][0][0] + 1)

maxElectrons = []
maxEnergies = []
minEnergies = []

for [(index, folder), (timeEf, eField), (timeEl, exe),
     (timeEn, deltaE)] in data:
    #ax = axs[efield]
    #ax.plot(timeEf,eField[:,2], c=c[index],
    #      label=folder,lw=2,alpha=0.8)
    ax = axs[exElectron]
    ax.plot(timeEl,
            exe,
            '-',
            alpha=0.8,
コード例 #24
0
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import pyramids.io.result as dP
import pyramids.plot.setting as ma
import pyramids.plot.PlotUtility as pu
#------------------------------------------------------------------------------
time, exe = dP.getProjectedPartition()
time, eigen = dP.getAdiabaticEigenvalue()

#print eigen[:,1,:]
#h**o = dP.getHomo()
#print h**o
print exe.shape, eigen.shape
c = ma.getColors(exe.shape[2], cmap='brg')

norm = 50.0#/np.max(exe[:,:,:] -  exe[0,:,:])
#print norm
kpts = [0]
for kpt in kpts:
  fig, ax = plt.subplots(1,1,sharex=True,sharey=False,figsize=(8,6))
  SaveName = __file__.split('/')[-1].split('.')[0] + str(kpt)
  h**o = 0
  for i, band in enumerate(eigen[0,kpt,:]):
    #print band
    if band < 0:
      h**o = i
      
  evolvingBands = range(0, h**o+40)
  X, Y = np.meshgrid(time,eigen[0,kpt,evolvingBands])
  Z = np.transpose(exe[0,kpt,evolvingBands] - exe[:,kpt,evolvingBands])
コード例 #25
0
ファイル: plotAtomAE.py プロジェクト: cndaqiang/py3ramids
@author: cl-iop
"""
import numpy as np
import matplotlib.pyplot as plt
from pyramids.plot.setting import getColors
from pyramids.plot.setting import A4_LANDSCAPE
from pyramids.plot.setting import getPropertyFromPosition
from pyramids.plot.setting import setProperty
import os
fig=plt.figure(figsize=A4_LANDSCAPE)#_LANDSCAPE
plt.subplots_adjust(left=0.1, bottom=0.10, right=0.95, top=0.95, wspace=0.3, hspace=0.05)

axs = [fig.add_subplot(2,1,1),
      fig.add_subplot(2,1,2)]

colors = getColors(4)
chargeData=np.loadtxt('AECHARGE')
kargs=getPropertyFromPosition(1,'Charge(e)',r'r($\AA$)')
axs[0].plot(chargeData[:,0],chargeData[:,1],':',linewidth=3,label='Down',color=colors[1])
axs[0].plot(chargeData[:,0],chargeData[:,2],'--',linewidth=3,label='Up',color=colors[2])
axs[0].plot(chargeData[:,0],chargeData[:,3],'-',linewidth=3,label='Core',color=colors[0])
axs[0].legend(fontsize=16,loc=1)
kargs['xlimits'] = [0,6]
kargs['xticklabels'] = []
setProperty(axs[0],**kargs)

numWFfiles=int(os.popen('ls AEWFNR* |wc -l').readline())

print numWFfiles
waveData = []
lineTypes=['-','--',':']
コード例 #26
0
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import pyramids.io.result as dP
import pyramids.plot.setting as ma



#------------------------------------------------------------------------------
fig, axs = plt.subplots(3,1,sharex=True,sharey=False,figsize=(8,6))
SaveName = __file__.split('/')[-1].split('.')[0]
c = ma.getColors(2,cmap='brg')
#------------------------------------------------------------------------------
Time, exe = dP.getExcitedElectrons()
ax = axs[0]
ax.plot(Time,exe - exe[0],'.',alpha=0.8,c='b',markerfacecolor='w',lw=2,label='Excited Electrons')
kargs=ma.getPropertyFromPosition(ylabel=r'n(e)',
                                 title='', 
                                 xlimits=None,)
ma.setProperty(ax,**kargs)
#------------------------------------------------------------------------------
ax = axs[1]
time, T, E_ks, E_tot, Vol, P  = dP.getEnergyTemperaturePressure()
deltaE = (E_ks[2:] - E_ks[2]) 
deltaEt = (E_tot[2:] - E_tot[2])
#ax.plot(time[2:], deltaE,'.',c='r', lw=2, alpha=1,label='Excitation Energy')
ax.plot(time[2:], deltaEt,'.',c='g', lw=2, alpha=1,label='Excitation Energy')
kargs=ma.getPropertyFromPosition(ylabel=r'E(eV)',xlabel = r'Time(fs)',
                                 title='')
ma.setProperty(ax,**kargs)
#------------------------------------------------------------------------------
コード例 #27
0
import pyramids.process.struct as pps


#--------------------------------------------------------------------------------------------
def action(index, folder):
    dataCurFolder = []
    dataCurFolder.append([index, folder])
    dataCurFolder.append(dp.getEnergyTemperaturePressure(ave=True))
    dataCurFolder.append(dp.getEField())
    return dataCurFolder


#--------------------------------------------------------------------------------------------
fig, axs = plt.subplots(2, 1, sharex=True, sharey=False, figsize=(10, 8))  #
data = scanFolder(action)
c = ma.getColors(len(data))

for line in data:
    index, folder = line[0]
    ax = axs[1]
    cts = ax.plot(line[1][0],
                  line[1][2] - line[1][2][0],
                  lw=3,
                  label=folder,
                  c=c[index])
    kargs = ma.getPropertyFromPosition(xlabel='Time (fs)',
                                       ylabel=r'E/atom (eV)',
                                       title='Excitation Energy')
    ma.setProperty(ax, **kargs)
    ax = axs[0]
    if index == 5:
コード例 #28
0
ファイル: ipiAve.py プロジェクト: cndaqiang/py3ramids
    return [(index, folder), (timeEf, eField), (timeEl, exe),
            (timeEn[2:], deltaE)]


#------------------------------------------------------------------------------

fig, axs = plt.subplots(2, 1, sharex=True, sharey=False, figsize=(6, 8))
SaveName = __file__.split('/')[-1].split('.')[0]

#pimdData = getPIMDdata()
#axs[-1].plot(pimdData[:,0],pimdData[:,4])

data = scanFolder(action)

rows = data[-1][0][0] + 1
c = ma.getColors(rows)
exSteps = min([line[2][0].shape[0] for line in data])
exAve = np.zeros(exSteps)
enSteps = min([line[3][0].shape[0] for line in data])
enAve = np.zeros(enSteps)

for [(index, folder), (timeEf, eField), (timeEl, exe),
     (timeEn, deltaE)] in data:
    exAve += exe[:exSteps] / rows
    enAve += deltaE[:enSteps] / rows

axs[0].plot(timeEl[:exSteps], exAve, label='4 Beads')
axs[1].plot(timeEn[:enSteps], enAve, label='4 Beads')

import os
print os.chdir('../../Beads=1/E=0.10/1')
コード例 #29
0
    zoomX = EELS.zoomX
    zoomY = EELS.zoomY
    zoomV = EELS.zoomV

if zoomX is not None:
    zoomX[0] = Q[0]

v = [mainV, zoomV]
x = [mainX, zoomX]
y = [mainY, zoomY]

nContour = 400  #Q.shape[0] * 5
cmap = 'jet'
ax = axs[0]
ax1 = axs[1]
c = ma.getColors(Q.shape[0])
#print np.sqrt(np.abs(np.log(Q)))
print atoms.cell
#Q = np.array(Q)
latticeVector = np.linalg.norm(atoms.cell[0, :]) / (2 * np.pi)
print latticeVector
dispersion = Q * np.sqrt(np.abs(np.log(Q * latticeVector)))

print dispersion
maxE = np.ones(Q.shape[0]) * 3.5 * dispersion + 0.3


def d1dispersion(q, A, a=1):
    return A * q * np.sqrt(np.abs(np.log(q * a)))

コード例 #30
0
fig, ax = plt.subplots(1, 1, sharex=False, sharey=True, figsize=(8, 6))
SaveName = __file__.split('/')[-1].split('.')[0]

kpath = ls.kpath
cut = ls.cut
print kpath
specialKPoints = ls.specialKPoints

x = ls.x

h**o = dP.getHomo()
evolvingBands = range(0, h**o + 7)

time, exe = dP.getProjectedPartition()
time, eigen = dP.getAdiabaticEigenvalue()
colors = ma.getColors(5, cmap='gnuplot')

#for index, step in enumerate(ls.selectedTimeStep):
excited = np.abs(exe[0, kpath, :] - exe[0, kpath, :])
norm = ls.norm / np.max(exe[:, kpath, :] - exe[0, kpath, :])
eigenvalue = eigen[0, kpath, :]
line = []
scatter = []
for i in evolvingBands:
    if i < h**o:
        part = excited[:, i]
        if ls.drawfill:
            s = ax.fill_between(x,
                                eigenvalue[:, i] - norm * part,
                                eigenvalue[:, i] + norm * part,
                                lw=0.0,