3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-07 14:43:49 +01:00
Commit Graph

343 Commits

Author SHA1 Message Date
Oleg E. Peil
daf40074b2 Added a charge self-consistency script
The charge self-consistency script is run from bin directory.
The corresponding Python script 'sc_dmft.py' has been modified
accordingly.
2016-03-11 18:49:29 +01:00
Oleg E. Peil
ea87d5bf11 Fixed module and library paths
In version 1.4 all python applications moved from the root python
library to `pytriqs/` subdirectory.
2016-03-11 12:14:31 +01:00
Oleg E. Peil
edf5038140 Added a shell script for running PLOVasp converter
The script simply runs pytriqs with an auto-executable module
`plovasp.converter`.
2016-03-11 11:35:19 +01:00
Oleg E. Peil
9401bed308 Merge branch 'vasp' of https://github.com/TRIQS/dft_tools into vasp 2016-03-11 10:09:33 +01:00
Oleg E. Peil
dc7614b0aa Moved the main script to function 'main()' 2016-03-11 10:01:24 +01:00
Oleg E. Peil
f142db96fb Merge branch 'master' into vasp
Conflicts:
	CMakeLists.txt
	python/CMakeLists.txt
	python/converters/__init__.py
	test/CMakeLists.txt
2016-03-11 09:53:24 +01:00
Oleg E. Peil
3ce88a9457 Modified import of ATM to make it optional
Now, if the PLOVasp cannot import `atm.so` it will issue a warning
and only fail when `density_of_states()` routine is invoked.
2016-03-10 16:53:17 +01:00
Oleg E. Peil
b47cc2f4d3 Fixed import of 'converter_tools' in 'vasp_converter' 2016-03-10 12:06:27 +01:00
Oleg E. Peil
30dc760dcb Moved PLOVasp tests to root 'test' directory
Appropriate modifications to CMakeLists have also been made.
2016-03-10 11:45:53 +01:00
Oleg E. Peil
68ba0f3751 Fixed CMakeLists to make 'atm.so' installable 2016-03-09 20:03:02 +01:00
Oleg E. Peil
afb1134cb1 Added wrapper description file for ATM
Wrapper description file 'atm_desc.py' is needed to generate
a Python wrapper over the ATM library. Corresponding CMakeLists.txt
has also been added.
2016-03-09 19:04:05 +01:00
Priyanka Seth
058e8e968f [wannier] few minor tidying changes while reading through 2016-02-23 15:10:22 +01:00
Gabriele Sclauzero
0d3e59a73c [wannier90] First commit with working version
Implements the Wannier90 converter, provides related docs and a test
2016-02-17 12:01:21 +01:00
Oleg E. Peil
45ed1ba0fc Added output of local Hamiltonian
The local Hamiltonian is now output after the density matrix.
This is mainly needed for debug purposes. At a later stage the
output should be better formatted and controlled.
2016-02-09 13:48:39 +01:00
Oleg E. Peil
3176780d37 Added evaluation of local Hamiltonian
Added a method for evaluating the local Hamiltonian corresponding
to a given projected shell.
2016-02-09 13:40:45 +01:00
Priyanka Seth
3e4b74225c Able to get dft_tools hash now 2016-02-07 10:43:23 +01:00
Olivier Parcollet
69bbe87234 Fix #43 2016-02-05 15:25:10 +01:00
Olivier Parcollet
1434193a38 [cmake] Fix broken tests after change in TRIQS install macros
- After the change in main lib, need to put explicitely the
  sitecustomize file
2016-02-04 08:28:47 +01:00
Oleg E. Peil
bda2e5e2a3 Added copyright disclaimers to PLOVasp sources 2016-02-01 14:06:41 +01:00
Oleg E. Peil
eece11b297 Added self-consistency scripts
At the main SC script 'sc_dmft.py' requires importing a user DMFT
script as a module. Ideally, this should be implemented in a different
way so that the user script imports a function from the self-consistent
script.
2016-02-01 13:44:08 +01:00
Oleg E. Peil
a0645b8275 Fixed the wrong name of the config file 2016-01-22 15:59:12 +01:00
Oleg E. Peil
2e1633c037 Added an example of Ce HF calculation 2015-12-18 17:51:26 +01:00
Oleg E. Peil
e8dff08fcf Added a possibility to read EFERMI from LOCPROJ
Noramlly, the Fermi energy is read from DOSCAR. However, this does
not work in case of a self-consistent calculation in which DOSCAR
is not written between iterations. One of the options is
to modify slightly the output to LOCPROJ and add EFERMI to the
first line.
2015-12-18 17:45:12 +01:00
Oleg E. Peil
3478db8a90 Modified main routine to make it importable
It is now possible to import a function
'generate_and_output_as_text()' from another Python script
to process VASP data.
2015-12-16 16:02:12 +01:00
Priyanka Seth
90dafa478a Adapt to complex g(tau)
* Fix sumk to work with pos and neg imfreqs mesh
* Checked that GF.data is only used and modified for GfReFreq quantities
2015-12-12 14:30:06 +01:00
Oleg E. Peil
fe88b37515 Fixed a bug in determining dimensions in converter
Since 'n_orbitals' can be a 2D array in case of spin-polarized
calculations, one should use 'numpy.max' instead of 'max' to
extract the maximum number of bands.
2015-12-11 10:57:48 +01:00
Oleg E. Peil
41b3b63744 Modified input of eigenvalues and Fermi weights
In the new version of VASP LOCPROJ contains the eigenvalues and
Fermi weights. Also, during a charge self-consistency calculation
the file EIGENVAL is not written at intermediate iterations. It is,
thus, preferential to use LOCPROJ to get the named data.
At the moment, EIGENVAL will still be used if it is complete but
in the future this dependence should be removed completely.
2015-12-11 10:54:51 +01:00
Oleg E. Peil
3e63c0f0f5 Improved output of the density matrix 2015-12-09 11:55:29 +01:00
Oleg E. Peil
b02d13ebd8 Fixed the output of band indices to vasp.pgX
The band indices should be converted to Fortran convention,
i.e. starting from 1, in the output files because the are
used in the density matrix file which is read by a Fortran code.
2015-12-04 19:55:37 +01:00
Oleg E. Peil
85a83db1cb Added writing of 'band_window' to 'dft_misc_input'
In VASP implementation of charge self-consistency we need
band indices to construct the density matrix correction.
2015-12-04 15:29:19 +01:00
Oleg E. Peil
34bc2b6225 Modified LOCPROJ parser to conform to new format
The format of LOCPROJ has been modified again (in VASP 5.4.2
build from Dec 02, 2015).
Now, there is an additional line before each projector block
providing the spin, k-, and band indices, as well as
eigenvalues and Fermi weights.
2015-12-04 12:08:33 +01:00
Oleg E. Peil
1bfacd3883 Fixed the input of f-state projectors from LOCPROJ 2015-12-03 14:19:08 +01:00
Priyanka Seth
cbcb4c929f Switch to a new CMake macro triqs_prepare_local_pytriqs() 2015-12-02 17:00:08 +01:00
Oleg E. Peil
3e19c3d7bb Added storing of Fermi weights to 'dft_misc_input' 2015-12-02 12:23:23 +01:00
Oleg E. Peil
e35c6fd5c0 Fixed some files in examples
Scripts 'run_plovasp.sh' have been replaced by a template in which
the path must be set by the user.
Also, .gitignore has been added to example 'lunio3'.
2015-12-01 13:24:58 +01:00
Oleg E. Peil
22da0dae4a Added example on SrVO3 2015-12-01 13:19:24 +01:00
Oleg E. Peil
921bba0c1a Added a spin factor to density matrix in 'elstruct.py' 2015-12-01 11:18:44 +01:00
Oleg E. Peil
3620784798 Replaced R- and C-TRANSFORM with TRANSFORM option
Also, some tests were modified accordingly.
2015-11-30 20:24:34 +01:00
Oleg E. Peil
f0fae2b10a Fixed tests to pass with new LOCPROJ 2015-11-30 20:18:17 +01:00
Oleg E. Peil
3ccb047329 Fixed example 'simple' and corresponding tests
The calculation of the example was redone to generate LOCPROJ
in a new format (valid starting from VASP 5.4.2).
2015-11-30 19:52:38 +01:00
pdelange
b3e62640da [PATCH] fixed a missing mpi.reduce_all in spaghetti function from sumk_dft_tools 2015-11-30 17:19:36 +01:00
Priyanka Seth
cff294e1b2 Added shell info to filename for spaghetti. 2015-11-30 17:19:04 +01:00
Oleg E. Peil
1fd2a1af6a Added a parser for the new LOCPROJ (VASP >= 5.4.2) 2015-11-27 15:38:51 +01:00
Oleg E. Peil
46b3dd0667 Renamed module 'c/vasp' to 'c/plovasp' 2015-11-27 10:52:07 +01:00
Oleg E. Peil
0d65f38a61 Moved PLOVasp files to converters/plovasp 2015-11-27 10:48:15 +01:00
Oleg E. Peil
7db721c8d1 Optimized slightly orthogonalization routine
At one step of the orthogonaliztion procedure two matrix multiplications
have been replaced with one matrix multiplication and a element-wise
multiplication of a vector and a matrix.
2015-11-21 14:23:30 +01:00
Oleg E. Peil
b2b25a9fd0 Fixed tests that because of the new default NORMION value 2015-11-20 18:59:46 +01:00
Oleg E. Peil
183c115870 Added docstrings to modules 2015-11-20 18:54:51 +01:00
Oleg E. Peil
0d53712761 Changed the default behavior of NORMION option
Now, NORMION is True by default, in accordance with the documentation.
2015-11-20 18:10:14 +01:00
Oleg E. Peil
9258054057 Added an example on LuNiO3
The example allows one to get an idea of how to define projectors
in case of a complex system with several atoms per unit cell.
2015-11-20 18:08:14 +01:00
Oleg E. Peil
770e9f5afc Added transformation of projectors
Now the matrices read from the input files are actually applied
to projectors.
Also, improved the debug output in 'plotools.py'.
2015-11-20 16:58:36 +01:00
Oleg E. Peil
63de4f68a8 Added input of Fermi weights, cleaned-up the code 2015-11-19 16:32:50 +01:00
Oleg E. Peil
f544825684 Added output of Fermi weights to output files
Fermi weights are output next to eigenvalues. They will be needed
for the calculation of the KS density matrix in the charge
self-consistency implementation.
2015-11-19 16:06:25 +01:00
Oleg E. Peil
b85b62d693 Removed a redundant dependency of ProjectorGroup on 'ferw' 2015-11-19 16:01:05 +01:00
Oleg E. Peil
5585e81f7d Added two tests for 'get_block_matrix_map()'
Two tests have been added for testing the basic functionality with
NORMION being either False or True.
2015-11-19 15:56:30 +01:00
Oleg E. Peil
81825fcdf2 Fixed some errors introduced in the previous commit 2015-11-19 14:56:34 +01:00
Oleg E. Peil
72d030c5c5 Restructured 'orthogonalization()'
The part responsible for generating a mapping between the shell/ions
and block projector matrices has now been relocated to a separate
method 'get_block_matrix_map()'. This simplifies the source code
and makes testing easier.
2015-11-19 14:48:45 +01:00
Oleg E. Peil
c426946803 Added implementation for NORMION = True
The mapping for NORMION = True has been implemented.
Also, the orthogonalization loop has been fixed. First of all,
orthogonalization should be done separately for each block map 'bl_map'.
Second, one has to take into account that the orbital dimensions of the
block matrix can vary from block to block. To make that the overlap
matrix is non-singular one, thus, has to pass to
'orthogonalize_projector_matrix()' only a view of a submatrix of 'pmat'
corresponding to the current block.

Two tests to check the simplest cases have been added.
2015-11-19 12:11:55 +01:00
Oleg E. Peil
b3e1dd915a Refactored mapping onto block matrix in 'orthogonalize()'
The implementation of the mapping of a set of projectors (belonging
to different shells and ions) onto a block matrix in the
orthogonalization routine has been generalized. Now, an implementation
of the choice between the full orthogoanlization and per-site one
is straightforward: it is just a matter of defining a proper mapping.
The mapping scheme itself is described in the doc-string of method
'ProjectorGroup.orthogonalize()'
2015-11-19 11:47:59 +01:00
Oleg E. Peil
79f4c33458 Removed files accidentally added in the previous commit 2015-11-18 19:05:48 +01:00
Oleg E. Peil
61cb087561 Added a test to '_proj_group' test suite
Added a test comparing two-site density and overlap matrices.
2015-11-18 19:02:21 +01:00
Oleg E. Peil
4af8406b4c Fixed tests for ProjectorGroup
The tests have been modified to conform to the recent input and code
changes.
2015-11-18 15:46:58 +01:00
Oleg E. Peil
c1b3000c00 Fixed a bug in the orthogonalization routine
There was a very nasty bug in the preparation of the block matrix
'p_mat'. The point is that this matrix is created once for all k-points
with the band dimension being the maximum possible. However, only
a part of the matrix is used at every k-point but the orthogonalization
is done for the whole matrix. The problem was that if the number of
bands for a given k-point was smaller than that for the next k-point
them for the next k-point some part of 'p_mat' still contained data from
the previous step, which messed up the orthonormalization. Now, 'p_mat'
is set to zero at each step of the loop.
Also, property 'nion' was added to ProjectorShell since it is used
very often.
2015-11-18 15:17:51 +01:00
Oleg E. Peil
f994b82704 Rearranged and fixed some tests
First of all, suite '_plotools' is now split into three separate suites
'_plotools', '_proj_shell', '_proj_group', following the changes made
into the structure of the code.
Second, the two tests in 'test_projshells.py' have been fixed to conform
to the recent modifications in the code and input files.
2015-11-18 12:38:04 +01:00
Oleg E. Peil
401d416d4d Fixed 'plotools.py' and restructured 'proj_group.py'
Added missing import of ProjectorGroup and ProjectorShell to
'plotools.py'.
Moved separate routines 'orthogonalize_projector_matrix()'
and 'select_bands()' into class ProjectorGroup because these
routines are anyway not used elsewhere outside this class.
2015-11-13 19:09:25 +01:00
Oleg E. Peil
61395b12fa Restructured the source files
The classes ProjectorShell and ProjectorGroup are now defined in
different source files. This makes 'plotools.py' only contain
routines that control the data flows, including consistency checks
and output.
2015-11-13 18:15:21 +01:00
Oleg E. Peil
b285f37eca Added some new tests
New tests for the recently implemented parsers (for DOSMESH, EWINDOW,
and TRANSFILE) have been added.
2015-11-13 14:38:20 +01:00
Oleg E. Peil
8a718ea906 Fixed 'inpconf' tests after the recent changes
Some of the options of the config-file has been modified.
The tests have been adapted accordingly.
2015-11-13 13:54:26 +01:00
Oleg E. Peil
a61e0b2526 Fixed a problem with missing nc_flag property
The ProjectorShell class must inheret 'nc_flag' from somewhere.
This is now done by passing it to the class constructor in
'generate_plo()'.
2015-11-11 20:30:49 +01:00
Oleg E. Peil
453c8531c9 Replaced options EMIN, EMAX with EWINDOW
It did not make much sense to keep two independent options to
define an energy range. Now the energy window is directly defined
by two floats.
2015-11-11 18:58:38 +01:00
Oleg E. Peil
5ec3e881cd Added transformation matrices to ProjectorShell
Matrices parsed by the config-parser are interpreted as transformation
matrices for each ion in the shell. If only one matrix is defined
(by TRANSFORM) it is copied for every ion.
Whether a matrix is real or complex is derived from its dimensions
consistently with other parameters of the shell (such as 'nm = 2*l + 1').
Transformation matrices are stored as complex in any case.
2015-11-11 12:43:51 +01:00
Oleg E. Peil
cefaf9dda4 Added TRANSFILE option to the config-parser
TRANSFILE option provides a filename containing transformation
matrices for all ions of a projected shell.
The parser simply reads the numbers into a 2d-array which is left
for interpretation at a later stage.
2015-11-11 11:36:09 +01:00
Oleg E. Peil
7e13c1cb5b Fixed inequivalent shell determination
It was incorrect to ascribe VASP atomic sort to corr_shell['sort'],
the latter having a different meaning. According to the terminology of
Wien2k a sort determines an equivalence class of atoms.
Since the implementation at the moment does not support symmetries
the atom index is now used as a 'sort' index to make sure that all shells
remain inequivalent.
2015-11-10 19:16:41 +01:00
Oleg E. Peil
0eb574b5c8 Added DOSMESH option to section [General]
If option DOSMESH is specified a projected DOS for each shell
will be output. Energy mesh parameters are given in DOSMESH as

DOSMESH = [EMIN  EMAX]  N_POINTS

The parameters in the brackets [] are optional. If only the number
of points is specified the energy range is taken to be the same
as the projection energy window.
2015-11-10 16:40:46 +01:00
Oleg E. Peil
bf34d968cc Added orbital labels to 'proj_params'
When PROJCAR is read it assigns the orbitals by their corresponding
labels. These labels are now added to the dictionary 'proj_params'.
Although they are not used currently they can be handy when it comes
to identifying the character of the orbitals.
Also, the order of orbital labels for p- and d-orbitals was changed
to conform to the convention of the old PROCAR file.
2015-11-10 15:32:15 +01:00
Oleg E. Peil
63eb4c2089 Fixed a bug in 'density_of_states()'
Fixed the wrong index order in 'w_k' inside the loop evaluating
DOS.
2015-11-10 14:09:40 +01:00
Oleg E. Peil
d3dd546cee Fixed a bug in 'shell.density_matrix()' and added some output
The first two indices in 'proj_win[...]' were incorrect in
the density matrix routine.
Added output on the processed shells.
2015-11-10 12:24:14 +01:00
Oleg E. Peil
fa420924af Fixed a bug in 'debug_density_matrix()'
The on-site blocks of the large (for all orbitals) desnity matrix
were incorrectly copied for the output.
2015-11-10 12:07:13 +01:00
Priyanka Seth
f93fd828c0 Added a wrapper function set_Sigma for more standard API 2015-11-02 11:43:53 +01:00
Oleg E. Peil
cb745fff9f Commented out debug prints in 'vasp_converter.py' 2015-10-22 20:13:58 +02:00
Oleg E. Peil
2b71180e8e Added calculation of DOS to plotools.py
Added a function that allows one to get the non-interacting projected DOS for
newly generated projectors. The DOS is calculated with analytical tetrahedron
integration added previously.
At the moment, the DOS is generated and output for debugging purposes
after the projectors are generated. Eventually, there should be an
option in the input config file requesting the output of DOS for a given
energy mesh.
2015-10-22 16:15:49 +02:00
Oleg E. Peil
9c7e63ebae Reshuffled some files, added .gitignore 2015-10-21 11:54:22 +02:00
Oleg E. Peil
99713edbc4 Fixed band selection indices for projectors
There was an inconsistency in the convention on the position of the
subarray corresponding to projectors within the selected window.
In some cases the subarray was defined from 0 to ib_max, in other cases
it was from 'ib1 - ib_min' to 'ib2 - ib_min'.
Now the global convention is that the projectors for a given window
are stored in a slice '0:ib_max', where 'ib_max = ib2 - ib1 + 1'.
2015-10-20 17:37:17 +02:00
Oleg E. Peil
8a71cbe6b0 Fixed bugs related to indices ib_min, ib_max
There was a mess with indices 'ib_min', 'ib_max' indicating the
selected window. First of all their old names 'nb_min', 'nb_max' were
confusing and because of that they were sometimes incorrectly used as
the maximum size of the window and sometimes as a maximum band index.
Now the convention is more clear: 'ib_min', 'ib_max' correspond to the
minimum/maximum band indices (in terms of original VASP indices) and
'nb_max == ib_max - ib_min + 1' is the maximum number of bands within
the window.
2015-10-20 12:36:57 +02:00
Oleg E. Peil
5f9b884944 Fixed output of eigenvalues of *.pgX file
The eigenvalues output to a *.pgX file were the raw eigenvalues
from VASP. Now the Fermi level is subtracted as it is expected in
the converter.
2015-10-20 12:02:46 +02:00
Oleg E. Peil
67b78c1499 Added some debug output to plotools.py
Added output of density and overlap matrices to plotools.py.
If one defines a very large window (spanning all bands) one can
compare this output with the one produced by 'debug_density_matrix()'
in class ElectronicStructure.
For a small window, the overlap gives an idea of symmetry-related
degeneracies and of how strong the states are going to be renormalized
by the orthogonalization routine.
2015-10-16 18:10:48 +02:00
Oleg E. Peil
54b9857aa5 Added density and overlap matrix output ot ElStruct
The new method in ElectronicStructure allows one to output
denisty and overlap matrices originating from the raw projectors
read from PROJCAR (LOCPROJ). This output is mainly intended for debug purposes.
2015-10-16 16:27:49 +02:00
Oleg E. Peil
82694a4c51 Merge branch 'vasp' of ssh://github.com/TRIQS/dft_tools into vasp 2015-10-16 15:56:49 +02:00
Oleg E. Peil
87b00f61b1 Added a format check for EIGENVAL to vaspio.py
Added a check to 'vaspio.py' testing that the number of columns
implies that the Fermi weights are present in EIGENVAL. This check ensures
that the new format (starting from VASP 5.4) of the file is used.

Corresponding test is added to the suite.
2015-10-16 11:59:02 +02:00
Oleg E. Peil
dda331b986 Fixed 'vaspio' tests
Added 'rpath.py' module to determine the current directory.

Also fixed the test example for EIGENVAL: VASP 5.4 uses a format
with Fermi weights output (unlike previous versions).
2015-10-16 11:52:33 +02:00
Oleg E. Peil
3aba5f4135 Added a doc-string to rpath.py 2015-10-16 11:22:38 +02:00
Oleg E. Peil
c8badb39ff Fixed 'inpconf' tests
Originally, the tests worked only when run from their respective
directory. If one tries to run them from another directory (which happens
when test discovery is used) the tests were not able to find the input files.
Now, a dummy module 'rpath' is added to all tests whose sole role is
to obtain the current path.
2015-10-16 11:16:48 +02:00
Oleg E. Peil
be21838e30 Modified ProjectedShell to conform to new projectors
The new projector input requires a different approach of selecting
the projectors for each shell. Specifically, for each site/orbital
index defined for a given shell one has to look for the corresponding
input projector (from PROJCAR).

Also, small fixes were required to make 'ferw' array index order
consistent with what is expected in ProjectorShell. This order might
eventually be modified.
2015-10-15 13:26:48 +02:00
Oleg E. Peil
fb3bc8eeff Added consistency check for the number of sites
'check_data_consistency' now first checks that site indices in
projected shells do not exceed the number of ions in the structure.
2015-10-15 11:44:50 +02:00
Oleg E. Peil
f96e4dfe9e Added consistency check of projector characters
Since in the new implementation the projectors produced by VASP
are output only for selected functions it is necessary to check
that input cfg-file specifies only those projectors that were selected
in the INCAR file. The consistency routine checks for every shell
and site/orbital character that a corresponding projector is present
in PROJCAR.
2015-10-14 19:32:12 +02:00
Oleg E. Peil
89b7a95a8b Renamed 'params' to 'proj_params' in class Plocar 2015-10-14 17:44:01 +02:00
Oleg E. Peil
f457f5cc7a Modified ElectronicStructure for new projectors
Some necessary modifications to class ElectronicStructure in order
to conform the modified projector input. In particular, the dimensions
of the projector array are now taken directly from the array,
and the old dictionary 'params' is replaced with a list 'proj_params'
containing information on the character of projectors.
2015-10-14 17:36:39 +02:00
Oleg E. Peil
4cc989fbea Fixed class ElectronicStructure
Small fixes to accord with the changes of Vaspio:
* 'nspin' is now taken from Eigenval.ispin
* 'nc_flag' is now determined from the value of 'ncdij' read from DOSCAR
* 'ferw' is now taken from Eigenval
2015-10-14 16:22:10 +02:00
Oleg E. Peil
65fc129cd1 Fixed parsing of EIGENVAL to accord with the new format
In recent version of VASP the output in EIGENVAL includes also
Fermi weights. The parser in class 'Eigenval' has been modified
accordingly.
2015-10-14 16:15:14 +02:00
Oleg E. Peil
66fac2f1bd Added preliminary PROJCAR parser to vaspio
This python-parser is a prototype of a future parser that will probably
be using only LOCPROJ (which is going to be modified).
At the moment, one has to use the first line of LOCPROJ to determine
the array dimensions and parse PROJCAR because it contains relevant information
on projectors (such as site and orbital character).

Note that in the previous implementation relying on the binary PLOCAR-file
the Fermi weights were taken from PLOCAR. In the current version of VASP
(>=5.4.1) the Fermi weights can read in from EIGENVAL.
2015-10-14 15:58:45 +02:00