aton.api
API interfaces for ab-initio codes
This module contains interfaces for several ab-initio calculation softwares.
These interfaces can be easily expanded with the aton.txt module.
Index
aton.api.pwx |
Interface for Quantum ESPRESSO's pw.x module |
aton.api.phonopy |
Interface for Phonopy calculations |
aton.api.castep |
Interface for CASTEP calculations |
aton.api.slurm |
Batch jobs via Slurm |
Examples
Quantum ESPRESSO
To read the output from a Quantum ESPRESSO pw.x calculation,
from aton.api import pwx
# Read to a dictionary
calculation = pwx.read_out('relax.out')
calculation.keys() # See the available values
# Final energy from the calculation
energy = calculation['Energy']
To modify values from an input file,
from aton.api import pwx
# Add a hydrogen atom to a specific position
pwx.add_atom('relax.in', 'H 0.10 0.20 0.30')
# Set the input ecutwfc value
pwx.set_value('relax.in', 'ecutwfc', 60.0)
Check the full aton.api.pwx API reference for more details.
Phonopy
To perform a phonon calculation from a relaxed structure via Quantum ESPRESSO,
from aton import api
# Create the supercell inputs
api.phonopy.make_supercells(dimension='2 2 2')
# Sbatch to a cluster
api.slurm.sbatch('supercell-', 'template.slurm')
Check the full aton.api.phonopy API reference for more details.
CASTEP
To read output values from a CASTEP calculation,
from aton.api import castep
# Read the output
output = castep.read_castep('calculation.castep')
# Get the final energy
energy = output['Energy']
Check the full aton.api.castep API reference for more details.
1""" 2# API interfaces for *ab-initio* codes 3 4This module contains interfaces for several *ab-initio* calculation softwares. 5These interfaces can be easily expanded with the `aton.txt` module. 6 7 8# Index 9 10| | | 11| --- | --- | 12| `aton.api.pwx` | Interface for [Quantum ESPRESSO](https://www.quantum-espresso.org/)'s [pw.x](https://www.quantum-espresso.org/Doc/INPUT_PW.html) module | 13| `aton.api.phonopy` | Interface for [Phonopy](https://phonopy.github.io/phonopy/) calculations | 14| `aton.api.castep` | Interface for [CASTEP](https://castep-docs.github.io/castep-docs/) calculations | 15| `aton.api.slurm` | Batch jobs via [Slurm](https://slurm.schedmd.com/) | 16 17 18# Examples 19 20## Quantum ESPRESSO 21 22To read the output from a Quantum ESPRESSO pw.x calculation, 23```python 24from aton.api import pwx 25# Read to a dictionary 26calculation = pwx.read_out('relax.out') 27calculation.keys() # See the available values 28# Final energy from the calculation 29energy = calculation['Energy'] 30``` 31 32To modify values from an input file, 33```python 34from aton.api import pwx 35# Add a hydrogen atom to a specific position 36pwx.add_atom('relax.in', 'H 0.10 0.20 0.30') 37# Set the input ecutwfc value 38pwx.set_value('relax.in', 'ecutwfc', 60.0) 39``` 40 41Check the full `aton.api.pwx` API reference for more details. 42 43 44## Phonopy 45 46To perform a phonon calculation from a relaxed structure via Quantum ESPRESSO, 47```python 48from aton import api 49# Create the supercell inputs 50api.phonopy.make_supercells(dimension='2 2 2') 51# Sbatch to a cluster 52api.slurm.sbatch('supercell-', 'template.slurm') 53``` 54 55Check the full `aton.api.phonopy` API reference for more details. 56 57 58## CASTEP 59 60To read output values from a CASTEP calculation, 61```python 62from aton.api import castep 63# Read the output 64output = castep.read_castep('calculation.castep') 65# Get the final energy 66energy = output['Energy'] 67``` 68 69Check the full `aton.api.castep` API reference for more details. 70 71""" 72 73 74from . import pwx 75from . import phonopy 76from . import castep 77from . import slurm