VASP with FileIOCalculator
Hi,
I've been trying to access several default ASE functions, such as the band_structure
module, when I realised that the current implementation of the VASP module isn't compatible with the FileIOCalculator
, or even inheriting from it. I took a look at the VaspInteractive
, but I don't feel like it is in line with the general "spirit" of the ASE calculators - although it has some nice ideas, I think it would be nice to have a standard VASP FileIOCalculator
, which has the same syntax, as for other calculator objects.
So I sat down, and took some inspiration from the current VASP implementation, as well as the VaspInteractive and some of the other calculator objects, and I started writing a version which inherits from the FileIOCalculator
, although I still need to do a lot of testing & documenting.
I'll be opening a WIP Merge request on this soon, but I figured it would be nice to have a place to discuss the layout of such a module.
Some of the things I've tried to keep in mind:
- The directory of the
label
should be used everywhere for reading, writing and running - Reading large files, especially
OUTCAR
andvasprun.xml
should be done as few times as possible, so I've implemented some ways of passing existing lines, or storing the read file, as storing this in memory is more favorable than reading it over, and over and over again, just to keep it out of memory in my opinion.- Here, you might notice a lot of functions have been given a keyword
lines
, which basically allows you to pass on lines which have already been read from the OUTCAR, instead of reloading it. This is primarily used inread_outcar()
, but could potentially see other use.
- Here, you might notice a lot of functions have been given a keyword
- The syntax and implemented properties follow the general
Calculator
rules, as to allow for usage of other ASE packages directly. - Direct access to the
kpts
, via theinput_params
dict, usingproperty
, in order to keep the calculator object compatible with the existingcreate_input
module.
I havn't added in the xdat2traj
, VaspChargeDensity
or VaspDos
objects, as I havn't really used them before, but as far as I can tell, they could just be appended at the end of the file, or perhaps kept in a separate file to minimize the clutter.
Any comments or suggestions are most welcome!
Naturally, the file should be renamed to vasp.py
, once it's ready to be implemented into ASE
.