3
0
mirror of https://github.com/triqs/dft_tools synced 2024-07-11 05:43:48 +02:00

renamed converters from app_converter.py to app.py

* adapted all occurences of the converter script file names including
  the doc files
* fixed one failing test: Py_basis_transformation.py
This commit is contained in:
Alexander Hampel 2020-06-23 11:13:00 +02:00
parent f27399758e
commit a1209f8a53
26 changed files with 42 additions and 42 deletions

View File

@ -1,4 +1,4 @@
from triqs_dft_tools.converters.wien2k_converter import Wien2kConverter from triqs_dft_tools.converters.wien2k import Wien2kConverter
from triqs_dft_tools import SumkDFTTools from triqs_dft_tools import SumkDFTTools
filename = 'Sr2RuO4' filename = 'Sr2RuO4'

View File

@ -128,7 +128,7 @@ Momentum resolved spectral function (with real-frequency self energy)
Another quantity of interest is the momentum-resolved spectral function, which can directly be compared to ARPES Another quantity of interest is the momentum-resolved spectral function, which can directly be compared to ARPES
experiments. First we have to execute `lapw1`, `lapw2 -almd` and :program:`dmftproj` with the `-band` experiments. First we have to execute `lapw1`, `lapw2 -almd` and :program:`dmftproj` with the `-band`
option and use the :meth:`convert_bands_input <dft.converters.wien2k_converter.Wien2kConverter.convert_bands_input>` option and use the :meth:`convert_bands_input <dft.converters.wien2k.Wien2kConverter.convert_bands_input>`
routine, which converts the required files (for a more detailed description see :ref:`conversion`). The spectral function is then calculated by typing:: routine, which converts the required files (for a more detailed description see :ref:`conversion`). The spectral function is then calculated by typing::
SK.spaghettis(broadening=0.01,plot_shift=0.0,plot_range=None,ishell=None,save_to_file='Akw_') SK.spaghettis(broadening=0.01,plot_shift=0.0,plot_range=None,ishell=None,save_to_file='Akw_')

View File

@ -87,7 +87,7 @@ matrix of the imaginary part, and then move on to the next :math:`\mathbf{k}`-po
The converter itself is used as:: The converter itself is used as::
from triqs_dft_tools.converters.hk_converter import * from triqs_dft_tools.converters.hk import *
Converter = HkConverter(filename = hkinputfile) Converter = HkConverter(filename = hkinputfile)
Converter.convert_dft_input() Converter.convert_dft_input()

View File

@ -183,7 +183,7 @@ Running the VASP converter
The actual conversion to a h5-file is performed with the orthonormalized projector functions readable by the :ref:`VaspConverter<refVASPconverter>` in the same fashion as with the other `DFTTools` converters:: The actual conversion to a h5-file is performed with the orthonormalized projector functions readable by the :ref:`VaspConverter<refVASPconverter>` in the same fashion as with the other `DFTTools` converters::
from triqs_dft_tools.converters.vasp_converter import * from triqs_dft_tools.converters.vasp import *
Converter = VaspConverter(filename = 'vasp') Converter = VaspConverter(filename = 'vasp')
Converter.convert_dft_input() Converter.convert_dft_input()

View File

@ -94,9 +94,9 @@ directory name):
Now we convert these files into an hdf5 file that can be used for the Now we convert these files into an hdf5 file that can be used for the
DMFT calculations. For this purpose we DMFT calculations. For this purpose we
use the python module :class:`Wien2kConverter <dft.converters.wien2k_converter.Wien2kConverter>`. It is initialized as:: use the python module :class:`Wien2kConverter <dft.converters.wien2k.Wien2kConverter>`. It is initialized as::
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
Converter = Wien2kConverter(filename = case) Converter = Wien2kConverter(filename = case)
The only necessary parameter to this construction is the parameter `filename`. The only necessary parameter to this construction is the parameter `filename`.

View File

@ -52,13 +52,13 @@ real-frequency self energy.
it is crucial to perform the analytic continuation in such a way that the real-frequency self energy it is crucial to perform the analytic continuation in such a way that the real-frequency self energy
is accurate around the Fermi energy as low-energy features strongly influence the final results. is accurate around the Fermi energy as low-energy features strongly influence the final results.
Besides the self energy the Wien2k files read by the transport converter (:meth:`convert_transport_input <dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`) are: Besides the self energy the Wien2k files read by the transport converter (:meth:`convert_transport_input <dft.converters.wien2k.Wien2kConverter.convert_transport_input>`) are:
* :file:`.struct`: The lattice constants specified in the struct file are used to calculate the unit cell volume. * :file:`.struct`: The lattice constants specified in the struct file are used to calculate the unit cell volume.
* :file:`.outputs`: In this file the k-point symmetries are given. * :file:`.outputs`: In this file the k-point symmetries are given.
* :file:`.oubwin`: Contains the indices of the bands within the projected subspace (written by :program:`dmftproj`) for each k-point. * :file:`.oubwin`: Contains the indices of the bands within the projected subspace (written by :program:`dmftproj`) for each k-point.
* :file:`.pmat`: This file is the output of the Wien2k optics package and contains the velocity (momentum) matrix elements between all bands in the desired energy * :file:`.pmat`: This file is the output of the Wien2k optics package and contains the velocity (momentum) matrix elements between all bands in the desired energy
window for each k-point. How to use the optics package is described below. window for each k-point. How to use the optics package is described below.
* :file:`.h5`: The hdf5 archive has to be present and should contain the dft_input subgroup. Otherwise :meth:`convert_dft_input <dft.converters.wien2k_converter.Wien2kConverter.convert_dft_input>` needs to be called before :meth:`convert_transport_input <dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`. * :file:`.h5`: The hdf5 archive has to be present and should contain the dft_input subgroup. Otherwise :meth:`convert_dft_input <dft.converters.wien2k.Wien2kConverter.convert_dft_input>` needs to be called before :meth:`convert_transport_input <dft.converters.wien2k.Wien2kConverter.convert_transport_input>`.
Wien2k optics package Wien2k optics package
@ -84,7 +84,7 @@ Using the transport code
First we have to read the Wien2k files and store the relevant information in the hdf5 archive:: First we have to read the Wien2k files and store the relevant information in the hdf5 archive::
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
from triqs_dft_tools.sumk_dft_tools import * from triqs_dft_tools.sumk_dft_tools import *
Converter = Wien2kConverter(filename='case', repacking=True) Converter = Wien2kConverter(filename='case', repacking=True)
@ -92,7 +92,7 @@ First we have to read the Wien2k files and store the relevant information in the
SK = SumkDFTTools(hdf_file='case.h5', use_dft_blocks=True) SK = SumkDFTTools(hdf_file='case.h5', use_dft_blocks=True)
The converter :meth:`convert_transport_input <dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>` The converter :meth:`convert_transport_input <dft.converters.wien2k.Wien2kConverter.convert_transport_input>`
reads the required data of the Wien2k output and stores it in the `dft_transp_input` subgroup of your hdf file. reads the required data of the Wien2k output and stores it in the `dft_transp_input` subgroup of your hdf file.
Additionally we need to read and set the self energy, the chemical potential and the double counting:: Additionally we need to read and set the self energy, the chemical potential and the double counting::

View File

@ -5,20 +5,20 @@ Converters
Wien2k Converter Wien2k Converter
---------------- ----------------
.. autoclass:: triqs_dft_tools.converters.wien2k_converter.Wien2kConverter .. autoclass:: triqs_dft_tools.converters.wien2k.Wien2kConverter
:members: :members:
:special-members: :special-members:
:show-inheritance: :show-inheritance:
H(k) Converter H(k) Converter
-------------- --------------
.. autoclass:: triqs_dft_tools.converters.hk_converter.HkConverter .. autoclass:: triqs_dft_tools.converters.hk.HkConverter
:members: :members:
:special-members: :special-members:
Wannier90 Converter Wannier90 Converter
------------------- -------------------
.. autoclass:: triqs_dft_tools.converters.wannier90_converter.Wannier90Converter .. autoclass:: triqs_dft_tools.converters.wannier90.Wannier90Converter
:members: :members:
:special-members: :special-members:
@ -53,7 +53,7 @@ PLOVASP reference, the classes / functions are sorted the way the converter uses
VASP Converter VASP Converter
------------------- -------------------
.. _refVASPconverter: .. _refVASPconverter:
.. autoclass:: triqs_dft_tools.converters.vasp_converter.VaspConverter .. autoclass:: triqs_dft_tools.converters.vasp.VaspConverter
:members: :members:
:special-members: :special-members:

View File

@ -1,5 +1,5 @@
from triqs_dft_tools.sumk_dft import * from triqs_dft_tools.sumk_dft import *
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
from triqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver from triqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver
import os import os

View File

@ -1,5 +1,5 @@
from triqs_dft_tools.sumk_dft_tools import * from triqs_dft_tools.sumk_dft_tools import *
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
from triqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver from triqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver
# Creates the data directory, cd into it: # Creates the data directory, cd into it:

View File

@ -8,7 +8,7 @@ from triqs_cthyb import *
import triqs.utility.mpi as mpi import triqs.utility.mpi as mpi
# Convert the input # Convert the input
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
Converter = Wien2kConverter(filename = "Sr2MgOsO6_noSOC") Converter = Wien2kConverter(filename = "Sr2MgOsO6_noSOC")
Converter.convert_dft_input() Converter.convert_dft_input()

View File

@ -1,3 +1,3 @@
from triqs_dft_tools.converters.vasp_converter import * from triqs_dft_tools.converters.vasp import *
Converter = VaspConverter(filename = 'nio') Converter = VaspConverter(filename = 'nio')
Converter.convert_dft_input() Converter.convert_dft_input()

View File

@ -4,7 +4,7 @@ from h5 import HDFArchive
from triqs_cthyb import * from triqs_cthyb import *
from triqs.gf import * from triqs.gf import *
from triqs_dft_tools.sumk_dft import * from triqs_dft_tools.sumk_dft import *
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
dft_filename='SrVO3' dft_filename='SrVO3'
beta = 40 beta = 40
@ -49,7 +49,7 @@ p["fit_min_n"] = 30
p["fit_max_n"] = 60 p["fit_max_n"] = 60
# If conversion step was not done, we could do it here. Uncomment the lines it you want to do this. # If conversion step was not done, we could do it here. Uncomment the lines it you want to do this.
#from triqs_dft_tools.converters.wien2k_converter import * #from triqs_dft_tools.converters.wien2k import *
#Converter = Wien2kConverter(filename=dft_filename, repacking=True) #Converter = Wien2kConverter(filename=dft_filename, repacking=True)
#Converter.convert_dft_input() #Converter.convert_dft_input()
#mpi.barrier() #mpi.barrier()

View File

@ -11,7 +11,7 @@ from triqs.operators.util.U_matrix import *
from triqs_cthyb import * from triqs_cthyb import *
import triqs_cthyb.version as cthyb_version import triqs_cthyb.version as cthyb_version
import triqs_dft_tools.version as dft_tools_version import triqs_dft_tools.version as dft_tools_version
from triqs_dft_tools.converters.vasp_converter import * from triqs_dft_tools.converters.vasp import *
import warnings import warnings

View File

@ -57,9 +57,9 @@ At the end of the run you see the density matrix in Wannier space:
As you can see, there are off-diagonal elements between the :math:`d_{x^2-y^2}` and the :math:`d_{xy}` orbital. As you can see, there are off-diagonal elements between the :math:`d_{x^2-y^2}` and the :math:`d_{xy}` orbital.
We convert the output to the hdf5 archive, using We convert the output to the hdf5 archive, using
the python module :class:`Wien2kConverter <dft.converters.wien2k_converter.Wien2kConverter>`. A simple python script doing this is:: the python module :class:`Wien2kConverter <dft.converters.wien2k.Wien2kConverter>`. A simple python script doing this is::
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
Converter = Wien2kConverter(filename = "Sr2MgOsO6_noSOC") Converter = Wien2kConverter(filename = "Sr2MgOsO6_noSOC")
Converter.convert_dft_input() Converter.convert_dft_input()

View File

@ -58,9 +58,9 @@ At the end of the run you see the density matrix in Wannier space:
As you can see, there are a lot of off-diagonal elements now, in particular also off-diagonal in spin space. This is just telling us that spin is not a good quantum number any more in the presence of SOC. As you can see, there are a lot of off-diagonal elements now, in particular also off-diagonal in spin space. This is just telling us that spin is not a good quantum number any more in the presence of SOC.
We convert the output to the hdf5 archive, using We convert the output to the hdf5 archive, using
the python module :class:`Wien2kConverter <dft.converters.wien2k_converter.Wien2kConverter>`. A simple python script doing this is:: the python module :class:`Wien2kConverter <dft.converters.wien2k.Wien2kConverter>`. A simple python script doing this is::
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
Converter = Wien2kConverter(filename = "Sr2MgOsO6_SOC") Converter = Wien2kConverter(filename = "Sr2MgOsO6_SOC")
Converter.convert_dft_input() Converter.convert_dft_input()

View File

@ -51,10 +51,10 @@ Then :program:`dmftproj` is executed in its default mode (i.e. without spin-pola
dmftproj dmftproj
This program produces the necessary files for the conversion to the hdf5 file structure. This is done using This program produces the necessary files for the conversion to the hdf5 file structure. This is done using
the python module :class:`Wien2kConverter <dft.converters.wien2k_converter.Wien2kConverter>`. the python module :class:`Wien2kConverter <dft.converters.wien2k.Wien2kConverter>`.
A simple python script that initialises the converter is:: A simple python script that initialises the converter is::
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
Converter = Wien2kConverter(filename = "SrVO3") Converter = Wien2kConverter(filename = "SrVO3")
After initializing the interface module, we can now convert the input After initializing the interface module, we can now convert the input

View File

@ -247,7 +247,7 @@
], ],
"source": [ "source": [
"# import VASPconverter\n", "# import VASPconverter\n",
"from triqs_dft_tools.converters.vasp_converter import *\n", "from triqs_dft_tools.converters.vasp import *\n",
"\n", "\n",
"\n", "\n",
"# create Converter\n", "# create Converter\n",

View File

@ -20,10 +20,10 @@
# #
########################################################################## ##########################################################################
from .wien2k_converter import Wien2kConverter from .wien2k import Wien2kConverter
from .hk_converter import HkConverter from .hk import HkConverter
from .vasp_converter import VaspConverter from .vasp import VaspConverter
from .wannier90_converter import Wannier90Converter from .wannier90 import Wannier90Converter
__all__ =['Wien2kConverter','HkConverter','Wannier90Converter','VaspConverter'] __all__ =['Wien2kConverter','HkConverter','Wannier90Converter','VaspConverter']

View File

@ -251,7 +251,7 @@ class Wien2kConverter(ConverterTools):
for it in things_to_set: for it in things_to_set:
setattr(self, it, locals()[it]) setattr(self, it, locals()[it])
except StopIteration: # a more explicit error if the file is corrupted. except StopIteration: # a more explicit error if the file is corrupted.
raise IOError("Wien2k_converter : reading file %s failed!" % self.dft_file) raise IOError("wien2k : reading file %s failed!" % self.dft_file)
R.close() R.close()
# Reading done! # Reading done!
@ -472,7 +472,7 @@ class Wien2kConverter(ConverterTools):
except KeyError: except KeyError:
raise IOError("convert_bands_input : Needed data not found in hdf file. Consider calling convert_dft_input first!") raise IOError("convert_bands_input : Needed data not found in hdf file. Consider calling convert_dft_input first!")
except StopIteration: # a more explicit error if the file is corrupted. except StopIteration: # a more explicit error if the file is corrupted.
raise IOError("Wien2k_converter : reading file %s failed!" % self.band_file) raise IOError("wien2k : reading file %s failed!" % self.band_file)
# Reading done! # Reading done!
@ -496,7 +496,7 @@ class Wien2kConverter(ConverterTools):
- symmetries from :file:`case.outputs`, - symmetries from :file:`case.outputs`,
if those Wien2k files are present and stores the data in the hdf5 archive. if those Wien2k files are present and stores the data in the hdf5 archive.
This function is automatically called by :meth:`convert_dft_input <triqs_dft_tools.converters.wien2k_converter.Wien2kConverter.convert_dft_input>`. This function is automatically called by :meth:`convert_dft_input <triqs_dft_tools.converters.wien2k.Wien2kConverter.convert_dft_input>`.
""" """
@ -779,7 +779,7 @@ class Wien2kConverter(ConverterTools):
next(R) # imaginary part next(R) # imaginary part
except StopIteration: # a more explicit error if the file is corrupted. except StopIteration: # a more explicit error if the file is corrupted.
raise IOError("Wien2k_converter : reading file %s failed!" %symm_file) raise IOError("wien2k : reading file %s failed!" %symm_file)
R.close() R.close()
# Reading done! # Reading done!

View File

@ -17,7 +17,7 @@ def call_diagonalize(SK):
SK.block_structure.transformation = None SK.block_structure.transformation = None
return t_sumk_eal, t_solver_eal, t_sumk_dm, t_solver_dm return t_sumk_eal, t_solver_eal, t_sumk_dm, t_solver_dm
SK = SumkDFT(hdf_file = 'SrVO3.h5', use_dft_blocks=True) SK = SumkDFT(hdf_file = 'SrVO3.ref.h5', use_dft_blocks=True)
# only eal and dm are allowed # only eal and dm are allowed
SK.block_structure.transformation = None SK.block_structure.transformation = None
@ -71,7 +71,7 @@ for dmi in dm:
# Test convert_operator # Test convert_operator
SK = SumkDFT(hdf_file = 'SrVO3.h5', use_dft_blocks=True) SK = SumkDFT(hdf_file = 'SrVO3.ref.h5', use_dft_blocks=True)
BS = SK.block_structure BS = SK.block_structure
from triqs.operators.util import h_int_slater, U_matrix, t2g_submatrix, transform_U_matrix from triqs.operators.util import h_int_slater, U_matrix, t2g_submatrix, transform_U_matrix
@ -93,7 +93,7 @@ H3 = BS.convert_operator(h_int_slater(spin_names=['up','down'], orb_names=[0,1,2
for op in H3: for op in H3:
for c_op in op[0]: for c_op in op[0]:
assert(BS.gf_struct_solver_dict[0][c_op[1][0]][c_op[1][1]] is not None) # This crashes with a key error if the operator structure is not the solver structure assert(BS.gf_struct_solver_dict[0][c_op[1][0]][c_op[1][1]] is not None) # This crashes with a key error if the operator structure is not the solver structure
U_trafod = transform_U_matrix(U3x3, BS.transformation[0]['up'].conjugate()) # The notorious .conjugate() U_trafod = transform_U_matrix(U3x3, BS.transformation[0]['up'].conjugate()) # The notorious .conjugate()
H4 = h_int_slater(spin_names=['up','down'], orb_names=range(3), U_matrix=U_trafod, map_operator_structure=BS.sumk_to_solver[0]) H4 = h_int_slater(spin_names=['up','down'], orb_names=range(3), U_matrix=U_trafod, map_operator_structure=BS.sumk_to_solver[0])
assert( H4 == H3 ) # check that convert_operator does the same as transform_U_matrix assert( H4 == H3 ) # check that convert_operator does the same as transform_U_matrix

View File

@ -22,7 +22,7 @@
from h5 import * from h5 import *
from triqs.gf import * from triqs.gf import *
from triqs_dft_tools.sumk_dft import * from triqs_dft_tools.sumk_dft import *
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
from triqs.operators.util import set_operator_structure from triqs.operators.util import set_operator_structure
from triqs.utility.comparison_tests import * from triqs.utility.comparison_tests import *
from triqs.utility.h5diff import h5diff from triqs.utility.h5diff import h5diff

View File

@ -20,7 +20,7 @@
################################################################################ ################################################################################
from numpy import * from numpy import *
from triqs_dft_tools.converters.wien2k_converter import * from triqs_dft_tools.converters.wien2k import *
from triqs_dft_tools.sumk_dft import * from triqs_dft_tools.sumk_dft import *
from triqs_dft_tools.sumk_dft_tools import * from triqs_dft_tools.sumk_dft_tools import *
from triqs.utility.comparison_tests import * from triqs.utility.comparison_tests import *

View File

@ -2,7 +2,7 @@ import unittest
import numpy as np import numpy as np
import sys import sys
sys.path.insert(1, '../python/converters/') sys.path.insert(1, '../python/converters/')
from triqs_dft_tools.converters.wannier90_converter import Wannier90Converter from triqs_dft_tools.converters.wannier90 import Wannier90Converter
from triqs_dft_tools import SumkDFT from triqs_dft_tools import SumkDFT
class test_w90_conv(unittest.TestCase): class test_w90_conv(unittest.TestCase):