文書の過去の版を表示しています。
目次
Jacapo
– Dacapoに対するASEのpythonインターフェイス – このページは本家サイトの日本語訳である。
Introduction
JacapoはDacapoのためのASEのインターフェイスで、ASE1)と完全な互換性がある。JacapoはNumeric pythonとASE第2版を用いていた古いDacapoインターフェイスを置き換えるものである。プログラムは元々John Kitchinによって開発され、詳細な説明書が多くの例題とともにネットに公開されていた。2) JacapoはASEのオプション的な計算エンジンといった位置付けであり、前述の説明書とは若干の差異が生じており、説明書ももうメンテナンスをされていない。
Jacapo calculator
The Jacapo interface is automatically installed with ase and can be imported using:
from ase.calculators.jacapo import Jacapo (You will need to have a working installation of Dacapo, however.)
class ase.calculators.jacapo.Jacapo Here is a list of available keywords to initialize the calculator:
keyword | type | description | |
---|---|---|---|
nc | str | Output NetCDF file, or input file if nc already exists. | |
outnc | str | Output file. By default equal to nc. | |
atoms | object | Atoms object | |
pw | float | Planewave cutoff in eV | |
dw | float | Density cutoff in eV | |
xc | str | Exchange-correlation functional. One of [‘PZ’,’VWN’,’PW91’,’PBE’,’RPBE’,’revPBE’] | |
nbands | int | Number of bands | |
ft | float | Fermi temperature | |
kpts | list | K-point grid, e.g. kpts = (2,2,1) | |
spinpol | boolean | Turn on/off spin-polarization | |
fixmagmom | str | Magnetic moment of the unit cell | |
symmetry | boolean | Turn on/off symmetry reduction | |
stress | boolean | Turn on/off stress calculation | |
dipole | boolean | Turn on/off dipole correction | |
ados | dict | Atom-projected density of states | |
stay_alive | boolean | Turn on/off stay alive | |
debug | int | Set debug level (0=off, 10=extreme) | |
deletenc | boolean | If the nc file exists, delete it (to ensure a fresh run). Default is False. |
Example
Here is an example of how to calculate the total energy of a H atom.
Warning
This is an example only - the parameters are not physically meaningful!
from ase import Atoms, Atom from ase.io import write from ase.calculators.jacapo import Jacapo atoms = Atoms([Atom('H',[0,0,0])], cell=(2,2,2), pbc=True) calc = Jacapo('Jacapo-test.nc', pw=200, nbands=2, kpts=(1,1,1), spinpol=False, dipole=False, symmetry=False, ft=0.01) atoms.set_calculator(calc) print(atoms.get_potential_energy()) write('Jacapo-test.traj', atoms)
Note that all calculator parameters should be set in the calculator definition itself. Do not attempt to use the calc.set_* commands as they are intended to be internal to the calculator. Note also that Dacapo can only operate with periodic boundary conditions, so be sure that pbc is set to True.
Restarting from an old calculation
If the file you specify to Jacapo with the nc keyword exists, Jacapo will assume you are attempting to restart an existing calculation. If you do not want this behavior, turn the flag deletenc to True in your calculator definition.
For example, it is possible to continue a geometry optimization with something like this:
calc = Jacapo('old.nc', stay_alive=True) atoms = calc.get_atoms() dyn = QuasiNewton(atoms, logfile='qn.log') dyn.run(fmax=0.05)
Note, that the stay_alive flag is not stored in the .nc file and must be set when the calculator instance is created.
Atom-projected density of states
To find the atom-projected density of states with Jacapo, first specify the ados dictionary in your calculator definition, as in:
calc = Jacapo( ... , ados={'energywindow': (-10., 5.), 'energywidth': 0.2, 'npoints': 250, 'cutoff': 1.0})
After this is established, you can use the get_ados command to get the desired ADOS data. For example:
energies, dos = calc.get_ados(atoms=[0], orbitals=['d'], cutoff='short', spin=[0])
© Copyright 2017, ASE-developers. Last updated on Wed, 22 May 2019 07:03:39.