-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Kitchin
committed
Jul 15, 2014
1 parent
fb767fa
commit c398c47
Showing
254 changed files
with
5,114 additions
and
5,057 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,8 @@ molecules | |
ltxpnggh-pages | ||
gh-pages | ||
ltxpng | ||
/auto/dft.el | ||
/dft.brf | ||
/dft.tex | ||
/mk4ht.cfg | ||
/topics-to-discuss.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,58 @@ | ||
# step 1 frozen atoms and shape at different volumes | ||
from ase import Atom, Atoms | ||
import numpy as np | ||
from jasp import * | ||
import matplotlib.pyplot as plt | ||
''' | ||
create a TiO2 structure from the lattice vectors at | ||
http://cst-www.nrl.navy.mil/lattice/struk/c4.html | ||
''' | ||
a = 4.59 # experimental degrees of freedom. | ||
c = 2.96 | ||
u = 0.3 #internal degree of freedom! | ||
#primitive vectors | ||
a1 = a*np.array([1.0, 0.0, 0.0]) | ||
a2 = a*np.array([0.0, 1.0, 0.0]) | ||
a3 = c*np.array([0.0, 0.0, 1.0]) | ||
atoms = Atoms([Atom('Ti', [0., 0., 0.]), | ||
Atom('Ti', 0.5 * a1 + 0.5 * a2 + 0.5 * a3), | ||
Atom('O', u * a1 + u * a2), | ||
Atom('O', -u * a1 - u * a2), | ||
Atom('O', (0.5 + u) * a1 + (0.5 - u) * a2 + 0.5 * a3), | ||
Atom('O', (0.5 - u) * a1 + (0.5 + u) * a2 + 0.5 * a3)], | ||
cell=[a1, a2, a3]) | ||
v0 = atoms.get_volume() | ||
cell0 = atoms.get_cell() | ||
factors = [0.9, 0.95, 1.0, 1.05, 1.1] #to change volume by | ||
energies1, volumes1 = [], [] # from step 1 | ||
energies, volumes = [], [] # for step 2 | ||
energies, volumes = [], [] | ||
ready = True | ||
for f in factors: | ||
with jasp('bulk/tio2/step1-{0:1.2f}'.format(f)) as calc: | ||
atoms = calc.get_atoms() | ||
energies1.append(atoms.get_potential_energy()) | ||
volumes1.append(atoms.get_volume()) | ||
calc.clone('bulk/tio2/step2-{0:1.2f}'.format(f)) | ||
# now set ISIF=4 and run | ||
with jasp('bulk/tio2/step2-{0:1.2f}'.format(f), | ||
isif=4) as calc: | ||
atoms = calc.get_atoms() | ||
v1 = f*v0 | ||
cell_factor = (v1 / v0)**(1. / 3.) | ||
atoms.set_cell(cell0 * cell_factor, scale_atoms=True) | ||
with jasp('bulk/tio2/step1-{0:1.2f}'.format(f), | ||
encut=520, | ||
kpts=(5,5,5), | ||
isif=2, # relax internal degrees of freedom | ||
ibrion=1, | ||
nsw=50, | ||
xc='PBE', | ||
sigma=0.05, | ||
atoms=atoms) as calc: | ||
try: | ||
energies.append(atoms.get_potential_energy()) | ||
volumes.append(atoms.get_volume()) | ||
except (VaspSubmitted, VaspQueued): | ||
ready = False | ||
if not ready: | ||
import sys; sys.exit() | ||
import matplotlib.pyplot as plt | ||
plt.plot(volumes1, energies1, volumes, energies) | ||
plt.plot(volumes, energies) | ||
plt.xlabel('Vol. ($\AA^3)$') | ||
plt.ylabel('Total energy (eV)') | ||
plt.legend(['step 1', 'step 2'], loc='best') | ||
plt.savefig('images/tio2-step2.png') | ||
plt.show() | ||
plt.savefig('images/tio2-step1.png') | ||
print '#+tblname: tio2-vol-ene' | ||
print '#+caption: Total energy of TiO_{2} vs. volume.' | ||
print '| Volume ($\AA^3$) | Energy (eV) |' | ||
print '|-' | ||
for v, e in zip(volumes, energies): | ||
print '| {0} | {1} |'.format(v, e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,29 @@ | ||
from jasp import * | ||
with jasp('bulk/tio2/step2-1.05') as calc: | ||
calc.clone('bulk/tio2/step3') | ||
with jasp('bulk/tio2/step3', | ||
isif=3) as calc: | ||
calc.calculate() | ||
atoms = calc.get_atoms() | ||
print calc | ||
from pyspglib import spglib | ||
print '\nThe spacegroup is {0}'.format(spglib.get_spacegroup(atoms)) | ||
factors = [0.9, 0.95, 1.0, 1.05, 1.1] #to change volume by | ||
energies1, volumes1 = [], [] # from step 1 | ||
energies, volumes = [], [] # for step 2 | ||
ready = True | ||
for f in factors: | ||
with jasp('bulk/tio2/step1-{0:1.2f}'.format(f)) as calc: | ||
atoms = calc.get_atoms() | ||
energies1.append(atoms.get_potential_energy()) | ||
volumes1.append(atoms.get_volume()) | ||
calc.clone('bulk/tio2/step2-{0:1.2f}'.format(f)) | ||
# now set ISIF=4 and run | ||
with jasp('bulk/tio2/step2-{0:1.2f}'.format(f), | ||
isif=4) as calc: | ||
atoms = calc.get_atoms() | ||
try: | ||
energies.append(atoms.get_potential_energy()) | ||
volumes.append(atoms.get_volume()) | ||
except (VaspSubmitted, VaspQueued): | ||
ready = False | ||
if not ready: | ||
import sys; sys.exit() | ||
import matplotlib.pyplot as plt | ||
plt.plot(volumes1, energies1, volumes, energies) | ||
plt.xlabel('Vol. ($\AA^3)$') | ||
plt.ylabel('Total energy (eV)') | ||
plt.legend(['step 1', 'step 2'], loc='best') | ||
plt.savefig('images/tio2-step2.png') | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from jasp import * | ||
with jasp('bulk/tio2/step3') as calc: | ||
with jasp('bulk/tio2/step2-1.05') as calc: | ||
calc.clone('bulk/tio2/step3') | ||
with jasp('bulk/tio2/step3', | ||
isif=3) as calc: | ||
calc.calculate() | ||
atoms = calc.get_atoms() | ||
print 'default ismear: ',atoms.get_potential_energy() | ||
calc.clone('bulk/tio2/step4') | ||
with jasp('bulk/tio2/step4', | ||
ismear=-5, | ||
nsw=0) as calc: | ||
atoms = calc.get_atoms() | ||
print 'ismear=-5: ',atoms.get_potential_energy() | ||
print calc | ||
from pyspglib import spglib | ||
print '\nThe spacegroup is {0}'.format(spglib.get_spacegroup(atoms)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,10 @@ | ||
from jasp import * | ||
from ase import Atom, Atoms | ||
from ase.utils.eos import EquationOfState | ||
LC = [3.75, 3.80, 3.85, 3.90, 3.95, 4.0, 4.05, 4.1] | ||
volumes, energies = [],[] | ||
for a in LC: | ||
atoms = Atoms([Atom('Pd', (0, 0, 0))], | ||
cell=0.5 * a*np.array([[1.0, 1.0, 0.0], | ||
[0.0, 1.0, 1.0], | ||
[1.0, 0.0, 1.0]])) | ||
with jasp('bulk/Pd-LDA-{0}'.format(a), | ||
encut=350, | ||
kpts=(12,12,12), | ||
xc='LDA', | ||
atoms=atoms): | ||
try: | ||
e = atoms.get_potential_energy() | ||
energies.append(e) | ||
volumes.append(atoms.get_volume()) | ||
except (VaspSubmitted, VaspQueued): | ||
pass | ||
if len(energies) == len(LC): | ||
eos = EquationOfState(volumes, energies) | ||
v0, e0, B = eos.fit() | ||
print 'LDA lattice constant is {0:1.3f} Ang^3'.format((4*v0)**(1./3.)) | ||
with jasp('bulk/tio2/step3') as calc: | ||
atoms = calc.get_atoms() | ||
print 'default ismear: ',atoms.get_potential_energy() | ||
calc.clone('bulk/tio2/step4') | ||
with jasp('bulk/tio2/step4', | ||
ismear=-5, | ||
nsw=0) as calc: | ||
atoms = calc.get_atoms() | ||
print 'ismear=-5: ',atoms.get_potential_energy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
from jasp import * | ||
from ase.lattice.cubic import FaceCenteredCubic | ||
from ase import Atoms, Atom | ||
# bulk system | ||
atoms = FaceCenteredCubic(directions=[[0,1,1], | ||
[1,0,1], | ||
[1,1,0]], | ||
size=(1,1,1), | ||
symbol='Rh') | ||
with jasp('bulk/bulk-rh', | ||
xc='PBE', | ||
encut=350, | ||
kpts=(4,4,4), | ||
isif=3, | ||
ibrion=2, | ||
nsw=10, | ||
atoms=atoms) as calc: | ||
bulk_energy = atoms.get_potential_energy() | ||
# atomic system | ||
atoms = Atoms([Atom('Rh',[5, 5, 5])], | ||
cell=(7, 8, 9)) | ||
with jasp('bulk/atomic-rh', | ||
xc='PBE', | ||
encut=350, | ||
kpts=(1, 1, 1), | ||
atoms=atoms) as calc: | ||
atomic_energy = atoms.get_potential_energy() | ||
cohesive_energy = atomic_energy - bulk_energy | ||
print 'The cohesive energy is {0:1.3f} eV'.format(cohesive_energy) | ||
from ase import Atom, Atoms | ||
from ase.utils.eos import EquationOfState | ||
LC = [3.75, 3.80, 3.85, 3.90, 3.95, 4.0, 4.05, 4.1] | ||
GGA = {'AM':'AM05', | ||
'PE':'PBE', | ||
'PS':'PBEsol', | ||
'RP':'RPBE'} | ||
for key in GGA: | ||
volumes, energies = [],[] | ||
for a in LC: | ||
atoms = Atoms([Atom('Pd', (0, 0, 0))], | ||
cell=0.5 * a*np.array([[1.0, 1.0, 0.0], | ||
[0.0, 1.0, 1.0], | ||
[1.0, 0.0, 1.0]])) | ||
with jasp('bulk/Pd-GGA-{1}-{0}'.format(a,key), | ||
encut=350, | ||
kpts=(12,12,12), | ||
xc='LDA', | ||
gga=key, | ||
atoms=atoms): | ||
try: | ||
e = atoms.get_potential_energy() | ||
energies.append(e) | ||
volumes.append(atoms.get_volume()) | ||
except (VaspSubmitted, VaspQueued): | ||
pass | ||
if len(energies) == len(LC): | ||
eos = EquationOfState(volumes, energies) | ||
v0, e0, B = eos.fit() | ||
print '{1:6s} lattice constant is {0:1.3f} Ang^3'.format((4*v0)**(1./3.), | ||
GGA[key]) | ||
else: | ||
print energies, LC | ||
print '{0} is not ready'.format(GGA[key]) |
Oops, something went wrong.