-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding doc dumped from web and 2 example scripts for ASE
- Loading branch information
Showing
11 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Import the basic libraries | ||
|
||
# ASE system | ||
import ase | ||
from ase import Atom, Atoms | ||
from ase import io | ||
from ase.lattice.spacegroup import crystal | ||
|
||
# Spacegroup/symmetry library | ||
from pyspglib import spglib | ||
|
||
# The qe-util package | ||
from qeutil import QuantumEspresso | ||
|
||
# iPython utility function | ||
from IPython.core.display import Image | ||
|
||
# Configure qe-util for local execution of the Quantum Espresso on four processors | ||
# QuantumEspresso.pw_cmd='mpiexec -n 4 pw.x < pw.in > pw.out' | ||
|
||
a=4.3596 # Lattice constant in Angstrom | ||
cryst = crystal(['Si', 'C'], # Atoms in the crystal | ||
[(0, 0, 0), (0.25, 0.25, 0.25)], # Atomic positions (fractional coordinates) | ||
spacegroup=216, # International number of the spacegroup of the crystal | ||
cellpar=[a, a, a, 90, 90, 90]) # Unit cell (a, b, c, alpha, beta, gamma) in Angstrom, Degrees | ||
|
||
# Write the image to disk file | ||
ase.io.write('crystal.png', # The file where the picture get stored | ||
cryst, # The object holding the crystal definition | ||
format='png', # Format of the file | ||
show_unit_cell=2, # Draw the unit cell boundaries | ||
rotation='115y,15x', # Rotate the scene by 115deg around Y axis and 15deg around X axis | ||
scale=30) # Scale of the picture | ||
|
||
# Display the image | ||
Image(filename='crystal.png') | ||
|
||
print 'Space group:', spglib.get_spacegroup(cryst) | ||
|
||
# Create a Quantum Espresso calculator for our work. | ||
# This object encapsulates all parameters of the calculation, | ||
# not the system we are investigating. | ||
qe=QuantumEspresso(label='SiC', # Label for calculations | ||
wdir='.', # Working directory | ||
pseudo_dir='/usr/share/espresso/pseudo', # Directory with pseudopotentials | ||
kpts=[2,2,2], # K-space sampling for the SCF calculation | ||
xc='pz', # Exchange functional type in the name of the pseudopotentials | ||
pp_type='vbc', # Variant of the pseudopotential | ||
pp_format='UPF', # Format of the pseudopotential files | ||
ecutwfc=20, # Energy cut-off (in Rydberg) | ||
use_symmetry=False, procs=8) # Use symmetry in the calculation ? | ||
|
||
print qe.directory | ||
|
||
# Assign the calculator to our system | ||
cryst.set_calculator(qe) | ||
|
||
# Run the calculation to get stress tensor (Voigt notation, in eV/A^3) and pressure (in kBar) | ||
print "Stress tensor (Voigt notation eV/A^3):", cryst.get_stress() | ||
# print "External pressure (kBar):", cryst.get_isotropic_pressure(cryst.get_stress())*1e-3 | ||
|
||
print 'All done and functional: QE, stress.' |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from ase.lattice import bulk | ||
from ase.dft.kpoints import ibz_points, get_bandpath | ||
from ase.phonons import Phonons | ||
|
||
# The qe-util package | ||
from qeutil import QuantumEspresso | ||
|
||
# Setup crystal and EMT calculator | ||
atoms = bulk('Al', 'fcc', a=4.05) | ||
|
||
qe=QuantumEspresso(label='Al', # Label for calculations | ||
wdir='.', # Working directory | ||
pseudo_dir='/usr/share/espresso/pseudo', # Directory with pseudopotentials | ||
kpts=[2,2,2], # K-space sampling for the SCF calculation | ||
xc='pz', # Exchange functional type in the name of the pseudopotentials | ||
pp_type='vbc', # Variant of the pseudopotential | ||
pp_format='UPF', # Format of the pseudopotential files | ||
ecutwfc=15, # Energy cut-off (in Rydberg) | ||
occupations='smearing', | ||
smearing='methfessel-paxton', | ||
degauss=0.0198529, | ||
mixing_beta=0.7, mixing_mode = 'plain', diagonalization = 'cg', | ||
restart_mode='from_scratch', tstress=False, | ||
use_symmetry=False, procs=8) # Use symmetry in the calculation ? | ||
|
||
print qe.directory | ||
|
||
# Assign the calculator to our system | ||
atoms.set_calculator(qe) | ||
|
||
ph = Phonons(atoms, qe, supercell=(2,2,2), delta=0.05) | ||
ph.run() | ||
# Read forces and assemble the dynamical matrix | ||
ph.read(acoustic=True) | ||
|
||
print 'All done and functional: QE, phonons.' |