Band structure of bulk graphene: Difference between revisions
From phys824
Jump to navigationJump to search
(Created page with "<pre> import numpy as np 2 from math import sqrt 3 from sys import argv 4 from ase import Atoms 5 from ase.lattice.surface import hcp0001 6 from gpaw import GPA...") |
|||
(22 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Graphene using grid== | |||
*graphene_grid.py: | |||
<pre> | <pre> | ||
from gpaw import GPAW, FermiDirac | |||
from ase import Atoms | |||
from ase.io import read, write | |||
from gpaw import GPAW, PoissonSolver, Mixer | |||
from ase.structure import bulk | |||
# ------------------------------------------------------------- | |||
# Bulk configuration | |||
# ------------------------------------------------------------- | |||
gnr = bulk('C', 'hcp', a=2.4612, c=6.709) # hexagonal close-packed (hpc) | |||
gnr.positions=([[ 0. , 0., 0.], [ 1.23060, 0.7104873, 0. ]]) | |||
write('gr.traj', gnr) | |||
# Make self-consistent calculation and save results | |||
calc = GPAW(h=0.18, | |||
mode='fd', #finite difference(fd) | |||
xc='PBE', | |||
kpts=(5,5,1), | |||
occupations=FermiDirac(width=0.05, maxiter=2000), | |||
mixer=Mixer(beta=0.010, nmaxold=8, weight=100.0), | |||
poissonsolver=PoissonSolver(eps=1e-12), | |||
txt='band_sc.txt') | |||
gnr.set_calculator(calc) | |||
gnr.get_potential_energy() | |||
calc.write('band_sc.gpw') | |||
from ase.dft.kpoints import ibz_points, get_bandpath | |||
points = ibz_points['hexagonal'] | |||
G = points['Gamma'] | |||
K = points['K'] | |||
M = points['M'] | |||
kpts, x, X = get_bandpath([K, G, M, K], gnr.cell, 60) | |||
calc = GPAW('band_sc.gpw', | |||
mode='fd', | |||
kpts=kpts, | |||
txt='band_harris.txt', | |||
fixdensity=True, | |||
parallel={'domain': 1}, | |||
eigensolver='cg', # 'cg' is allowed for grid method only | |||
usesymm=None, | |||
convergence={'bands': 'all'}) | |||
if calc.input_parameters['mode'] == 'lcao': | |||
calc.scf.reset() | |||
calc.get_potential_energy() | |||
ef = calc.get_fermi_level() | |||
calc.write('band_harris.gpw') | |||
# Extract eigenenergies into a file for plotting with some external package | |||
import numpy as np | |||
calc = GPAW('band_harris', txt=None) | |||
eps_skn = np.array([[calc.get_eigenvalues(k,s) | |||
for k in range(40)] | |||
for s in range(1)]) - ef | |||
f = open('bands.dat', 'w') | |||
for n in range(8): | |||
for k in range(40): | |||
print >>f, k, eps_skn[0, k, n] | |||
print >>f | |||
</pre> | |||
==Graphene using LCAO== | |||
*graphene_lcao.py: | |||
<pre> | |||
from gpaw import GPAW, FermiDirac | |||
from ase import Atoms | |||
from ase.io import read, write | |||
from gpaw import GPAW, PoissonSolver, Mixer | |||
from ase.structure import bulk | |||
# ------------------------------------------------------------- | |||
# Bulk configuration | |||
# ------------------------------------------------------------- | |||
gnr = bulk('C', 'hcp', a=2.4612, c=6.709) | |||
gnr.positions=([[ 0. , 0., 0.], [ 1.23060, 0.7104873, 0. ]]) | |||
write('gnr.traj', gnr) | |||
# Make self-consistent calculation and save results | |||
calc = GPAW(h=0.18, | |||
mode='lcao', | |||
xc='PBE', | |||
basis='szp(dzp)', | |||
kpts=(5,5,1), | |||
occupations=FermiDirac(width=0.05, maxiter=2000), | |||
mixer=Mixer(beta=0.010, nmaxold=8, weight=100.0), | |||
poissonsolver=PoissonSolver(eps=1e-12), | |||
txt='band_sc.txt') | |||
gnr.set_calculator(calc) | |||
gnr.get_potential_energy() | |||
calc.write('band_sc.gpw') | |||
from ase.dft.kpoints import ibz_points, get_bandpath | |||
points = ibz_points['hexagonal'] | |||
G = points['Gamma'] | |||
K = points['K'] | |||
M = points['M'] | |||
kpts, x, X = get_bandpath([K, G, M, K], gnr.cell, 40) | |||
calc = GPAW('band_sc.gpw', | |||
mode='lcao', | |||
xc='PBE', | |||
basis='szp(dzp)', | |||
kpts=kpts, | |||
txt='band_harris.txt', | |||
fixdensity=True, | |||
parallel={'domain': 1}, | |||
usesymm=None, | |||
convergence={'bands': 'all'}) | |||
if calc.input_parameters['mode'] == 'lcao': | |||
calc.scf.reset() | |||
calc.get_potential_energy() | |||
ef = calc.get_fermi_level() | |||
calc.write('band_harris.gpw') | |||
# Extract eigenenergies into a file for plotting with some external package | |||
import numpy as np | |||
calc = GPAW('band_harris', txt=None) | |||
eps_skn = np.array([[calc.get_eigenvalues(k,s) | |||
for k in range(40)] | |||
for s in range(1)]) - ef | |||
f = open('bands.dat', 'w') | |||
for n in range(8): | |||
for k in range(40): | |||
print >>f, k, eps_skn[0, k, n] | |||
print >>f | |||
</pre> | </pre> |
Latest revision as of 14:41, 17 November 2014
Graphene using grid
- graphene_grid.py:
from gpaw import GPAW, FermiDirac from ase import Atoms from ase.io import read, write from gpaw import GPAW, PoissonSolver, Mixer from ase.structure import bulk # ------------------------------------------------------------- # Bulk configuration # ------------------------------------------------------------- gnr = bulk('C', 'hcp', a=2.4612, c=6.709) # hexagonal close-packed (hpc) gnr.positions=([[ 0. , 0., 0.], [ 1.23060, 0.7104873, 0. ]]) write('gr.traj', gnr) # Make self-consistent calculation and save results calc = GPAW(h=0.18, mode='fd', #finite difference(fd) xc='PBE', kpts=(5,5,1), occupations=FermiDirac(width=0.05, maxiter=2000), mixer=Mixer(beta=0.010, nmaxold=8, weight=100.0), poissonsolver=PoissonSolver(eps=1e-12), txt='band_sc.txt') gnr.set_calculator(calc) gnr.get_potential_energy() calc.write('band_sc.gpw') from ase.dft.kpoints import ibz_points, get_bandpath points = ibz_points['hexagonal'] G = points['Gamma'] K = points['K'] M = points['M'] kpts, x, X = get_bandpath([K, G, M, K], gnr.cell, 60) calc = GPAW('band_sc.gpw', mode='fd', kpts=kpts, txt='band_harris.txt', fixdensity=True, parallel={'domain': 1}, eigensolver='cg', # 'cg' is allowed for grid method only usesymm=None, convergence={'bands': 'all'}) if calc.input_parameters['mode'] == 'lcao': calc.scf.reset() calc.get_potential_energy() ef = calc.get_fermi_level() calc.write('band_harris.gpw') # Extract eigenenergies into a file for plotting with some external package import numpy as np calc = GPAW('band_harris', txt=None) eps_skn = np.array([[calc.get_eigenvalues(k,s) for k in range(40)] for s in range(1)]) - ef f = open('bands.dat', 'w') for n in range(8): for k in range(40): print >>f, k, eps_skn[0, k, n] print >>f
Graphene using LCAO
- graphene_lcao.py:
from gpaw import GPAW, FermiDirac from ase import Atoms from ase.io import read, write from gpaw import GPAW, PoissonSolver, Mixer from ase.structure import bulk # ------------------------------------------------------------- # Bulk configuration # ------------------------------------------------------------- gnr = bulk('C', 'hcp', a=2.4612, c=6.709) gnr.positions=([[ 0. , 0., 0.], [ 1.23060, 0.7104873, 0. ]]) write('gnr.traj', gnr) # Make self-consistent calculation and save results calc = GPAW(h=0.18, mode='lcao', xc='PBE', basis='szp(dzp)', kpts=(5,5,1), occupations=FermiDirac(width=0.05, maxiter=2000), mixer=Mixer(beta=0.010, nmaxold=8, weight=100.0), poissonsolver=PoissonSolver(eps=1e-12), txt='band_sc.txt') gnr.set_calculator(calc) gnr.get_potential_energy() calc.write('band_sc.gpw') from ase.dft.kpoints import ibz_points, get_bandpath points = ibz_points['hexagonal'] G = points['Gamma'] K = points['K'] M = points['M'] kpts, x, X = get_bandpath([K, G, M, K], gnr.cell, 40) calc = GPAW('band_sc.gpw', mode='lcao', xc='PBE', basis='szp(dzp)', kpts=kpts, txt='band_harris.txt', fixdensity=True, parallel={'domain': 1}, usesymm=None, convergence={'bands': 'all'}) if calc.input_parameters['mode'] == 'lcao': calc.scf.reset() calc.get_potential_energy() ef = calc.get_fermi_level() calc.write('band_harris.gpw') # Extract eigenenergies into a file for plotting with some external package import numpy as np calc = GPAW('band_harris', txt=None) eps_skn = np.array([[calc.get_eigenvalues(k,s) for k in range(40)] for s in range(1)]) - ef f = open('bands.dat', 'w') for n in range(8): for k in range(40): print >>f, k, eps_skn[0, k, n] print >>f