Exemple #1
0
try:
    from pylab import *
except:
    pass
from ase import Atoms as ase_Atoms
from hotbit import *
from hotbit.atoms import Atoms
from hotbit.test.misc import default_param
from numpy import *
from box.systems import graphene
from ase.data.molecules import molecule

eps = 1E-6

if True:
    atoms = graphene(2, 2, 1.42)
    calc = Hotbit(SCC=False, kpts=(4, 4, 1), txt='-', **default_param)
    atoms.set_calculator(calc)
    atoms.get_potential_energy()

    # compare to Fig.4 of Koskinen & Makinen, CMS 47, 237 (2009)
    if False:
        w = 0.2
        x, y = calc.get_covalent_energy('default', width=w, window=(-20, 15))
        plot(x, y, label='total')
        axhline(0)
        x, y = calc.get_covalent_energy('angmom',
                                        i=0,
                                        j=0,
                                        width=w,
                                        window=(-20, 15))
Exemple #2
0
from ase import *
from hotbit import *
from box.md import check_energy_conservation
from box.systems import graphene
from numpy import *
from hotbit.test.misc import default_param

R=1.416552
nkpts = 10

# graphene's cohesion energy
atoms=graphene(2,2,R)
atoms=Atoms('C2',[(0,0,0),(2*cos(pi/6)*R,R,0)],pbc=(True,True,False),\
            cell=array([[2*cos(pi/6)*R,0,0],[R*cos(pi/6),R*1.5,0],[0,0,5]]) )

calc=Hotbit(SCC=False,txt='graphene.cal',kpts=(nkpts,nkpts,1),**default_param) 
atoms.set_calculator(calc)
coh = atoms.get_potential_energy()/2
assert abs(-9.626283-coh)<1E-6



# energy conservation
atoms[0].z+=0.1
calc=Hotbit(SCC=False,txt='graphene.cal',kpts=(3,3,1),**default_param) 
atoms.set_calculator(calc)
assert check_energy_conservation(atoms,dt=0.5*units.fs,steps=30,tol=1E-2,plot=False)


Exemple #3
0
import ase.units as units
from ase import *
from hotbit import *
from box.md import check_energy_conservation
from box.systems import graphene
from numpy import *
from hotbit.test.misc import default_param

R=1.416552
nkpts = 10

# graphene's cohesion energy
atoms=graphene(2,2,R)
atoms=Atoms('C2',[(0,0,0),(2*cos(pi/6)*R,R,0)],pbc=(True,True,False),\
            cell=array([[2*cos(pi/6)*R,0,0],[R*cos(pi/6),R*1.5,0],[0,0,5]]) )

calc=Hotbit(SCC=False,txt='graphene.cal',kpts=(nkpts,nkpts,1),**default_param) 
atoms.set_calculator(calc)
coh = atoms.get_potential_energy()/2
assert abs(-9.626283-coh)<1E-5


# energy conservation
atoms[0].z+=0.1
calc=Hotbit(SCC=False,txt='graphene.cal',kpts=(3,3,1),**default_param) 
atoms.set_calculator(calc)
assert check_energy_conservation(atoms,dt=0.5*units.fs,steps=30,tol=1E-2,plot=False)


Exemple #4
0
try:
    from pylab import *
except:
    pass
from ase import Atoms as ase_Atoms
from hotbit import *
from hotbit.atoms import Atoms
from hotbit.test.misc import default_param
from numpy import *
from box.systems import graphene
from ase.data.molecules import molecule

eps = 1E-6

if True:
    atoms = graphene(2,2,1.42)
    calc = Hotbit(SCC=False,kpts=(4,4,1),txt='-',**default_param)
    atoms.set_calculator(calc)
    atoms.get_potential_energy()
    
    # compare to Fig.4 of Koskinen & Makinen, CMS 47, 237 (2009)
    if False:
        w=0.2
        x,y = calc.get_covalent_energy('default',width=w,window=(-20,15))
        plot(x,y,label='total')
        axhline(0)
        x,y = calc.get_covalent_energy('angmom',i=0,j=0,width=w,window=(-20,15))
        plot(x,y,label='ss')
        x,y = calc.get_covalent_energy('angmom',i=0,j=1,width=w,window=(-20,15))
        plot(x,y,label='sp')
        x,y = calc.get_covalent_energy('angmom',i=1,j=1,width=w,window=(-20,15))