mirror of
https://github.com/triqs/dft_tools
synced 2025-01-02 09:35:47 +01:00
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.
This commit is contained in:
parent
a16bafefb6
commit
cefaf9dda4
@ -57,7 +57,8 @@ class ConfigParameters:
|
|||||||
|
|
||||||
self.sh_optional = {
|
self.sh_optional = {
|
||||||
'rtransform': ('tmatrix', lambda s: self.parse_string_tmatrix(s, real=True)),
|
'rtransform': ('tmatrix', lambda s: self.parse_string_tmatrix(s, real=True)),
|
||||||
'ctransform': ('tmatrix', lambda s: self.parse_string_tmatrix(s, real=False))}
|
'ctransform': ('tmatrix', lambda s: self.parse_string_tmatrix(s, real=False)),
|
||||||
|
'transfile': ('tmatrices', self.parse_file_tmatrix)}
|
||||||
|
|
||||||
self.gr_required = {
|
self.gr_required = {
|
||||||
'shells': ('shells', lambda s: map(int, s.split())),
|
'shells': ('shells', lambda s: map(int, s.split())),
|
||||||
@ -167,6 +168,21 @@ class ConfigParameters:
|
|||||||
|
|
||||||
return mat
|
return mat
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# parse_file_tmatrix()
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
def parse_file_tmatrix(self, filename):
|
||||||
|
"""
|
||||||
|
Parses a file 'filename' containing transformation matrices
|
||||||
|
for each ion. The parser returns a raw matrix that will be
|
||||||
|
interpreted elsewhere because the interpretation depends on
|
||||||
|
shell parameters.
|
||||||
|
"""
|
||||||
|
tmatrices = np.loadtxt(filename)
|
||||||
|
return tmatrices
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# parse_string_ion_list()
|
# parse_string_ion_list()
|
||||||
@ -176,10 +192,10 @@ class ConfigParameters:
|
|||||||
"""
|
"""
|
||||||
Two formats are accepted:
|
Two formats are accepted:
|
||||||
|
|
||||||
# Two floats (energy range) and an integer (number of energy points).
|
1. Two floats (energy range) and an integer (number of energy points).
|
||||||
|
|
||||||
# One integer (number of energy points). In this case the energy
|
2. One integer (number of energy points). In this case the energy
|
||||||
range is taken to be equal to EMIN, EMAX of a shell.
|
range is taken to be equal to EMIN, EMAX of a shell.
|
||||||
|
|
||||||
The parser returns a dictionary:
|
The parser returns a dictionary:
|
||||||
{'n_points': int,
|
{'n_points': int,
|
||||||
|
Loading…
Reference in New Issue
Block a user