'read_data()' is a generator interpreting a file as a sequence of
floats. Lines starting with '#' are ignored.
'read_header_and_data()' reads the header string until a line
"# END ...", initializes a generator 'read_data()', and returns
them.
'vasp_converter.py' is based on the existing 'wien2k_converter.py'.
Methods 'read_header_and_data()' and 'read_data()' for reading input files
are added. The first method returns a JSON-header and a generator 'read_data()'
returning floats from the plain-data part of the file.
'main()' now calls a function 'output_as_text()' responsible for storing
both a ctrl- and plo-files ('ctrl_output()' and 'plo_output()', respectively).
Added function 'ctrl_ouput()' which stores data common for all correlated
shells into a file '<basename>.ctrl'.
At the moment, only a very basic header is output.
The signature of 'plo_output()' is also modified to include an instance
of class 'ElectronicStructre' containing important information on
the lattice structure, Efermi, and k-points.
Parsing of two optional parameters (BASENAME and EFERMI) from section [General] from the config-file
is implemented. If this section is not found the parameters are set to their
default values, which is 'vasp' for BASENAME and nothing for EFERMI.
Appropriate test is added to the 'inpconf' test suite.
A description of the output file formats is added to the documentation.
In particular, the outline of JSON headers for projector-group (*.plog<Ng>)
and control (*.ctrl) files are given.
The names of the test suites have been prefixed with an underscore
to avoid name conflicts with corresponding modules.
Also an attempt to make a scan of all tests has been made by
creating a 'test_all.py' script that is supposed to discover all
test cases and run them. Unfortunately, this does not work as expected
because many tests use input files assumed to be found in the current
directory, which is not true if the tests are run from a different
(parent) directory.
This can be fixed by either forcing the change of directory (but it
seems that 'unittest' does not have this functionality) or
prepending input file names with the current module directory.
Subroutine 'kpoints_output()' is added to 'plotools.py' and is invoked
from 'main.py'.
K-points are output in a separate file <basename>.kpoints that is
common to all PLO groups. If present, tetrahedron data is also stored.
Generation and orthogonalization of PLOs should be separated
because some quantities (such as the LDA density matrix) are calculated
using the original raw projectors.
The orthogonalization routine is now called from 'main.py'.
In the previous commit the calculation of 'nelect' was implemented
incorrectly. The sum over k-points must also contain k-weights
and a spin factor (2.0 for ns = 1).
The calculation of 'nelect' is now implemented as a separate method
of ProjectorGroup.
Output of PLO groups into a text file is added to 'plo_output()'.
The file format is provisional and can change in future versions.
Also, an attribute 'nelect' providing the number of electrons in
the selected energy window is added to ProjectorGroup.
The documentation has been slightly rewritten and extended to follow
the recent changes. The modifications include:
- ProjectorSet class is now replaced by ProjectorShell
- the workflow has been refined
- the electronic structure part is represented by class ElectronicStructure
A method 'density_matrix()' for evaluating a density matrix of a given shell
has been added to class ProjectorShell. It requires an ElectronicStructure
object as an input an by default produces a site- and spin-diagonal
part of the density matrix using the Fermi-weights obtained directly from VASP.
Ideally, this density matrix should coincide with the one calculated
within VASP itself (inside the LDA+U module).
Corresponding sanity test has been added, which shows only that the
calculation does not crash. Real numerical tests are needed.
Class ElectronicStructure is intended for the internal representation
of the band structure and raw projector data from VASP.
In addition, its purpose is to perform a simple consistency check
of the input VASP data (as they are read from different files).
When a ProjectorShell is created it creates a view of the full
projector array with orbital 'ilm' and band 'ib' indices interchanged.
The reason for this is that this corresponds more naturally to the
definition of the projector P_{m\nu} and also allows for multiplications
of projector matrices without additional transposition.
The tests have been modified accordingly.
A preliminary test suite for class 'ProjectorGroup' was added.
Currently, only a simplest test is performed testing that
after the input is processed the resulting projectors selected
within a given energy window are corret.
The problem was that when one shell was specified without an explicit
group the created automatic group was lacking the default values for
parameters 'normalize' and 'normion'. The current design, however,
assumes that they must always be set.
A single-file test suite for 'inpconf.py' is split into several files,
each containing a separate TestCase class. In addition, all test cases
are derived from class ArrayTestCase (in turn derived from TestCase)
which contains a numpy-array equality method.