[doc] New documentation

* restructuring
* added user reference
* started working on user guide
* added schematic to structure
This commit is contained in:
Priyanka Seth 2015-03-12 00:01:12 +01:00
parent 3d577c294e
commit 8dc42b08ae
49 changed files with 2224 additions and 490 deletions

View File

@ -1,158 +0,0 @@
.. index:: DFT+DMFT calculation
.. highlight:: python
.. _DFTDMFTmain:
The DFT+DMFT calculation
========================
After having set up the hdf5 archive, we can now do our DFT+DMFT calculation. It consists of
initialisation steps, and the actual DMFT self consistency loop.
.. index:: initialisation of DFT+DMFT
Initialisation of the calculation
---------------------------------
Before doing the calculation, we have to intialize all the objects that we will need. The first thing is the
:class:`SumkDFT` class. It contains all basic routines that are necessary to perform a summation in k-space
to get the local quantities used in DMFT. It is initialized by::
from pytriqs.applications.dft.sumk_dft import *
SK = SumkDFT(hdf_file = filename)
This is the reference for the function:
.. function:: SumkDFT(hdf_file, h_field = 0.0, use_dft_blocks = False, dft_data = 'dft_input', symmcorr_data = 'dft_symmcorr_input', parproj_data = 'dft_parproj_input', symmpar_data = 'dft_symmpar_input', bands_data = 'dft_bands_input', transp_data = 'dft_transp_input', misc_data = 'dft_misc_input')
The parameters needed to initialise SumkDFT as as follows (with any default variables as shown above):
========================= ==================== ===========================================================================
Name Type Meaning
========================= ==================== ===========================================================================
hdf_file String Name of the main hdf5 file containing converted dft information.
h_field Scalar External magnetic field.
use_dft_blocks Boolean Analyse the structure of the density matrix at initialisation,
and identify non-zero matrix elements.
The DMFT calculation is then restricted to these matrix elements,
yielding a more efficient solution of the local interaction problem.
Degeneracies in orbital and spin space are also identified and stored for later use.
dft_data String hdf5 subgroup containing required DFT data.
symmcorr_data String hdf5 subgroup containing correlated shell symmetry data.
parproj_data String hdf5 subgroup containing partial projector data.
symmpar_data String hdf5 subgroup containing non-correlated shell symmetry data.
bands_data String hdf5 subgroup containing DFT band data.
transp_data String hdf5 subgroup containing optics/transport data.
misc_data String hdf5 subgroup containing miscellaneous DFT data.
========================= ==================== ===========================================================================
.. index:: Multiband solver
Setting up the Multi-Band Solver
--------------------------------
The next step is to setup the impurity solver.
For more details here, see the `CTHYB <http://ipht.cea.fr/triqs/1.2/applications/cthyb/>`_ documentation.
.. This is initialised as follows::
..
.. from pytriqs.applications.impurity_solvers.cthyb import *
.. beta = 40.0
.. gf_struct = SK.gf_struct_solver[0]
.. S = Solver(beta=beta, gf_struct=gf_struct)
..
.. The solver method is called later by this statement::
..
.. S.solve(h_loc=h_loc, **p)
..
.. where `p` represents the solve parameters.
..
.. There is a module that helps setting up the multiband CTQMC solver. It is loaded and initialized by::
..
.. from pytriqs.applications.dft.solver_multiband import *
.. S = SolverMultiBand(beta, n_orb, gf_struct = SK.gf_struct_solver[0], map=SK.map[0])
..
.. The necessary parameters are the inverse temperature `beta`, the Coulomb interaction `U_interact`, the Hund's rule coupling `J_hund`,
.. and the number of orbitals `n_orb`. There are again several optional parameters that allow the tailoring of the local Hamiltonian to
.. specific needs. They are:
..
.. * `gf_struct`: The block structure of the local density matrix given in the format calculated by :class:`SumkDFT`.
.. * `map`: If `gf_struct` is given as parameter, `map` also must be given. This is the mapping from the block structure to a general
.. up/down structure.
..
.. The solver method is called later by this statement::
..
.. S.solve(U_interact,J_hund,use_spinflip=False,use_matrix=True,
.. l=2,T=None, dim_reps=None, irep=None, n_cycles =10000,
.. length_cycle=200,n_warmup_cycles=1000)
..
.. The parameters for the Coulomb interaction `U_interact` and the Hund's coupling `J_hund` are necessary input parameters. The rest are optional
.. parameters for which default values are set. Generally, they should be reset for the problem at hand. Here is a description of the parameters:
..
.. * `use_matrix`: If `True`, the interaction matrix is calculated from Slater integrals, which are computed from `U_interact` and
.. `J_hund`. Otherwise, a Kanamori representation is used. Attention: We define the intraorbital interaction as
.. `U_interact`, the interorbital interaction for opposite spins as `U_interact-2*J_hund`, and interorbital for equal spins as
.. `U_interact-3*J_hund`.
.. * `T`: The matrix that transforms the interaction matrix from spherical harmonics to a symmetry-adapted basis. Only effective for Slater
.. parametrisation, i.e. `use_matrix=True`.
.. * `l`: The orbital quantum number. Again, only effective for Slater parametrisation, i.e. `use_matrix=True`.
.. * `use_spinflip`: If `True`, the full rotationally-invariant interaction is used. Otherwise, only density-density terms are
.. kept in the local Hamiltonian.
.. * `dim_reps`: If only a subset of the full d-shell is used as correlated orbtials, one can specify here the dimensions of all the subspaces
.. of the d-shell, i.e. t2g and eg. Only effective for Slater parametrisation.
.. * `irep`: The index in the list `dim_reps` of the subset that is used. Only effective for Slater parametrisation.
.. * `n_cycles`: Number of CTQMC cycles (a sequence of moves followed by a measurement) per core. The default value of 10000 is the minimum, and generally should be increased.
.. * `length_cycle`: Number of CTQMC moves per one cycle.
.. * `n_warmup_cycles`: Number of initial CTQMC cycles before measurements start. Usually of order of 10000, sometimes needs to be increased significantly.
..
.. Most of above parameters can be taken directly from the :class:`SumkDFT` class, without defining them by hand. We will see a specific example
.. at the end of this tutorial.
.. index:: DFT+DMFT loop, one-shot calculation
Doing the DMFT loop
-------------------
Having initialised the SumK class and the Solver, we can proceed with the DMFT loop itself. As explained in the tutorial, we have to
set up the loop over DMFT iterations and the self-consistency condition::
n_loops = 5
for iteration_number in range(n_loops) : # start the DMFT loop
SK.put_Sigma(Sigma_imp = [ S.Sigma ]) # Put self energy to the SumK class
chemical_potential = SK.calc_mu() # calculate the chemical potential for the given density
S.G_iw << SK.extract_G_loc()[0] # extract the local Green function
S.G0_iw << inverse(S.Sigma_iw + inverse(S.G_iw)) # finally get G0, the input for the Solver
S.solve(h_loc=h_loc, **p) # now solve the impurity problem
dm = S.G_iw.density() # Density matrix of the impurity problem
SK.calc_dc(dm, U_interact=U, J_hund=J, orb=0, use_dc_formula=dc_type) # Set the double counting term
SK.save(['chemical_potential','dc_imp','dc_energ']) # Save data in the hdf5 archive
These basic steps are enough to set up the basic DMFT Loop. For a detailed description of the :class:`SumkDFT` routines,
see the reference manual. After the self-consistency steps, the solution of the Anderson impurity problem is calculation by CTQMC.
Different to model calculations, we have to do a few more steps after this, because of the double-counting correction. We first
calculate the density of the impurity problem. Then, the routine `calc_dc` takes as parameters this density matrix, the
Coulomb interaction, Hund's rule coupling, and the type of double-counting that should be used. Possible values for `use_dc_formula` are:
* `0`: Full-localised limit
* `1`: DC formula as given in K. Held, Adv. Phys. 56, 829 (2007).
* `2`: Around-mean-field
At the end of the calculation, we can save the Greens function and self energy into a file::
from pytriqs.archive import HDFArchive
import pytriqs.utility.mpi as mpi
if mpi.is_master_node():
ar = HDFArchive("YourDFTDMFTcalculation.h5",'w')
ar["G"] = S.G_iw
ar["Sigma"] = S.Sigma_iw
This is it!
These are the essential steps to do a one-shot DFT+DMFT calculation. For full charge-self consistent calculations, there are some more things
to consider, which we will see later on.

BIN
doc/_static/logo_erc.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

View File

@ -3,4 +3,5 @@
<a href="http://www.cpht.polytechnique.fr"> <img style="width: 80px; margin: 10px 5px 0 5px" src='_static/logo_x.png' alt="Ecole Polytechnique"/> </a>
<br>
<a href="http://www.cnrs.fr"> <img style="width: 80px; margin: 10px 0 0 5px" src='_static/logo_cnrs.png' alt="CNRS"/> </a>
<img style="width: 80px; margin: 10px 0 0 5px" src='_static/logo_erc.jpg' alt="ERC"/>
</p>

View File

@ -12,16 +12,16 @@ package and TRIQS has been motivated by a scientific collaboration between the
research groups of Antoine Georges, Silke Biermann (Ecole Polytechnique),
Olivier Parcollet (CEA Saclay). A first step has been the definition of the
framework and the construction of the projective Wannier functions as input for
the DMFT calculations [#wien2k1]_. This has been followed by the introduction
of full charge self-consistency [#wien2k2]_, necessary for total energy
the DMFT calculations [#dft_tools1]_. This has been followed by the introduction
of full charge self-consistency [#dft_tools2]_, necessary for total energy
calculations.
**Developers**: M. Aichhorn, L. Pourovskii, V. Vildosola, C. Martins
**Related papers**:
.. [#wien2k1] `M. Aichhorn, L. Pourovskii, V. Vildosola, M. Ferrero, O. Parcollet, T. Miyake, A. Georges, and S. Biermann, Phys. Rev. B 80, 085101 (2009) <http://link.aps.org/doi/10.1103/PhysRevB.80.085101>`_ (:download:`bibtex file <wien2k1.bib>`)
.. [#wien2k2] `M. Aichhorn, L. Pourovskii, and A. Georges, Phys. Rev. B 84, 054529 (2011) <http://link.aps.org/doi/10.1103/PhysRevB.84.054529>`_ (:download:`bibtex file <wien2k2.bib>`)
.. [#dft_tools1] `M. Aichhorn, L. Pourovskii, V. Vildosola, M. Ferrero, O. Parcollet, T. Miyake, A. Georges, and S. Biermann, Phys. Rev. B 80, 085101 (2009) <http://link.aps.org/doi/10.1103/PhysRevB.80.085101>`_ (:download:`bibtex file <dft_tools1.bib>`)
.. [#dft_tools2] `M. Aichhorn, L. Pourovskii, and A. Georges, Phys. Rev. B 84, 054529 (2011) <http://link.aps.org/doi/10.1103/PhysRevB.84.054529>`_ (:download:`bibtex file <dft_tools2.bib>`)
This application is a part of our scientific work and we would appreciate if
projects using it will include a citation to the above relevant papers. In

View File

@ -0,0 +1,5 @@
Introduction to DFT+DMFT
========================
.. warning::
TO BE WRITTEN!

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -0,0 +1,472 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="940.28571"
height="366.86459"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="New document 1">
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="316.17251"
inkscape:cy="121.23922"
inkscape:document-units="px"
inkscape:current-layer="g7262"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1056"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
fit-margin-top="2"
fit-margin-left="2"
fit-margin-right="2"
fit-margin-bottom="2" />
<defs
id="defs4">
<marker
style="overflow:visible"
id="Arrow2Lend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lend">
<path
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
id="path4287"
inkscape:connector-curvature="0" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Lstart"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lstart">
<path
transform="matrix(1.1,0,0,1.1,1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
id="path4284"
inkscape:connector-curvature="0" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Lend-2"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lend">
<path
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
id="path4287-2"
inkscape:connector-curvature="0" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Lend-8"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lend">
<path
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
id="path4287-1"
inkscape:connector-curvature="0" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Lend-8-4"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lend">
<path
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
id="path4287-1-0"
inkscape:connector-curvature="0" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Lend-8-6"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lend">
<path
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
id="path4287-1-06"
inkscape:connector-curvature="0" />
</marker>
</defs>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-45.57142,-445.06094)"
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1">
<rect
y="525.55212"
x="48.904232"
height="147.90581"
width="176.47723"
id="rect2985"
style="fill:none;stroke:#000000;stroke-width:2.66562319;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
y="525.55212"
x="301.28519"
height="147.90581"
width="176.47723"
id="rect2985-0"
style="fill:none;stroke:#000000;stroke-width:2.66562319;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
y="525.55212"
x="553.66608"
height="147.90581"
width="176.47723"
id="rect2985-0-3"
style="fill:none;stroke:#000000;stroke-width:2.66562319;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
y="525.55212"
x="806.04706"
height="147.90581"
width="176.47723"
id="rect2985-0-3-0"
style="fill:none;stroke:#000000;stroke-width:2.66562319;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<flowRoot
transform="translate(36.91238,327.14359)"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
id="flowRoot3809"
xml:space="preserve"><flowRegion
id="flowRegion3811"><rect
y="257.20096"
x="75.761444"
height="58.588848"
width="121.21831"
id="rect3813" /></flowRegion><flowPara
style="font-size:24px"
id="flowPara3815">DFT</flowPara></flowRoot> <flowRoot
transform="translate(0,308.2677)"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
id="flowRoot3817"
xml:space="preserve"><flowRegion
id="flowRegion3819"><rect
y="244.06897"
x="327.28943"
height="101.01525"
width="132.32999"
id="rect3821" /></flowRegion><flowPara
id="flowPara3823">OrbitalConstruction</flowPara><flowPara
id="flowPara3825" /></flowRoot> <flowRoot
transform="translate(-10.255493,334.56156)"
style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
id="flowRoot3827"
xml:space="preserve"><flowRegion
id="flowRegion3829"><rect
style="text-align:center;text-anchor:middle"
y="234.9776"
x="312.13715"
height="138.39091"
width="174.75639"
id="rect3831" /></flowRegion><flowPara
style="font-size:24px;text-align:center;text-anchor:middle"
id="flowPara3833">Local orbital construction</flowPara></flowRoot> <flowRoot
transform="translate(-6.7847595,318.53031)"
style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
id="flowRoot3835"
xml:space="preserve"><flowRegion
id="flowRegion3837"><rect
style="font-size:24px;text-align:center;text-anchor:middle"
y="235.98775"
x="566.69556"
height="120.20815"
width="162.63457"
id="rect3839" /></flowRegion><flowPara
id="flowPara3841">Conversion to hdf5 archive</flowPara></flowRoot> <flowRoot
transform="translate(-2.4213562,357.42484)"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
id="flowRoot3843"
xml:space="preserve"><flowRegion
id="flowRegion3845"><rect
y="226.89638"
x="814.18292"
height="128.28937"
width="162.63457"
id="rect3847" /></flowRegion><flowPara
style="font-size:24px;text-align:center;text-anchor:middle"
id="flowPara3849">DMFT</flowPara></flowRoot> <rect
transform="translate(0,308.2677)"
y="423.87613"
x="135.36044"
height="24.243662"
width="68.690376"
id="rect3853"
style="fill:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none" />
<rect
y="675.57526"
x="133.37148"
height="134.3503"
width="764.68549"
id="rect3855"
style="fill:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none" />
<path
inkscape:connector-curvature="0"
id="path4047"
d="m 135.12518,673.29337 0,84.84755 759.86734,0"
style="opacity:0.5;fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:8, 4;stroke-dashoffset:0;marker-start:url(#Arrow2Lstart);marker-end:none" />
<path
inkscape:connector-curvature="0"
id="path4047-7"
d="m 894.28568,673.29074 0,84.85281"
style="opacity:0.5;fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:8, 4;stroke-dashoffset:0;marker-start:none;marker-end:none" />
<flowRoot
transform="translate(15.418616,300.3205)"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;opacity:0.5;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
id="flowRoot6758"
xml:space="preserve"><flowRegion
id="flowRegion6760"><rect
y="425.89642"
x="354.56354"
height="60.609154"
width="426.28436"
id="rect6762" /></flowRegion><flowPara
style="font-size:24px"
id="flowPara6764">charge self-consistency</flowPara><flowPara
style="font-size:24px"
id="flowPara6766" /></flowRoot> <path
inkscape:connector-curvature="0"
id="path6768"
d="m 225.71428,599.54026 72.73098,0"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none;marker-end:url(#Arrow2Lend)" />
<path
inkscape:connector-curvature="0"
id="path6768-9"
d="m 478.09523,599.54026 72.73098,0"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none;marker-end:url(#Arrow2Lend)" />
<path
inkscape:connector-curvature="0"
id="path6768-3"
d="m 731.53258,599.54026 72.73098,0"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none;marker-end:url(#Arrow2Lend)" />
<g
id="g7262"
transform="translate(610.13214,375.77675)">
<g
transform="matrix(0.5188263,0,0,0.5188263,-320.97653,401.99967)"
id="g10207">
<g
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;letter-spacing:normal;word-spacing:normal;text-anchor:start;fill:none;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10.43299961;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
id="g10209"
transform="matrix(1.0629921,0,0,-1.0629921,-186.02362,789.27165)"
xml:space="preserve"
stroke-miterlimit="10.433"
font-style="normal"
font-variant="normal"
font-weight="normal"
font-stretch="normal"
font-size-adjust="none"
letter-spacing="normal"
word-spacing="normal"><g
id="g11293"
transform="matrix(1,0,0,-1,239.83153,1485.8696)"><g
word-spacing="normal"
letter-spacing="normal"
font-size-adjust="none"
font-stretch="normal"
font-weight="normal"
font-variant="normal"
font-style="normal"
stroke-miterlimit="10.433"
xml:space="preserve"
transform="matrix(1.0629921,0,0,-1.0629921,-186.02362,789.27165)"
id="content"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;letter-spacing:normal;word-spacing:normal;text-anchor:start;fill:none;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10.43299961;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"><path
id="path11296"
d="m 470.61,421.95 0.21,1.28 3.39,13.56 c 0.43,1.74 0.54,1.89 2.68,1.89 h 4.79 c 4.14,0 6.78,-1.34 6.78,-4.78 0,-1.95 -1,-6.23 -2.94,-8.03 -2.5,-2.23 -5.48,-2.64 -7.69,-2.64 h -7.01 l -0.21,-1.28 h 8.47 c 7.08,0 14,5.17 14,10.75 0,3.84 -3.28,7.53 -9.81,7.53 h -16.14 c -0.95,0 -1.5,0 -1.5,-0.95 0,-0.6 0.45,-0.6 1.45,-0.6 0.64,0 1.55,-0.04 2.14,-0.09 0.8,-0.11 1.1,-0.25 1.1,-0.8 0,-0.2 -0.05,-0.36 -0.21,-0.95 l -6.67,-26.75 c -0.5,-1.95 -0.59,-2.34 -4.53,-2.34 -0.84,0 -1.39,0 -1.39,-0.96 0,-0.59 0.59,-0.59 0.73,-0.59 1.41,0 4.94,0.16 6.33,0.16 1.05,0 2.14,-0.07 3.19,-0.07 1.11,0 2.2,-0.09 3.25,-0.09 0.34,0 0.98,0 0.98,1 0,0.55 -0.43,0.55 -1.39,0.55 -1.84,0 -3.23,0 -3.23,0.89 0,0.29 0.09,0.54 0.14,0.84 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /><path
id="path11298"
d="m 502.96,432.64 v 15.75 l -6.52,-0.28 v -1.96 c 2.13,0 2.33,0 2.33,-1.44 v -18.56 h -2.33 v -1.95 c 0.2,0 2.81,0.14 4.31,0.14 1.68,0 4.29,-0.14 4.33,-0.14 v 1.95 h -2.34 v 3.66 l 2.4,1.7 4.4,-4.76 c 0.28,-0.32 0.31,-0.36 0.31,-0.39 0,-0.21 -0.46,-0.21 -0.74,-0.21 v -1.95 c 1.5,0.06 3.04,0.14 4.54,0.14 1.26,0 2.48,-0.03 3.73,-0.14 v 1.95 c -1.05,0 -1.78,0 -2.1,0.11 -0.25,0.03 -0.31,0.1 -0.73,0.52 l -6.34,6.9 4.98,3.55 c 0.5,0.34 0.71,0.48 3.21,0.48 v 1.96 c -0.94,-0.06 -1.91,-0.14 -2.85,-0.14 -1.55,0 -4.33,0.14 -4.5,0.14 v -1.96 c 0.45,0 0.56,-0.09 0.7,-0.2 -0.07,-0.08 -0.32,-0.25 -0.42,-0.31 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /><path
id="path11300"
d="m 502.68,396.67 -0.01,-0.07 -0.02,-0.07 -0.02,-0.07 -0.02,-0.08 -0.02,-0.07 -0.01,-0.08 -0.04,-0.16 -0.04,-0.16 -0.05,-0.16 -0.03,-0.16 -0.02,-0.08 -0.02,-0.07 -0.02,-0.08 -0.02,-0.07 -0.02,-0.07 -0.01,-0.07 -0.02,-0.07 -0.01,-0.06 -0.02,-0.06 -0.01,-0.06 -0.01,-0.05 -0.01,-0.05 -0.01,-0.05 -0.01,-0.04 0,-0.03 -0.01,-0.03 0,-0.03 0,-0.01 c 0,-0.77 0.62,-1.11 1.17,-1.11 0.64,0 1.19,0.45 1.36,0.76 0.19,0.31 0.45,1.42 0.64,2.16 0.17,0.65 0.55,2.26 0.77,3.14 0.2,0.76 0.4,1.53 0.59,2.33 0.38,1.5 0.38,1.56 1.08,2.65 1.11,1.71 2.86,3.69 5.56,3.69 1.95,0 2.06,-1.61 2.06,-2.44 0,-2.09 -1.5,-5.95 -2.06,-7.42 -0.37,-0.98 -0.52,-1.3 -0.52,-1.89 0,-1.84 1.54,-2.98 3.32,-2.98 3.48,0 5.01,4.79 5.01,5.32 0,0.46 -0.45,0.46 -0.56,0.46 -0.48,0 -0.52,-0.21 -0.65,-0.6 -0.8,-2.78 -2.3,-4.22 -3.69,-4.22 -0.74,0 -0.88,0.49 -0.88,1.22 0,0.8 0.17,1.25 0.8,2.83 0.42,1.08 1.84,4.77 1.84,6.72 0,0.56 0,2.03 -1.28,3.03 -0.59,0.45 -1.61,0.94 -3.25,0.94 -3.12,0 -5.05,-2.05 -6.15,-3.52 -0.29,2.97 -2.77,3.52 -4.54,3.52 -2.89,0 -4.84,-1.77 -5.89,-3.16 -0.25,2.39 -2.29,3.16 -3.73,3.16 -1.5,0 -2.3,-1.08 -2.75,-1.88 -0.77,-1.28 -1.25,-3.28 -1.25,-3.45 0,-0.45 0.48,-0.45 0.59,-0.45 0.49,0 0.52,0.11 0.77,1.04 0.51,2.07 1.19,3.77 2.55,3.77 0.9,0 1.14,-0.77 1.14,-1.7 0,-0.67 -0.32,-1.96 -0.57,-2.89 -0.23,-0.96 -0.57,-2.38 -0.76,-3.14 l -1.11,-4.47 c -0.14,-0.44 -0.35,-1.32 -0.35,-1.42 0,-0.77 0.63,-1.11 1.19,-1.11 0.63,0 1.17,0.45 1.36,0.76 0.17,0.31 0.45,1.42 0.63,2.16 0.17,0.65 0.54,2.26 0.76,3.14 0.21,0.76 0.42,1.53 0.6,2.33 0.37,1.43 0.45,1.7 1.45,3.14 0.98,1.39 2.62,3.2 5.23,3.2 2.02,0 2.05,-1.78 2.05,-2.44 0,-0.87 -0.09,-1.33 -0.59,-3.28 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /><path
id="path11302"
d="m 531.71,408.2 0,0.03 0.01,0.02 0,0.03 0.01,0.03 0.01,0.04 0,0.03 0.01,0.03 0,0.04 0,0.03 0.01,0.03 0,0.04 0,0.03 0.01,0.04 0,0.03 0,0.03 0,0.03 c 0,0.04 0,0.49 -0.55,0.49 -0.04,0 -2.03,-0.17 -2.26,-0.17 -0.68,-0.07 -1.3,-0.1 -1.96,-0.17 -0.56,-0.04 -0.98,-0.07 -0.98,-0.8 0,-0.49 0.48,-0.49 0.91,-0.49 1.67,0 1.67,-0.21 1.67,-0.53 0,-0.2 -0.17,-0.9 -0.32,-1.36 l -1.73,-7.03 c -0.87,-3.48 -1.05,-4.19 -1.05,-4.33 0,-0.48 0.52,-0.48 0.66,-0.48 h 0.56 c 3.1,0.48 7.53,2.12 11.25,5.44 4.74,4.22 5.44,8.75 5.44,8.81 0,0.62 -0.48,1.11 -1.19,1.11 -1.22,0 -1.45,-0.97 -1.78,-1.94 -1.39,-4.95 -6.06,-10.28 -11.98,-12.03 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /></g></g></g> </g>
<g
id="g10426"
transform="matrix(0.5188263,0,0,0.5188263,-294.65772,221.99331)"
style="opacity:0.5">
<g
word-spacing="normal"
letter-spacing="normal"
font-size-adjust="none"
font-stretch="normal"
font-weight="normal"
font-variant="normal"
font-style="normal"
stroke-miterlimit="10.433"
xml:space="preserve"
transform="matrix(1.0629921,0,0,-1.0629921,-186.02362,789.27165)"
id="g10857"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;letter-spacing:normal;word-spacing:normal;text-anchor:start;fill:none;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10.43299961;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"><path
id="path10429"
d="m 457.16,397.57 -0.01,-0.02 0,-0.03 -0.01,-0.03 0,-0.02 -0.01,-0.03 -0.01,-0.02 0,-0.02 -0.01,-0.03 0,-0.02 -0.01,-0.02 0,-0.02 0,-0.02 -0.01,-0.02 0,-0.02 -0.01,-0.04 -0.01,-0.03 0,-0.03 -0.01,-0.03 -0.01,-0.03 0,-0.03 -0.01,-0.02 0,-0.02 0,-0.03 -0.01,-0.02 0,-0.02 0,-0.01 0,-0.02 0,-0.01 -0.01,-0.02 0,-0.01 0,-0.02 0,-0.01 0,-0.01 0,-0.02 0,-0.02 0,-0.02 c 0,-0.74 0.55,-1.35 1.39,-1.35 1.05,0 1.64,0.91 1.75,1.05 0.23,0.45 1.84,7.13 3.19,12.52 0.98,-2 2.58,-3.35 4.92,-3.35 l -0.05,1.1 c -3.48,0 -4.28,3.98 -4.28,4.43 0,0.21 0.25,1.19 0.39,1.85 1.41,5.58 1.91,7.37 3,9.36 2.14,3.64 4.63,4.73 6.17,4.73 1.85,0 3.44,-1.44 3.44,-4.87 0,-2.75 -1.44,-8.33 -2.78,-10.77 -1.66,-3.14 -4.05,-4.73 -5.94,-4.73 h 0 l 0.05,-1.1 c 5.83,0 12.27,7.03 12.27,14.46 0,5.28 -3.3,8.1 -6.94,8.1 -4.83,0 -10.06,-4.98 -11.55,-11.06 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /><path
id="path10431"
d="m 497.8,394.25 0,0.02 0,0.03 0,0.01 0,0.02 -0.01,0.01 0,0.02 -0.01,0.01 0,0.02 -0.01,0.02 -0.01,0.02 -0.02,0.02 -0.01,0.03 -0.02,0.02 -0.01,0.03 -0.03,0.03 -0.02,0.03 -0.03,0.03 -0.03,0.04 -0.01,0.02 -0.02,0.02 -0.01,0.02 -0.02,0.02 -0.02,0.02 -0.02,0.03 -0.02,0.02 -0.03,0.02 -0.02,0.03 -0.02,0.02 -0.03,0.03 -0.02,0.03 -0.03,0.03 -0.03,0.03 -0.02,0.03 -0.03,0.03 -0.04,0.03 -0.03,0.03 -0.03,0.04 -0.03,0.03 -0.04,0.04 -0.04,0.03 -0.03,0.04 -0.04,0.04 c -6.22,6.28 -7.82,15.69 -7.82,23.31 0,8.67 1.9,17.35 8.02,23.56 0.64,0.61 0.64,0.71 0.64,0.86 0,0.35 -0.19,0.49 -0.48,0.49 -0.5,0 -4.99,-3.38 -7.93,-9.7 -2.54,-5.49 -3.14,-11.02 -3.14,-15.21 0,-3.89 0.55,-9.9 3.29,-15.54 2.98,-6.13 7.28,-9.36 7.78,-9.36 0.29,0 0.48,0.14 0.48,0.5 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /><path
id="path10433"
d="m 510.74,423 v 5.62 l -8.26,-0.41 v -2.34 c 3.09,0 3.43,0 3.43,-1.94 v -15.39 h -3.43 v -2.34 c 1.75,0.05 3.98,0.16 6.28,0.16 1.89,0 5.08,0 6.87,-0.16 v 2.34 h -4.34 v 8.72 c 0,3.49 1.25,9.56 6.23,9.56 -0.04,-0.04 -0.95,-0.84 -0.95,-2.29 0,-2.03 1.59,-3.03 3.05,-3.03 1.43,0 3.03,1.04 3.03,3.03 0,2.64 -2.69,4.09 -5.28,4.09 -3.49,0 -5.47,-2.5 -6.63,-5.62 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /><path
id="path10435"
d="m 538.66,418.65 0,0.37 -0.01,0.39 -0.01,0.39 -0.01,0.41 -0.04,0.84 -0.06,0.88 -0.08,0.92 -0.11,0.95 -0.13,0.97 -0.17,1.01 -0.19,1.02 -0.23,1.03 -0.27,1.05 -0.3,1.06 -0.35,1.07 -0.4,1.07 -0.21,0.53 -0.22,0.53 -0.24,0.53 -0.25,0.53 c -2.98,6.12 -7.27,9.36 -7.77,9.36 -0.29,0 -0.5,-0.19 -0.5,-0.49 0,-0.15 0,-0.25 0.94,-1.15 4.89,-4.92 7.73,-12.85 7.73,-23.27 0,-8.51 -1.84,-17.28 -8.03,-23.56 -0.64,-0.59 -0.64,-0.7 -0.64,-0.84 0,-0.3 0.21,-0.5 0.5,-0.5 0.5,0 4.97,3.39 7.92,9.71 2.54,5.47 3.13,11 3.13,15.19 z"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:0" /></g> </g>
<g
transform="matrix(0.5188263,0,0,0.5188263,-532.249,4.641191)"
id="g10637">
<g
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;letter-spacing:normal;word-spacing:normal;text-anchor:start;fill:none;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10.43299961;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
id="g10639"
transform="matrix(1.0629921,0,0,-1.0629921,-186.02362,789.27165)"
xml:space="preserve"
stroke-miterlimit="10.433"
font-style="normal"
font-variant="normal"
font-weight="normal"
font-stretch="normal"
font-size-adjust="none"
letter-spacing="normal"
word-spacing="normal"><polygon
style="fill:#000000;stroke-width:0"
points="481.05,453.38 474.38,446.6 475.27,445.71 481.05,450.79 486.79,445.71 487.68,446.6 "
id="polygon10641" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 493.54,436.39 0.04,0.16 0.04,0.16 0.04,0.15 0.04,0.14 0.04,0.14 0.04,0.13 0.04,0.12 0.05,0.11 0.05,0.11 0.05,0.11 0.06,0.09 0.07,0.09 0.07,0.09 0.08,0.08 0.09,0.07 0.09,0.07 0.11,0.06 0.11,0.06 0.13,0.05 0.14,0.05 0.15,0.04 0.16,0.04 0.09,0.02 0.09,0.02 0.09,0.01 0.1,0.02 0.1,0.01 0.1,0.01 0.11,0.02 0.11,0.01 0.12,0.01 0.12,0 0.13,0.01 0.13,0.01 0.13,0.01 0.14,0 0.14,0 0.15,0.01 0.15,0 0.16,0 0.16,0 0.17,0 c 1.3,0 1.69,0 1.69,1 0,0.55 -0.55,0.55 -0.7,0.55 -1.39,0 -4.97,-0.16 -6.38,-0.16 -1.44,0 -4.98,0.16 -6.42,0.16 -0.39,0 -0.95,0 -0.95,-1 0,-0.55 0.45,-0.55 1.4,-0.55 0.1,0 1.05,0 1.89,-0.09 0.89,-0.11 1.35,-0.16 1.35,-0.8 0,-0.2 -0.05,-0.31 -0.21,-0.95 l -2.98,-12.16 h -15.2 l 2.95,11.71 c 0.44,1.79 0.59,2.29 4.17,2.29 1.3,0 1.71,0 1.71,1 0,0.55 -0.55,0.55 -0.71,0.55 -1.39,0 -4.98,-0.16 -6.37,-0.16 -1.44,0 -4.99,0.16 -6.42,0.16 -0.41,0 -0.96,0 -0.96,-1 0,-0.55 0.46,-0.55 1.39,-0.55 0.11,0 1.05,0 1.91,-0.09 0.89,-0.11 1.34,-0.16 1.34,-0.8 0,-0.2 -0.06,-0.36 -0.2,-0.95 l -6.67,-26.75 c -0.5,-1.95 -0.61,-2.34 -4.55,-2.34 -0.89,0 -1.34,0 -1.34,-1 0,-0.55 0.61,-0.55 0.7,-0.55 1.39,0 4.94,0.16 6.33,0.16 1.05,0 2.14,-0.07 3.19,-0.07 1.09,0 2.18,-0.09 3.23,-0.09 0.41,0 1,0 1,1 0,0.55 -0.45,0.55 -1.39,0.55 -1.84,0 -3.23,0 -3.23,0.89 0,0.29 0.09,0.54 0.14,0.84 l 3.39,13.66 H 486 c -2.09,-8.27 -3.23,-13 -3.43,-13.75 -0.49,-1.6 -1.44,-1.64 -4.53,-1.64 -0.75,0 -1.19,0 -1.19,-1 0,-0.55 0.59,-0.55 0.69,-0.55 1.4,0 4.93,0.16 6.32,0.16 1.05,0 2.14,-0.07 3.19,-0.07 1.11,0 2.2,-0.09 3.25,-0.09 0.39,0 0.99,0 0.99,1 0,0.55 -0.44,0.55 -1.4,0.55 -1.84,0 -3.23,0 -3.23,0.89 0,0.29 0.09,0.54 0.14,0.84 z"
id="path10643" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 517.48,394.25 0,0.02 0,0.03 0,0.01 0,0.02 0,0.01 -0.01,0.02 0,0.01 -0.01,0.02 -0.01,0.02 -0.01,0.02 -0.01,0.02 -0.02,0.03 -0.01,0.02 -0.02,0.03 -0.02,0.03 -0.03,0.03 -0.02,0.03 -0.03,0.04 -0.02,0.02 -0.01,0.02 -0.02,0.02 -0.02,0.02 -0.02,0.02 -0.02,0.03 -0.02,0.02 -0.02,0.02 -0.02,0.03 -0.03,0.02 -0.02,0.03 -0.03,0.03 -0.02,0.03 -0.03,0.03 -0.03,0.03 -0.03,0.03 -0.03,0.03 -0.03,0.03 -0.04,0.04 -0.03,0.03 -0.04,0.04 -0.03,0.03 -0.04,0.04 -0.04,0.04 c -6.22,6.28 -7.81,15.69 -7.81,23.31 0,8.67 1.89,17.35 8.01,23.56 0.64,0.61 0.64,0.71 0.64,0.86 0,0.35 -0.18,0.49 -0.48,0.49 -0.5,0 -4.98,-3.38 -7.92,-9.7 -2.55,-5.49 -3.14,-11.02 -3.14,-15.21 0,-3.89 0.54,-9.9 3.28,-15.54 2.98,-6.13 7.28,-9.36 7.78,-9.36 0.3,0 0.48,0.14 0.48,0.5 z"
id="path10645" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 530.97,418.01 v 22.77 l -8.81,-0.41 v -2.34 c 3.09,0 3.44,0 3.44,-1.94 v -27.55 h -3.44 v -2.34 c 1.84,0.05 4.19,0.16 5.99,0.16 1.84,0 4.23,-0.11 6.01,-0.16 v 2.34 h -3.44 v 6.33 c 1.46,1.14 1.85,1.44 2.85,2.14 l 5.03,-6.28 c 0.45,-0.59 1.25,-1.59 1.25,-1.73 0,-0.46 -0.89,-0.46 -1.55,-0.46 v -2.34 c 1.5,0.09 5.83,0.16 6.08,0.16 1.8,0 3.48,-0.07 5.19,-0.16 v 2.34 h -0.86 c -2.14,0 -2.28,0.21 -2.94,1 l -8.42,10.5 6.48,5.03 c 0.7,0.57 1.14,0.91 4.49,0.91 v 2.34 c -1.35,-0.15 -2.6,-0.15 -3.89,-0.15 -1.35,0 -4.58,0.11 -5.72,0.15 v -2.34 c 1.14,0 1.28,-0.16 1.69,-0.55 z"
id="path10647" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 565.06,418.65 0,0.37 0,0.39 -0.01,0.39 -0.02,0.41 -0.04,0.84 -0.06,0.88 -0.08,0.92 -0.1,0.95 -0.14,0.97 -0.16,1.01 -0.2,1.02 -0.23,1.03 -0.27,1.05 -0.3,1.06 -0.35,1.07 -0.39,1.07 -0.22,0.53 -0.22,0.53 -0.24,0.53 -0.25,0.53 c -2.98,6.12 -7.26,9.36 -7.76,9.36 -0.3,0 -0.5,-0.19 -0.5,-0.49 0,-0.15 0,-0.25 0.93,-1.15 4.89,-4.92 7.74,-12.85 7.74,-23.27 0,-8.51 -1.85,-17.28 -8.03,-23.56 -0.64,-0.59 -0.64,-0.7 -0.64,-0.84 0,-0.3 0.2,-0.5 0.5,-0.5 0.5,0 4.96,3.39 7.92,9.71 2.53,5.47 3.12,11 3.12,15.19 z"
id="path10649" /></g> </g>
<flowRoot
xml:space="preserve"
id="flowRoot11426"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
transform="translate(-599.7987,-36.094479)"><flowRegion
id="flowRegion11428"><rect
id="rect11430"
width="59.598999"
height="61.619305"
x="742.4621"
y="201.64256" /></flowRegion><flowPara
id="flowPara11432"
style="font-size:24px">h5</flowPara></flowRoot> <g
transform="matrix(0.5188263,0,0,0.5188263,-402.04235,-88.167881)"
id="g10637-6">
<g
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;letter-spacing:normal;word-spacing:normal;text-anchor:start;fill:none;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10.43299961;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
id="g10639-9"
transform="matrix(1.0629921,0,0,-1.0629921,-186.02362,789.27165)"
xml:space="preserve"
stroke-miterlimit="10.433"
font-style="normal"
font-variant="normal"
font-weight="normal"
font-stretch="normal"
font-size-adjust="none"
letter-spacing="normal"
word-spacing="normal"><polygon
style="fill:#000000;stroke-width:0"
points="481.05,450.79 486.79,445.71 487.68,446.6 481.05,453.38 474.38,446.6 475.27,445.71 "
id="polygon10641-3" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 493.54,436.39 0.04,0.16 0.04,0.16 0.04,0.15 0.04,0.14 0.04,0.14 0.04,0.13 0.04,0.12 0.05,0.11 0.05,0.11 0.05,0.11 0.06,0.09 0.07,0.09 0.07,0.09 0.08,0.08 0.09,0.07 0.09,0.07 0.11,0.06 0.11,0.06 0.13,0.05 0.14,0.05 0.15,0.04 0.16,0.04 0.09,0.02 0.09,0.02 0.09,0.01 0.1,0.02 0.1,0.01 0.1,0.01 0.11,0.02 0.11,0.01 0.12,0.01 0.12,0 0.13,0.01 0.13,0.01 0.13,0.01 0.14,0 0.14,0 0.15,0.01 0.15,0 0.16,0 0.16,0 0.17,0 c 1.3,0 1.69,0 1.69,1 0,0.55 -0.55,0.55 -0.7,0.55 -1.39,0 -4.97,-0.16 -6.38,-0.16 -1.44,0 -4.98,0.16 -6.42,0.16 -0.39,0 -0.95,0 -0.95,-1 0,-0.55 0.45,-0.55 1.4,-0.55 0.1,0 1.05,0 1.89,-0.09 0.89,-0.11 1.35,-0.16 1.35,-0.8 0,-0.2 -0.05,-0.31 -0.21,-0.95 l -2.98,-12.16 h -15.2 l 2.95,11.71 c 0.44,1.79 0.59,2.29 4.17,2.29 1.3,0 1.71,0 1.71,1 0,0.55 -0.55,0.55 -0.71,0.55 -1.39,0 -4.98,-0.16 -6.37,-0.16 -1.44,0 -4.99,0.16 -6.42,0.16 -0.41,0 -0.96,0 -0.96,-1 0,-0.55 0.46,-0.55 1.39,-0.55 0.11,0 1.05,0 1.91,-0.09 0.89,-0.11 1.34,-0.16 1.34,-0.8 0,-0.2 -0.06,-0.36 -0.2,-0.95 l -6.67,-26.75 c -0.5,-1.95 -0.61,-2.34 -4.55,-2.34 -0.89,0 -1.34,0 -1.34,-1 0,-0.55 0.61,-0.55 0.7,-0.55 1.39,0 4.94,0.16 6.33,0.16 1.05,0 2.14,-0.07 3.19,-0.07 1.09,0 2.18,-0.09 3.23,-0.09 0.41,0 1,0 1,1 0,0.55 -0.45,0.55 -1.39,0.55 -1.84,0 -3.23,0 -3.23,0.89 0,0.29 0.09,0.54 0.14,0.84 l 3.39,13.66 H 486 c -2.09,-8.27 -3.23,-13 -3.43,-13.75 -0.49,-1.6 -1.44,-1.64 -4.53,-1.64 -0.75,0 -1.19,0 -1.19,-1 0,-0.55 0.59,-0.55 0.69,-0.55 1.4,0 4.93,0.16 6.32,0.16 1.05,0 2.14,-0.07 3.19,-0.07 1.11,0 2.2,-0.09 3.25,-0.09 0.39,0 0.99,0 0.99,1 0,0.55 -0.44,0.55 -1.4,0.55 -1.84,0 -3.23,0 -3.23,0.89 0,0.29 0.09,0.54 0.14,0.84 z"
id="path10643-5" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 517.48,394.25 0,0.02 0,0.03 0,0.01 0,0.02 0,0.01 -0.01,0.02 0,0.01 -0.01,0.02 -0.01,0.02 -0.01,0.02 -0.01,0.02 -0.02,0.03 -0.01,0.02 -0.02,0.03 -0.02,0.03 -0.03,0.03 -0.02,0.03 -0.03,0.04 -0.02,0.02 -0.01,0.02 -0.02,0.02 -0.02,0.02 -0.02,0.02 -0.02,0.03 -0.02,0.02 -0.02,0.02 -0.02,0.03 -0.03,0.02 -0.02,0.03 -0.03,0.03 -0.02,0.03 -0.03,0.03 -0.03,0.03 -0.03,0.03 -0.03,0.03 -0.03,0.03 -0.04,0.04 -0.03,0.03 -0.04,0.04 -0.03,0.03 -0.04,0.04 -0.04,0.04 c -6.22,6.28 -7.81,15.69 -7.81,23.31 0,8.67 1.89,17.35 8.01,23.56 0.64,0.61 0.64,0.71 0.64,0.86 0,0.35 -0.18,0.49 -0.48,0.49 -0.5,0 -4.98,-3.38 -7.92,-9.7 -2.55,-5.49 -3.14,-11.02 -3.14,-15.21 0,-3.89 0.54,-9.9 3.28,-15.54 2.98,-6.13 7.28,-9.36 7.78,-9.36 0.3,0 0.48,0.14 0.48,0.5 z"
id="path10645-0" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 530.97,418.01 v 22.77 l -8.81,-0.41 v -2.34 c 3.09,0 3.44,0 3.44,-1.94 v -27.55 h -3.44 v -2.34 c 1.84,0.05 4.19,0.16 5.99,0.16 1.84,0 4.23,-0.11 6.01,-0.16 v 2.34 h -3.44 v 6.33 c 1.46,1.14 1.85,1.44 2.85,2.14 l 5.03,-6.28 c 0.45,-0.59 1.25,-1.59 1.25,-1.73 0,-0.46 -0.89,-0.46 -1.55,-0.46 v -2.34 c 1.5,0.09 5.83,0.16 6.08,0.16 1.8,0 3.48,-0.07 5.19,-0.16 v 2.34 h -0.86 c -2.14,0 -2.28,0.21 -2.94,1 l -8.42,10.5 6.48,5.03 c 0.7,0.57 1.14,0.91 4.49,0.91 v 2.34 c -1.35,-0.15 -2.6,-0.15 -3.89,-0.15 -1.35,0 -4.58,0.11 -5.72,0.15 v -2.34 c 1.14,0 1.28,-0.16 1.69,-0.55 z"
id="path10647-4" /><path
style="fill:#000000;stroke-width:0"
inkscape:connector-curvature="0"
d="m 565.06,418.65 0,0.37 0,0.39 -0.01,0.39 -0.02,0.41 -0.04,0.84 -0.06,0.88 -0.08,0.92 -0.1,0.95 -0.14,0.97 -0.16,1.01 -0.2,1.02 -0.23,1.03 -0.27,1.05 -0.3,1.06 -0.35,1.07 -0.39,1.07 -0.22,0.53 -0.22,0.53 -0.24,0.53 -0.25,0.53 c -2.98,6.12 -7.26,9.36 -7.76,9.36 -0.3,0 -0.5,-0.19 -0.5,-0.49 0,-0.15 0,-0.25 0.93,-1.15 4.89,-4.92 7.74,-12.85 7.74,-23.27 0,-8.51 -1.85,-17.28 -8.03,-23.56 -0.64,-0.59 -0.64,-0.7 -0.64,-0.84 0,-0.3 0.2,-0.5 0.5,-0.5 0.5,0 4.96,3.39 7.92,9.71 2.53,5.47 3.12,11 3.12,15.19 z"
id="path10649-6" /></g> </g>
</g>
<g
id="g10119"
transform="matrix(1,0,0,0.70871229,0,153.18102)">
<path
inkscape:connector-curvature="0"
id="path9519"
d="m 137.14285,523.21931 0,-58.58884"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
inkscape:connector-curvature="0"
id="path9519-0"
d="m 641.90469,523.21931 0,-58.58884"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:url(#Arrow2Lstart);marker-end:none" />
<path
inkscape:connector-curvature="0"
id="path10117"
d="m 137.37876,464.4534 505.08025,0"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,11 @@
Structure of DFT Tools
======================
.. warning::
TO BE WRITTEN!
.. image:: images/structure.png
:width: 700
:align: center

View File

@ -5,11 +5,16 @@
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'matplotlib.sphinxext.plot_directive']
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'numpydoc']
source_suffix = '.rst'
project = u'TRIQS Interface to Wien2k'
project = u'TRIQS_DFT Tools'
copyright = u'2011-2013, M. Aichhorn, L. Pourovskii, V. Vildosola, C. Martins'
version = '@DFT_TOOLS_VERSION@'
release = '@DFT_TOOLS_RELEASE@'
@ -21,7 +26,7 @@ html_theme = 'triqs'
html_theme_path = ['@TRIQS_THEMES_PATH@']
html_show_sphinx = False
html_context = {'header_title': 'dft_tools',
'header_subtitle': 'Connecting <a class="triqs" style="font-size: 12px" href="http://ipht.cea.fr/triqs">TRIQS</a> to DFT packages',
'header_subtitle': 'connecting <a class="triqs" style="font-size: 12px" href="http://ipht.cea.fr/triqs">TRIQS</a> to DFT packages',
'header_links': [['Install', 'install'],
['Documentation', 'documentation'],
['Issues', 'issues'],
@ -32,4 +37,4 @@ html_sidebars = {'index': ['sideb.html', 'searchbox.html']}
htmlhelp_basename = 'TRIQSDftToolsdoc'
intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None), 'triqslibs': ('http://ipht.cea.fr/triqs', None),
'triqscthyb': ('http://ipht.cea.fr/triqs/applications/cthyb_matrix', None)}
'triqscthyb': ('http://ipht.cea.fr/triqs/applications/cthyb', None)}

View File

@ -9,4 +9,3 @@ Table of contents
documentation
issues
about

View File

@ -1,4 +1,3 @@
.. module:: pytriqs.applications.dft_tools
.. _documentation:
@ -6,36 +5,30 @@
Documentation
=============
A (not so) quick tour
---------------------
Basic notions
-------------
.. toctree::
:maxdepth: 1
:maxdepth: 2
interface
DFTDMFTmain
advanced
analysis
selfcons
Ce-HI
Transport
basicnotions/dft_dmft
basicnotions/structure
Projective Wannier functions: the dmftproj package
--------------------------------------------------
In addition to the python-related modules, TRIQS also
provides the Wien2k add-on :program:`dmftproj`. It takes the
information about the wave functions calculated by the `Wien2k package
<http://www.wien2k.at>`_, and constructs projected Wannier functions
that are used as localised orbitals for the DMFT calculation.
User guide
----------
.. toctree::
:maxdepth: 2
guide/orbital_construction
guide/conversion
guide/dftdmft_singleshot
guide/dftdmft_selfcons
guide/analysis
guide/full_tutorial
guide/transport
The program :program:`dmftproj` is written in the flavor of the
`Wien2k package <http://www.wien2k.at>`_ without python
support. A detailed description of the usage and options of
:program:`dmftproj`
can be found in :download:`this extensive tutorial <TutorialDmftproj.pdf>`. In
addition, it contains also a description of the Wien2k scripts that
are necessary to do the full charge self-consistent calculations.
Reference manual
----------------
@ -46,6 +39,18 @@ This is the reference manual for the python routines.
:maxdepth: 2
reference/h5structure
reference/converters
reference/sumk_dft
reference/sumk_dft_tools
reference/U_matrix
reference/symmetry
reference/transbasis
FAQs
----
.. toctree::
:maxdepth: 2
faqs/faqs

17
doc/faqs/faqs.rst Normal file
View File

@ -0,0 +1,17 @@
Frequently-Asked Questions
==========================
How do I do ..this..?
---------------------
This is how you do this.
How do I do ..this.. correctly?
-------------------------------
Correctly is subjective.
Why is my calculation not working?
----------------------------------
Are you running in the right shell?

98
doc/function_template.py Normal file
View File

@ -0,0 +1,98 @@
class function_template():
def old_fft(name, state=None):
"""This function does something.
:param name: The name to use.
:type name: str.
:param state: Current state to be in.
:type state: bool.
:returns: int -- the return code.
:raises: AttributeError, KeyError
"""
return 0
def fft(a, n=None, axis=-1):
"""
Compute the one-dimensional discrete Fourier Transform.
This function computes the one-dimensional *n*-point discrete Fourier
Transform (DFT) with the efficient Fast Fourier Transform (FFT)
algorithm [CT].
Parameters
----------
a : array_like
Input array, can be complex.
n : int, optional
Length of the transformed axis of the output.
If `n` is smaller than the length of the input, the input is cropped.
If it is larger, the input is padded with zeros. If `n` is not given,
the length of the input along the axis specified by `axis` is used.
axis : int, optional
Axis over which to compute the FFT. If not given, the last axis is
used.
Returns
-------
out : complex ndarray
The truncated or zero-padded input, transformed along the axis
indicated by `axis`, or the last one if `axis` is not specified.
Raises
------
IndexError
if `axes` is larger than the last axis of `a`.
See Also
--------
numpy.fft : for definition of the DFT and conventions used.
ifft : The inverse of `fft`.
fft2 : The two-dimensional FFT.
fftn : The *n*-dimensional FFT.
rfftn : The *n*-dimensional FFT of real input.
fftfreq : Frequency bins for given FFT parameters.
Notes
-----
FFT (Fast Fourier Transform) refers to a way the discrete Fourier
Transform (DFT) can be calculated efficiently, by using symmetries in the
calculated terms. The symmetry is highest when `n` is a power of 2, and
the transform is therefore most efficient for these sizes.
The DFT is defined, with the conventions used in this implementation, in
the documentation for the `numpy.fft` module.
References
----------
.. [CT] Cooley, James W., and John W. Tukey, 1965, "An algorithm for the
machine calculation of complex Fourier series," *Math. Comput.*
19: 297-301.
Examples
--------
>>> np.fft.fft(np.exp(2j * np.pi * np.arange(8) / 8))
array([ -3.44505240e-16 +1.14383329e-17j,
8.00000000e+00 -5.71092652e-15j,
2.33482938e-16 +1.22460635e-16j,
1.64863782e-15 +1.77635684e-15j,
9.95839695e-17 +2.33482938e-16j,
0.00000000e+00 +1.66837030e-15j,
1.14383329e-17 +1.22460635e-16j,
-1.64863782e-15 +1.77635684e-15j])
>>> import matplotlib.pyplot as plt
>>> t = np.arange(256)
>>> sp = np.fft.fft(np.sin(t))
>>> freq = np.fft.fftfreq(t.shape[-1])
>>> plt.plot(freq, sp.real, freq, sp.imag)
[<matplotlib.lines.Line2D object at 0x...>, <matplotlib.lines.Line2D object at
0x...>]
>>> plt.show()
In this example, real input has an FFT which is Hermitian, i.e., symmetric
in the real part and anti-symmetric in the imaginary part, as described in
the `numpy.fft` documentation.
"""
return 0

View File

@ -3,6 +3,9 @@
Tools for analysis
==================
.. warning::
TO BE UPDATED!
This section explains how to use some tools of the package in order to analyse the data.
.. warning::

View File

@ -1,23 +1,27 @@
.. _conversion:
The interface
=============
Converting DFT data to a hdf archive
====================================
.. warning::
TO BE UPDATED!
EXPLAIN CONCEPT OF CONVERSION
Wien2k + dmftproj
-----------------
LISTING OF FILES NECESSARY FOR EACH SUBGROUP
The basic function of the interface to the Wien2k program package is to take
the output of the program that constructs the projected local orbitals
(:program:`dmftproj`, for documentation see
:download:`TutorialDmftproj.pdf <TutorialDmftproj.pdf>`),
:download:`TutorialDmftproj.pdf <images_scripts/TutorialDmftproj.pdf>`),
and to store all the necessary information into an hdf5 file. This latter file
is then used to do the DMFT calculation. The reason for this structure is that
this enables the user to have everything that is necessary to reproduce the
calculation in one single hdf5 archive.
.. index:: Interface to Wien2k
.. _interfacetowien:
The interface to Wien2k
-----------------------
As explained above, this interface produces an hdf5 archive out of the files that
were written by the band structure package :program:`Wien2k/dmftproj`.
For this purpose we
@ -60,6 +64,9 @@ After this step, all the necessary information for the DMFT loop is stored in th
the string variable `Converter.hdf_file` gives the file name of the archive.
You can now proceed with :ref:`DFTDMFTmain`.
A general H(k)
--------------
LISTING OF FILES NECESSARY, NAME OF CONVERTER
Data for post-processing
------------------------

View File

@ -1,11 +1,17 @@
.. index:: full charge self consistency
.. _full_charge_selfcons:
Full charge self consistency
============================
Wien2k + dmftproj
-----------------
.. warning::
TO BE UPDATED!
.. warning::
Before using this tool, you should be familiar with the band-structure package :program:`Wien2k`, since
the calculation is controlled by the :program:`Wien2k` scripts! See also the :download:`dmftproj tutorial<TutorialDmftproj.pdf>`.
the calculation is controlled by the :program:`Wien2k` scripts! See also the :download:`dmftproj tutorial<images_scripts/TutorialDmftproj.pdf>`.
In order to do charge self-consistent calculations, we have to tell the band structure program about the
changes in the charge density due to correlation effects. In the following, we discuss how to use the
@ -26,14 +32,14 @@ and store it in a format such that :program:`Wien2k` can read it. Therefore, aft
previous section, we symmetrise the self energy, and recalculate the impurity Green function::
SK.symm_deg_gf(S.Sigma,orb=0)
S.G << inverse(S.G0) - S.Sigma
S.G.invert()
S.G_iw << inverse(S.G0_iw) - S.Sigma_iw
S.G_iw.invert()
These steps are not necessary, but can help to reduce fluctuations in the total energy.
Now we calculate the modified charge density::
# find exact chemical potential
SK.put_Sigma(Sigma_imp = [ S.Sigma ])
SK.put_Sigma(Sigma_imp = [ S.Sigma_iw ])
chemical_potential = SK.calc_mu( precision = 0.000001 )
dN, d = SK.calc_density_correction(filename = dft_filename+'.qdmft')
SK.save(['chemical_potential','dc_imp','dc_energ'])
@ -44,7 +50,7 @@ is stored in the file `dft_filename.qdmft`, which is later read by the :program:
the chemical potential into the hdf5 archive.
We need also the correlation energy, which we evaluate by the Migdal formula::
correnerg = 0.5 * (S.G * S.Sigma).total_density()
correnerg = 0.5 * (S.G_iw * S.Sigma_iw).total_density()
From this value, we substract the double counting energy::
@ -85,3 +91,11 @@ unstable convergence, you have to adjust the parameters such as
In the next section, :ref:`DFTDMFTtutorial`, we will see in a detailed
example how such a self consistent calculation is performed.
VASP + wannier90
----------------
.. warning::
IN PROGRESS!

View File

@ -1,7 +1,87 @@
.. _advanced:
.. highlight:: python
.. _singleshot:
Single-shot DFT+DMFT
====================
.. warning::
TO BE UPDATED!
After having set up the hdf5 archive, we can now do our DFT+DMFT calculation. It consists of
initialisation steps, and the actual DMFT self consistency loop.
Initialisation of the calculation
---------------------------------
Before doing the calculation, we have to intialize all the objects that we will need. The first thing is the
:class:`SumkDFT` class. It contains all basic routines that are necessary to perform a summation in k-space
to get the local quantities used in DMFT. It is initialized by::
from pytriqs.applications.dft.sumk_dft import *
SK = SumkDFT(hdf_file = filename)
Setting up the impurity solver
------------------------------
The next step is to setup the impurity solver.
For more details here, see the `CTHYB <http://ipht.cea.fr/triqs/1.2/applications/cthyb/>`_ documentation.
Doing the DMFT loop
-------------------
Having initialised the SumK class and the Solver, we can proceed with the DMFT
loop itself. As explained in the tutorial, we have to set up the loop over DMFT
iterations and the self-consistency condition::
n_loops = 5
for iteration_number in range(n_loops) : # start the DMFT loop
SK.put_Sigma(Sigma_imp = [ S.Sigma ]) # Put self energy to the SumK class
chemical_potential = SK.calc_mu() # calculate the chemical potential for the given density
S.G_iw << SK.extract_G_loc()[0] # extract the local Green function
S.G0_iw << inverse(S.Sigma_iw + inverse(S.G_iw)) # finally get G0, the input for the Solver
S.solve(h_loc=h_loc, **p) # now solve the impurity problem
dm = S.G_iw.density() # Density matrix of the impurity problem
SK.calc_dc(dm, U_interact=U, J_hund=J, orb=0, use_dc_formula=dc_type) # Set the double counting term
SK.save(['chemical_potential','dc_imp','dc_energ']) # Save data in the hdf5 archive
These basic steps are enough to set up the basic DMFT Loop. For a detailed
description of the :class:`SumkDFT` routines, see the reference manual. After
the self-consistency steps, the solution of the Anderson impurity problem is
calculation by CTQMC. Different to model calculations, we have to do a few
more steps after this, because of the double-counting correction. We first
calculate the density of the impurity problem. Then, the routine `calc_dc`
takes as parameters this density matrix, the Coulomb interaction, Hund's rule
coupling, and the type of double-counting that should be used. Possible values
for `use_dc_formula` are:
* `0`: Full-localised limit
* `1`: DC formula as given in K. Held, Adv. Phys. 56, 829 (2007).
* `2`: Around-mean-field
At the end of the calculation, we can save the Greens function and self energy into a file::
from pytriqs.archive import HDFArchive
import pytriqs.utility.mpi as mpi
if mpi.is_master_node():
ar = HDFArchive("YourDFTDMFTcalculation.h5",'w')
ar["G"] = S.G_iw
ar["Sigma"] = S.Sigma_iw
This is it!
These are the essential steps to do a one-shot DFT+DMFT calculation.
For full charge-self consistent calculations, there are some more things
to consider, which we will see later on.
A more advanced example
=======================
-----------------------
Normally, one wants to adjust some more parameters in order to make the calculation more efficient. Here, we
will see a more advanced example, which is also suited for parallel execution.
@ -64,7 +144,7 @@ Now we can use all this information to initialise the :class:`SumkDFT` class::
SK = SumkDFT(hdf_file=dft_filename+'.h5',use_dft_blocks=use_blocks)
The next step is to initialise the Solver::
The next step is to initialise the :class:`Solver` class::
n_orb = SK.corr_shells[0]['dim']
l = SK.corr_shells[0]['l']
@ -162,6 +242,3 @@ refinement::
SK.save(['chemical_potential','dc_imp','dc_energ'])
This is all we need for the DFT+DMFT calculation. At the end, all results are stored in the hdf5 output file.

View File

@ -1,5 +1,3 @@
.. index:: tutorial on Ce within Hub.-I approximation
.. _DFTDMFTtutorial:
DFT+DMFT tutorial: Ce with Hubbard-I approximation
@ -7,7 +5,11 @@ DFT+DMFT tutorial: Ce with Hubbard-I approximation
In this tutorial we will perform DFT+DMFT :program:`Wien2k` calculations of the high-temperature :math:`\gamma`-phase of Ce employing the
Hubbard-I approximation for its localized *4f* shell.
First we create the Wien2k :file:`Ce-gamma.struct` file as described in `Wien2k manual <http://www.wien2k.at/reg_user/textbooks/usersguide.pdf>`_
Wien2k setup
------------
First we create the Wien2k :file:`Ce-gamma.struct` file as described in the `Wien2k manual <http://www.wien2k.at/reg_user/textbooks/usersguide.pdf>`_
for the :math:`\gamma`-Ce fcc structure with lattice parameter of 9.75 a.u.
.. literalinclude:: Ce-gamma.struct
@ -23,6 +25,8 @@ Hence, the initialization script is executed as follows ::
and then LDA calculations of non-magnetic :math:`\gamma`-Ce are performed by launching the :program:`Wien2k` :program:`run` script.
These self-consistent LDA calculations will typically take a couple of minutes.
DMFTPROJ
--------
Then we create :file:`Ce-gamma.indmftpr` file specifying parameters for construction of Wannier orbitals representing *4f* states:
@ -66,14 +70,10 @@ This program produces the following files:
Now we have all necessary input from :program:`Wien2k` for running DMFT calculations.
.. index:: Hubbard-I in TRIQS
DMFT setup: Hubbard-I calculations in TRIQS
--------------------------------------------
.. _HubITRIQS:
Hubbard-I calculations in TRIQS
-------------------------------
In order to run DFT+DMFT calculations within Hubbard-I we need the corresponding python script, :ref:`Ce-gamma-script`.
In order to run DFT+DMFT calculations within Hubbard-I we need the corresponding python script, :ref:`Ce-gamma_script`.
It is generally similar to the script for the case of DMFT calculations with the CT-QMC solver (see :ref:`advanced`),
however there are also some differences. First, instead of *pytriqs.applications.dft.solver_multiband* we import Hubbard-I solver ::
@ -122,13 +122,12 @@ Then the double counting is recalculated and the correlation energy is computed
Finally, we compute the modified charge density and save it as well as correlational correction to the total energy in
:file:`Ce-gamma.qdmft` file, which is then read by :program:`lapw2` in the case of self-consistent DFT+DMFT calculations.
.. index:: running DFT+DMFT calculations
Running DFT+DMFT calculations
-----------------------------
Running single-shot DFT+DMFT calculations
------------------------------------------
After having prepared the script one may run one-shot DMFT calculations by
executing :ref:`Ce-gamma-script` with :program:`pytriqs` on a single processor::
executing :ref:`Ce-gamma_script` with :program:`pytriqs` on a single processor::
pytriqs Ce-gamma.py
@ -140,6 +139,10 @@ where :program:`mpirun` launches these calculations in parallel mode and
enables MPI. The exact form of this command will, of course, depend on
mpi-launcher installed in your system.
Running self-consistent DFT+DMFT calculations
---------------------------------------------
Instead of doing one-shot run one may also perform fully self-consistent
DFT+DMFT calculations, as we will do in this tutorial. We launch these
calculations as follows ::
@ -171,8 +174,9 @@ One may also check the convergence in total energy::
:ENE : ********** TOTAL ENERGY IN Ry = -17717.56285812
:ENE : ********** TOTAL ENERGY IN Ry = -17717.56287381
Calculating DOS with Hubbard-I
------------------------------
Post-processing and data analysis
---------------------------------
Within Hubbard-I one may also easily obtain the angle-resolved spectral function (band
structure) and integrated spectral function (density of states or DOS). In
@ -180,7 +184,7 @@ difference with the CT-QMC approach one does not need to provide the
real-frequency self-energy (see :ref:`analysis`) as it can be calculated directly
in the Hubbard-I solver.
The corresponding script :ref:`Ce-gamma_DOS-script` contains several new parameters ::
The corresponding script :ref:`Ce-gamma_DOS_script` contains several new parameters ::
ommin=-4.0 # bottom of the energy range for DOS calculations
ommax=6.0 # top of the energy range for DOS calculations
@ -204,17 +208,15 @@ We may first increase the number of **k**-points in BZ to 10000 by executing :pr
x kgen
and then by executing :ref:`Ce-gamma_DOS-script` with :program:`pytriqs`::
and then by executing :ref:`Ce-gamma_DOS_script` with :program:`pytriqs`::
pytriqs Ce-gamma_DOS.py
In result we get the total DOS for spins `up` and `down` (identical in our paramagnetic case) in :file:`DOScorrup.dat` and :file:`DOScorrdown.dat` files, respectively, as well as projected DOSs written in the corresponding files as described in :ref:`analysis`.
In our case, for example, the files :file:`DOScorrup.dat` and :file:`DOScorrup_proj3.dat` contain the total DOS for spin *up* and the corresponding projected DOS for Ce *4f* orbital, respectively. They are plotted below.
.. image:: Ce_DOS.png
.. image:: images_scripts/Ce_DOS.png
:width: 700
:align: center
As one may clearly see, the Ce *4f* band is split by the local Coulomb interaction into the filled lower Hubbard band and empty upper Hubbard band (the latter is additionally split into several peaks due to the Hund's rule coupling and multiplet effects).

View File

@ -5,7 +5,7 @@ from pytriqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solve
# Creates the data directory, cd into it:
#Prepare_Run_Directory(DirectoryName = "Ce-Gamma")
dft_filename = 'Ce-gamma'
Beta = 40
beta = 40
U_int = 6.00
J_hund = 0.70
DC_type = 0 # 0...FLL, 1...Held, 2... AMF, 3...Lichtenstein
@ -63,7 +63,7 @@ N = SK.corr_shells[0]['dim']
l = SK.corr_shells[0]['l']
# Init the Solver:
S = Solver(beta = Beta, l = l)
S = Solver(beta = beta, l = l)
# set atomic levels:
eal = SK.eff_atomic_levels()[0]
@ -75,4 +75,3 @@ SK.put_Sigma(Sigma_imp = [S.Sigma])
# compute DOS
SK.dos_partial(broadening=broadening)

View File

@ -1,4 +1,4 @@
.. _Ce-gamma_DOS-script:
.. _Ce-gamma_DOS_script:
Ce-gamma_DOS.py
---------------

View File

@ -1,4 +1,4 @@
.. _Ce-gamma-script:
.. _Ce-gamma_script:
Ce-gamma.py
-----------

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -0,0 +1,19 @@
.. _orbital_construction:
Orbital construction
====================
.. warning::
TO BE UPDATED!
dmftproj
--------
The dft_tools package comes with a converter to use `Wien2k <http://www.wien2k.at>`_ band structure calculations as input for the DMFT part of the calculation, through the construction of projective Wannier functions. The first step is done by the program :program:`dmftproj`, producing text output files. In the second step, this ouput is read and converted into the hdf5 format, using the python module :class:`Wien2kConverter`.
Wannier90
---------
.. warning::
IN PROGRESS!

View File

@ -1,12 +1,8 @@
.. index:: Transport
.. _Transport:
Transport calculations
======================
.. index:: Theory
Formalism
---------
The conductivity and the Seebeck coefficient in direction :math:`\alpha\beta` are defined as [#transp]_:
@ -34,26 +30,24 @@ The frequency depended optical conductivity is given by
\sigma(\Omega) = N_{sp} \pi e^2 \hbar \int{d\omega \Gamma_{\alpha\beta}(\omega+\Omega/2,\omega-\Omega/2)\frac{f(\omega-\Omega/2)-f(\omega+\Omega/2)}{\Omega}}.
.. index:: Prerequisite
Prerequisites
-------------
First perform a standard DFT+DMFT calculation for your desired material (see :ref:`DFTDMFTmain`) and obtain the real-frequency self energy by doing an
First perform a standard :ref:`DFT+DMFT calculation <dftdmft_selfcons>` for your desired material and obtain the real-frequency self energy by doing an
analytic continuation.
.. note::
It is crucial to perform the analytic continuation in such a way that the obtained real-frequency self energy is accurate around the Fermi energy as only its
low energy structure influences the final results!
Besides the self energy the Wien2k files read by the transport converter are:
Besides the self energy the Wien2k files read by the transport converter (:meth:`convert_transport_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`) are:
* :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:`.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
window for each k-point. How to use the optics package is described below.
* :file:`.h5`: The hdf file has to be present and should contain the dft_input subgroup. Otherwise :class:`convert_dft_input` needs to be called before :class:`convert_transport_input`.
* :file:`.h5`: The hdf5 archive has to be present and should contain the dft_input subgroup. Otherwise :meth:`convert_dft_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_dft_input>` needs to be called before :meth:`convert_transport_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_transport_input>`.
.. index:: Wien2k optics package
Wien2k optics package
---------------------
@ -67,15 +61,13 @@ The basics steps to calculate the matrix elements of the momentum operator with
6) Run `x optic`.
Additionally the input file :file:`case.inop` is required. A detail description on how to setup this file can be found in the Wien2k user guide [#userguide]_ on page 166.
Here the energy window can be chosen according to the window used for :program:`dmftprj`. However, keep in mind that energies have to be specified in absolute values! Furthermore it is important
to set line 6 to ON for printing the matrix elements to the :file:`.pmat` file.
Here the energy window can be chosen according to the window used for :program:`dmftproj`. However, keep in mind that energies have to be specified in absolute values! Furthermore it is important to set line 6 to ON for printing the matrix elements to the :file:`.pmat` file.
.. index:: Using the transport code.
Using the transport code
------------------------
First we have to read the Wien2k files and store the relevant information in the hdf-file::
First we have to read the Wien2k files and store the relevant information in the hdf5 archive::
from pytriqs.applications.dft.converters.wien2k_converter import *
from pytriqs.applications.dft.sumk_dft_tools import *
@ -95,17 +87,14 @@ Additionally we need to read and set the self energy, the chemical potential and
As next step we can calculate the transport distribution :math:`\Gamma_{\alpha\beta}(\omega)`::
SK.transport_distribution(directions=['xx'], Om_mesh=[0.00, 0.02], energy_window=[-0.3,0.3],
SK.transport_distribution(directions=['xx'], Om_mesh=[0.0, 0.1], energy_window=[-0.3,0.3],
with_Sigma=True, broadening=0.0, beta=40)
The parameters are:
* `directions`: :math:`\alpha` and :math:`\beta` (e.g. xx, yy, xz, ...)
* `Om_mesh`: :math:`\Omega`-mesh for the optical conductivity. Note that the code repines this mesh to the closest values on the self energy mesh! The new mesh is stored in `Om_meshr`.
The Seebeck coefficient is only calculated if :math:`\Omega=0.0` is included.
* `energy_window`: Limits for the integration over :math:`\omega` (Due to the Fermi functions the integrand is only of considerable size in a small
window around the Fermi energy). For optical conductivity calculations the window is automatically enlarged by :math:`\Omega` .
* `with_Sigma`: If this parameter is set to False then Sigma is set to 0 (i.e. the DFT band structure :math:`A(k,\omega)` is taken).
* `broadening`: The numerical broadening should be set to a finite value for with_Sigma = False.
Here the transport distribution is calculated in :math:`xx` direction for the frequencies :math:`\Omega=0.0` and :math:`0.1`.
To use the previously obtained self energy we set with_Sigma to True and the broadening to :math:`0.0`.
As we also want to calculate the Seebeck coefficient we have to include :math:`\Omega=0.0` in the mesh.
Note that the current version of the code repines the :math:`\Omega` values to the closest values on the self energy mesh.
For complete description of the input parameters see the :meth:`transport_distribution reference <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.transport_distribution>`.
The resulting transport distribution is not automatically saved, but this can be easily achieved with::
@ -119,7 +108,6 @@ Finally the optical conductivity :math:`\sigma(\Omega)` and the Seebeck coeffici
It is strongly advised to check convergence in the number of k-points!
.. index:: References
References
----------

View File

@ -1,16 +1,20 @@
.. index:: Wien2k
.. index:: DFT Tools
.. module:: pytriqs.applications.dft
.. _wien2k:
.. _dfttools:
dft_tools
========================================================
DFT Tools
=========
This application is aimed at DMFT calculations with
realistic band structure calculations.
This application is aimed at DMFT calculations with
realistic band structure calculations.
A priori TRIQS can be connected to various realistic band structure codes.
In this release, we provide the dft_tools extension module which contains an
interface to the `Wien2k package <http://www.wien2k.at>`_.
In this release, we provide the dft_tools extension module which contains an
interface to the
* `WIEN2K package <http://www.wien2k.at>`_.
* A general Hamiltonian H(k)
* FLEUR (in progress..)
* VASP? (in progress..)
* Wannier90? (in progress..)

View File

@ -4,6 +4,8 @@
Installation
============
LINKS ARE BROKEN!
Prerequisites
-------------
@ -33,6 +35,9 @@ Installation steps
$ make test
$ make install
TO BE FIXED
===========
Installation steps for use with WIEN2K
---------------------------------------
@ -76,10 +81,9 @@ Version compatibility
---------------------
Be careful that the version of the TRIQS library and of the dft tools must be
compatible (more information on the `TRIQS website
<http://ipht.cea.fr/triqs/versions.html>`_). If you want to use a version of
the dft tools that is not the latest one, go into the directory with the sources
and look at all available versions::
compatible (more information on the :ref:`TRIQS website <triqslibs:welcome>`.
If you want to use a version of the dft tools that is not the latest one, go
into the directory with the sources and look at all available versions::
$ cd src && git tag

View File

@ -13,7 +13,7 @@ for us to solve the issue please follow these guidelines:
#. If you have a problem during the installation, give us information about
your operating system and the compiler you are using. Include the outputs of
the ``cmake`` and ``make`` commands as well as the ``CMakeCache.txt`` file
which is in the build directory. Please include these outputs in a
which is in the build directory. Please include these outputs in a
`gist <http://gist.github.com/>`_ file referenced in the issue.
#. If you are experiencing a problem during the execution of the application, provide

View File

@ -0,0 +1,5 @@
U_matrix
========
.. automodule:: pytriqs.applications.dft.U_matrix
:members:

View File

@ -0,0 +1,21 @@
Converters
==========
Wien2k Converter
----------------
.. autoclass:: pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter
:members:
:special-members:
:show-inheritance:
H(k) Converter
--------------
.. autoclass:: pytriqs.applications.dft.converters.hk_converter.HkConverter
:members:
:special-members:
Converter Tools
---------------
.. autoclass:: pytriqs.applications.dft.converters.converter_tools.ConverterTools
:members:
:special-members:

View File

@ -1,17 +1,24 @@
hdf5 structure
==============
H5 input file and Converters
============================
All the data is stored using the hdf5 standard, as described also in the
documentation of the TRIQS package itself. In order to do a DMFT calculation,
using input from DFT applications, a converter is needed on order to provide
the necessary data in the hdf5 format.
All the data is stored using the hdf5 standard, as described also in the documentation of the TRIQS package itself. In order to do a DMFT calculation, using input from DFT applications, a converter is needed on order to provide the necessary data in the hdf5 format.
groups and their formats
------------------------
In order to be used with the DMFT routines, the following data needs to be
provided in the hdf5 file. It contains a lot of information in order to perform
DMFT calculations for all kinds of situations, e.g. d-p Hamiltonians, more than
one correlated atomic shell, or using symmetry operations for the k-summation.
We store all data in subgroups of the hdf5 archive:
hdf5 data format
----------------
In order to be used with the DMFT routines, the following data needs to be provided in the hdf5 file. It contains a lot of information in order to perform DMFT calculations for all kinds of situations, e.g. d-p Hamiltonians, more than one correlated atomic shell, or using symmetry operations for the k-summation. We store all data in subgroups of the hdf5 archive:
:program:`Main data`: There needs to be one subgroup for the main data of the calculation. The default name of this group is `dft_input`. Its contents are
Main data
^^^^^^^^^
There needs to be one subgroup for the main data of the
calculation. The default name of this group is `dft_input`. Its contents are
================= ====================================================================== =====================================================================================
Name Type Meaning
@ -70,21 +77,30 @@ hopping numpy.array.complex,
================= ====================================================================== =====================================================================================
:program:`Symmetry operations`: In this subgroup we store all the data for applying the symmetry
operations in the DMFT loop (in case you want to use symmetry operations). The default name of this subgroup is `SymmCorr`. This information is needed only if symmetry operations are used to do the k summation. To be continued...
Symmetry operations
^^^^^^^^^^^^^^^^^^^
In this subgroup we store all the data for applying the symmetry operations in
the DMFT loop (in case you want to use symmetry operations). The default name
of this subgroup is `dft_symmcorr_input`. This information is needed only if symmetry
operations are used to do the k summation. To be continued...
Wien2k Converter
----------------
The dft_tools package comes with a converter to use `Wien2k <http://www.wien2k.at>`_ band structure calculations as input for the DMFT part of the calculation, through the construction of projective Wannier functions. The first step is done by the program :program:`dmftproj`, producing text output files. In the second step, this ouput is read and converted into the hdf5 format, using the python module :class:`Wien2kConverter`.
HERE COMES A LISTING OF THE FUNCTIONS.
.. warning::
TO BE COMPLETED!
General and simple H(k) Converter
---------------------------------
The above described converter of the Wien2k input is quite involved, since Wien2k provides a lot of information, e.g. about symmetry operations, that can be used in the calculation. However, sometimes we want to use a light implementation where the input consists basically only of the Hamiltonian matrix in Wannier basis, given at a grid of k points in the first Brillouin zone. For this purpose, a simple converter is included in the package, called :class:`HkConverter`, which is implemented for the simplest case of paramagnetic DFT calculations without spin-orbit coupling. It reads a simple, easy to construct text file, and produces an archive that can be used for the DMFT calculations. An example input file for a structure with one correlated site with 3 t2g orbitals in the unit cell contains the following:
The above described converter of the Wien2k input is quite involved, since
Wien2k provides a lot of information, e.g. about symmetry operations, that can
be used in the calculation. However, sometimes we want to use a light
implementation where the input consists basically only of the Hamiltonian
matrix in Wannier basis, given at a grid of k points in the first Brillouin
zone. For this purpose, a simple converter is included in the package, called
:class:`HkConverter`, which is implemented for the simplest case of
paramagnetic DFT calculations without spin-orbit coupling. It reads a simple,
easy to construct text file, and produces an archive that can be used for the
DMFT calculations. An example input file for a structure with one correlated
site with 3 t2g orbitals in the unit cell contains the following:
10 <- n_k
@ -98,19 +114,19 @@ The above described converter of the Wien2k input is quite involved, since Wien2
1 1 2 3 0 0 <- corr_shells, as above: atom, sort, l, dim, SO, dummy
2 2 3 <- n_reps, dim_reps (length 2, because eg/t2g splitting)
After this header, we give the Hamiltonian matrices for al the k-points. for each k-point we give first the matrix of the real part, then the matrix of the imaginary part. The projection matrices are set automatically to unity matrices, no rotations, no symmetry operations are used. That means that the symmetry sub group in the hdf5 archive needs not be set, since it is not used. It is furthermore assumed that all k-points have equal weight in the k-sum. Note that the input file should contain only the numbers, not the comments given in above example.
The Hamiltonian matrices can be taken, e.g., from Wannier90, which contructs the Hamiltonian in a maximally localised Wannier basis.
Note that with this simplified converter, no full charge self consistent calculations are possible!
2 2 3 <- n_reps, dim_reps (length 2, because eg/t2g splitting) for each shell
After this header, we give the Hamiltonian matrices for al the k-points. for
each k-point we give first the matrix of the real part, then the matrix of the
imaginary part. The projection matrices are set automatically to unity
matrices, no rotations, no symmetry operations are used. That means that the
symmetry sub group in the hdf5 archive needs not be set, since it is not used.
It is furthermore assumed that all k-points have equal weight in the k-sum.
Note that the input file should contain only the numbers, not the comments
given in above example.
The Hamiltonian matrices can be taken, e.g., from Wannier90, which contructs
the Hamiltonian in a maximally localised Wannier basis.
Note that with this simplified converter, no full charge self consistent
calculations are possible!

View File

@ -1,5 +0,0 @@
put_Sigma
=========
Here comes some text.

View File

@ -1,8 +1,8 @@
SumK_DFT
SumK DFT
========
.. toctree::
:maxdepth: 1
put_Sigma
.. autoclass:: pytriqs.applications.dft.sumk_dft.SumkDFT
:members:
:special-members:
:show-inheritance:

View File

@ -0,0 +1,8 @@
SumK DFT Tools
==============
.. autoclass:: pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools
:members:
:special-members:
:show-inheritance:

View File

@ -0,0 +1,6 @@
Symmetry
========
.. autoclass:: pytriqs.applications.dft.Symmetry
:members:
:special-members:

View File

@ -0,0 +1,6 @@
TransBasis
==========
.. autoclass:: pytriqs.applications.dft.trans_basis.TransBasis
:members:
:special-members:

View File

@ -5,13 +5,42 @@ import numpy as np
# The interaction matrix in desired basis
# U^{spherical}_{m1 m2 m3 m4} = \sum_{k=0}^{2l} F_k angular_matrix_element(l, k, m1, m2, m3, m4)
def U_matrix(l, radial_integrals=None, U_int=None, J_hund=None, basis="spherical", T=None):
"""Calculate U matrix being given either radial_integrals or U_int and J_hund.
l = angular momentum of shell being treated (l=2 for d shell, l=3 for f shell)
radial_integrals = [F0,F2,F4,..] (default None)
U_int, J_hund = values to use to compute radial_integrals (default None),
basis = "spherical", "cubic", or "other",
T = transformation matrix from spherical to desired basis, if basis='other' (default None)"""
def U_matrix(l, radial_integrals=None, U_int=None, J_hund=None, basis='spherical', T=None):
r"""
Calculate the full four-index U matrix being given either radial_integrals or U_int and J_hund.
Parameters
----------
l : integer
Angular momentum of shell being treated (l=2 for d shell, l=3 for f shell).
radial_integrals : list, optional
Slater integrals [F0,F2,F4,..].
Must be provided if U_int and J_hund are not given.
Preferentially used to compute the U_matrix if provided alongside U_int and J_hund.
U_int : scalar, optional
Value of the screened Hubbard interaction.
Must be provided if radial_integrals are not given.
J_hund : scalar, optional
Value of the Hund's coupling.
Must be provided if radial_integrals are not given.
basis : string, optional
The basis in which the interaction matrix should be computed.
Takes the values
- 'spherical': spherical harmonics,
- 'cubic': cubic harmonics,
- 'other': other basis type as given by the transformation matrix T.
T : real/complex numpy array, optional
Transformation matrix for basis change.
Must be provided if basis='other'.
Returns
-------
U_matrix : float numpy array
The four-index interaction matrix in the chosen basis.
"""
# Check all necessary information is present and consistent
if radial_integrals is None and (U_int is None and J_hund is None):
@ -22,7 +51,7 @@ def U_matrix(l, radial_integrals=None, U_int=None, J_hund=None, basis="spherical
if len(radial_integrals)-1 != l:
raise ValueError("U_matrix: inconsistency in l and number of radial_integrals provided.")
if (radial_integrals - U_J_to_radial_integrals(l, U_int, J_hund)).any() != 0.0:
print "Warning: U_matrix: radial_integrals provided do not match U_int and J_hund. Using radial_integrals to calculate spherical U_matrix."
print "Warning: U_matrix: radial_integrals provided do not match U_int and J_hund. Using radial_integrals to calculate U_matrix."
# Full interaction matrix
# Basis of spherical harmonics Y_{-2}, Y_{-1}, Y_{0}, Y_{1}, Y_{2}
@ -45,7 +74,22 @@ def U_matrix(l, radial_integrals=None, U_int=None, J_hund=None, basis="spherical
# Convert full 4-index U matrix to 2-index density-density form
def reduce_4index_to_2index(U_4index):
"""Reduces the four-index matrix to two-index matrices."""
r"""
Reduces the four-index matrix to two-index matrices for parallel and anti-parallel spins.
Parameters
----------
U_4index : float numpy array
The four-index interaction matrix.
Returns
-------
U : float numpy array
The two-index interaction matrix for parallel spins.
Uprime : float numpy array
The two-index interaction matrix for anti-parallel spins.
"""
size = len(U_4index) # 2l+1
U = np.zeros((size,size),dtype=float) # matrix for same spin
@ -60,7 +104,26 @@ def reduce_4index_to_2index(U_4index):
# Construct the 2-index matrices for the density-density form
def U_matrix_kanamori(n_orb, U_int, J_hund):
"""Calculate the Kanamori U and Uprime matrices."""
r"""
Calculate the Kanamori U and Uprime matrices.
Parameters
----------
n_orb : integer
Number of orbitals in basis.
U_int : scalar
Value of the screened Hubbard interaction.
J_hund : scalar
Value of the Hund's coupling.
Returns
-------
U : float numpy array
The two-index interaction matrix for parallel spins.
Uprime : float numpy array
The two-index interaction matrix for anti-parallel spins.
"""
U = np.zeros((n_orb,n_orb),dtype=float) # matrix for same spin
Uprime = np.zeros((n_orb,n_orb),dtype=float) # matrix for opposite spin
@ -77,14 +140,53 @@ def U_matrix_kanamori(n_orb, U_int, J_hund):
# Get t2g or eg components
def t2g_submatrix(U, convention=''):
"""Return only the t2g part of the full d-manifold two- or four-index U matrix."""
r"""
Extract the t2g submatrix of the full d-manifold two- or four-index U matrix.
Parameters
----------
U : float numpy array
Two- or four-index interaction matrix.
convention : string, optional
The basis convention.
Takes the values
- '': basis ordered as ("xy","yz","z^2","xz","x^2-y^2"),
- 'wien2k': basis ordered as ("z^2","x^2-y^2","xy","yz","xz").
Returns
-------
U_t2g : float numpy array
The t2g component of the interaction matrix.
"""
if convention == 'wien2k':
return subarray(U, len(U.shape)*[(2,3,4)])
else:
return subarray(U, len(U.shape)*[(0,1,3)])
def eg_submatrix(U, convention=''):
"""Return only the eg part of the full d-manifold two- or four-index U matrix."""
r"""
Extract the eg submatrix of the full d-manifold two- or four-index U matrix.
Parameters
----------
U : float numpy array
Two- or four-index interaction matrix.
convention : string, optional
The basis convention.
Takes the values
- '': basis ordered as ("xy","yz","z^2","xz","x^2-y^2"),
- 'wien2k': basis ordered as ("z^2","x^2-y^2","xy","yz","xz").
Returns
-------
U_eg : float numpy array
The eg component of the interaction matrix.
"""
if convention == 'wien2k':
return subarray(U, len(U.shape)*[(0,1)])
else:
@ -92,13 +194,48 @@ def eg_submatrix(U, convention=''):
# Transform the interaction matrix into another basis
def transform_U_matrix(U_matrix, T):
"""Transform the interaction matrix into another basis by applying matrix T."""
r"""
Transform a four-index interaction matrix into another basis.
Parameters
----------
U_matrix : float numpy array
The four-index interaction matrix in the original basis.
T : real/complex numpy array, optional
Transformation matrix for basis change.
Must be provided if basis='other'.
Returns
-------
U_matrix : float numpy array
The four-index interaction matrix in the new basis.
"""
return np.einsum("ij,kl,jlmo,mn,op",np.conj(T),np.conj(T),U_matrix,np.transpose(T),np.transpose(T))
# Rotation matrices: complex harmonics to cubic harmonics
# Complex harmonics basis: ..., Y_{-2}, Y_{-1}, Y_{0}, Y_{1}, Y_{2}, ...
def spherical_to_cubic(l, convention=''):
"""Returns the spherical harmonics to cubic harmonics rotation matrix."""
r"""
Get the spherical harmonics to cubic harmonics transformation matrix.
Parameters
----------
l : integer
Angular momentum of shell being treated (l=2 for d shell, l=3 for f shell).
convention : string, optional
The basis convention.
Takes the values
- '': basis ordered as ("xy","yz","z^2","xz","x^2-y^2"),
- 'wien2k': basis ordered as ("z^2","x^2-y^2","xy","yz","xz").
Returns
-------
T : real/complex numpy array
Transformation matrix for basis change.
"""
size = 2*l+1
T = np.zeros((size,size),dtype=complex)
if convention != 'wien2k' and l != 2:
@ -140,6 +277,21 @@ def spherical_to_cubic(l, convention=''):
# Names of cubic harmonics
def cubic_names(l):
r"""
Get the names of the cubic harmonics.
Parameters
----------
l : integer or string
Angular momentum of shell being treated.
Also takes 't2g' and 'eg' as arguments.
Returns
-------
cubic_names : tuple of strings
Names of the orbitals.
"""
if l == 0 or l == 's':
return ("s")
elif l == 1 or l == 'p':
@ -156,7 +308,24 @@ def cubic_names(l):
# Convert U,J -> radial integrals F_k
def U_J_to_radial_integrals(l, U_int, J_hund):
"""Determines the radial integrals F_k from U_int and J_hund."""
r"""
Determine the radial integrals F_k from U_int and J_hund.
Parameters
----------
l : integer
Angular momentum of shell being treated (l=2 for d shell, l=3 for f shell).
U_int : scalar
Value of the screened Hubbard interaction.
J_hund : scalar
Value of the Hund's coupling.
Returns
-------
radial_integrals : list
Slater integrals [F0,F2,F4,..].
"""
F = np.zeros((l+1),dtype=float)
if l == 2:
@ -174,7 +343,24 @@ def U_J_to_radial_integrals(l, U_int, J_hund):
# Convert radial integrals F_k -> U,J
def radial_integrals_to_U_J(l, F):
"""Determines U_int and J_hund from the radial integrals."""
r"""
Determine U_int and J_hund from the radial integrals.
Parameters
----------
l : integer
Angular momentum of shell being treated (l=2 for d shell, l=3 for f shell).
F : list
Slater integrals [F0,F2,F4,..].
Returns
-------
U_int : scalar
Value of the screened Hubbard interaction.
J_hund : scalar
Value of the Hund's coupling.
"""
if l == 2:
U_int = F[0]
@ -189,15 +375,73 @@ def radial_integrals_to_U_J(l, F):
# Angular matrix elements of particle-particle interaction
# (2l+1)^2 ((l 0) (k 0) (l 0))^2 \sum_{q=-k}^{k} (-1)^{m1+m2+q} ((l -m1) (k q) (l m3)) ((l -m2) (k -q) (l m4))
def angular_matrix_element(l, k, m1, m2, m3, m4):
result = 0
r"""
Calculate the angular matrix element
.. math::
(2l+1)^2
\begin{pmatrix}
l & k & l \\
0 & 0 & 0
\end{pmatrix}^2
\sum_{q=-k}^k (-1)^{m_1+m_2+q}
\begin{pmatrix}
l & k & l \\
-m_1 & q & m_3
\end{pmatrix}
\begin{pmatrix}
l & k & l \\
-m_2 & -q & m_4
\end{pmatrix}.
Parameters
----------
l : integer
k : integer
m1 : integer
m2 : integer
m3 : integer
m4 : integer
Returns
-------
ang_mat_ele : scalar
Angular matrix element.
"""
ang_mat_ele = 0
for q in range(-k,k+1):
result += three_j_symbol((l,-m1),(k,q),(l,m3))*three_j_symbol((l,-m2),(k,-q),(l,m4))*(-1.0 if (m1+q+m2) % 2 else 1.0)
result *= (2*l+1)**2 * (three_j_symbol((l,0),(k,0),(l,0))**2)
return result
ang_mat_ele += three_j_symbol((l,-m1),(k,q),(l,m3))*three_j_symbol((l,-m2),(k,-q),(l,m4))*(-1.0 if (m1+q+m2) % 2 else 1.0)
ang_mat_ele *= (2*l+1)**2 * (three_j_symbol((l,0),(k,0),(l,0))**2)
return ang_mat_ele
# Wigner 3-j symbols
# ((j1 m1) (j2 m2) (j3 m3))
def three_j_symbol(jm1, jm2, jm3):
r"""
Calculate the three-j symbol
.. math::
\begin{pmatrix}
l_1 & l_2 & l_3\\
m_1 & m_2 & m_3
\end{pmatrix}.
Parameters
----------
jm1 : tuple of integers
(j_1 m_1)
jm2 : tuple of integers
(j_2 m_2)
jm3 : tuple of integers
(j_3 m_3)
Returns
-------
three_j_sym : scalar
Three-j symbol.
"""
j1, m1 = jm1
j2, m2 = jm2
j3, m3 = jm3
@ -210,9 +454,9 @@ def three_j_symbol(jm1, jm2, jm3):
j3 < abs(j1-j2)):
return .0
result = -1.0 if (j1-j2-m3) % 2 else 1.0
result *= sqrt(fact(j1+j2-j3)*fact(j1-j2+j3)*fact(-j1+j2+j3)/fact(j1+j2+j3+1))
result *= sqrt(fact(j1-m1)*fact(j1+m1)*fact(j2-m2)*fact(j2+m2)*fact(j3-m3)*fact(j3+m3))
three_j_sym = -1.0 if (j1-j2-m3) % 2 else 1.0
three_j_sym *= sqrt(fact(j1+j2-j3)*fact(j1-j2+j3)*fact(-j1+j2+j3)/fact(j1+j2+j3+1))
three_j_sym *= sqrt(fact(j1-m1)*fact(j1+m1)*fact(j2-m2)*fact(j2+m2)*fact(j3-m3)*fact(j3+m3))
t_min = max(j2-j3-m1,j1-j3+m2,0)
t_max = min(j1-m1,j2+m2,j1+j2-j3)
@ -221,12 +465,37 @@ def three_j_symbol(jm1, jm2, jm3):
for t in range(t_min,t_max+1):
t_sum += (-1.0 if t % 2 else 1.0)/(fact(t)*fact(j3-j2+m1+t)*fact(j3-j1-m2+t)*fact(j1+j2-j3-t)*fact(j1-m1-t)*fact(j2+m2-t))
result *= t_sum
return result
three_j_sym *= t_sum
return three_j_sym
# Clebsch-Gordan coefficients
# < j1 m1 j2 m2 | j3 m3 > = (-1)^{j1-j2+m3} \sqrt{2j3+1} ((j1 m1) (j2 m2) (j3 -m3))
def clebsch_gordan(jm1, jm2, jm3):
r"""
Calculate the Clebsh-Gordan coefficient
.. math::
\langle j_1 m_1 j_2 m_2 | j_3 m_3 \rangle = (-1)^{j_1-j_2+m_3} \sqrt{2 j_3 + 1}
\begin{pmatrix}
j_1 & j_2 & j_3\\
m_1 & m_2 & -m_3
\end{pmatrix}.
Parameters
----------
jm1 : tuple of integers
(j_1 m_1)
jm2 : tuple of integers
(j_2 m_2)
jm3 : tuple of integers
(j_3 m_3)
Returns
-------
cgcoeff : scalar
Clebsh-Gordan coefficient.
"""
norm = sqrt(2*jm3[0]+1)*(-1 if jm1[0]-jm2[0]+jm3[1] % 2 else 1)
return norm*three_j_symbol(jm1,jm2,(jm3[0],-jm3[1]))
@ -236,6 +505,28 @@ def clebsch_gordan(jm1, jm2, jm3):
# columns 2 and 3 for 2nd dim,
# columns 0,1,2 and 3 for 3rd dim.
def subarray(a,idxlist,n=None) :
r"""
Extract a subarray from a matrix-like object.
Parameters
----------
a : matrix or array
idxlist : list of tuples
Columns that need to be extracted for each dimension.
Returns
-------
subarray : matrix or array
Examples
--------
idxlist = [(0),(2,3),(0,1,2,3)] gives
- column 0 for 1st dim,
- columns 2 and 3 for 2nd dim,
- columns 0, 1, 2 and 3 for 3rd dim.
"""
if n is None: n = len(a.shape)-1
sa = a[tuple(slice(x) for x in a.shape[:n]) + (idxlist[n],)]
return subarray(sa,idxlist, n-1) if n > 0 else sa

View File

@ -25,7 +25,22 @@ import pytriqs.utility.mpi as mpi
class ConverterTools:
def read_fortran_file(self,filename,to_replace):
""" Returns a generator that yields all numbers in the Fortran file as float, one by one"""
"""
Returns a generator that yields all numbers in the Fortran file as float, with possible replacements.
Parameters
----------
filename : string
Name of Fortran-produced file.
to_replace : dict of str:str
Dictionary defining old_char:new_char.
Yields
------
string
The next number in file.
"""
import os.path
import string
if not(os.path.exists(filename)) : raise IOError, "File %s does not exist."%filename
@ -35,9 +50,15 @@ class ConverterTools:
def repack(self):
"""Calls the h5repack routine, in order to reduce the file size of the hdf5 archive.
Should only be used BEFORE the first invokation of HDFArchive in the program, otherwise
the hdf5 linking is broken!!!"""
"""
Calls the h5repack routine in order to reduce the file size of the hdf5 archive.
Note
----
Should only be used before the first invokation of HDFArchive in the program,
otherwise the hdf5 linking will be broken.
"""
import subprocess
@ -53,12 +74,29 @@ class ConverterTools:
def det_shell_equivalence(self,corr_shells):
"""
The number of inequivalent shells is determined from corr_shells, and a mapping is given as
corr_to_inequiv(i_corr_shells) = i_inequiv_shells
inequiv_to_corr(i_inequiv_shells) = i_corr_shells
in order to put the self energies to all equivalent shells, and for extracting Gloc
"""
Determine the equivalence of correlated shells.
Parameters
----------
corr_shells : list of dicts
See documentation of necessary hdf5 elements.
Returns
-------
n_inequiv_shells : integer
Number of inequivalent shells.
corr_to_inequiv : list
Mapping between correlated shell index and inequivalent shell index.
corr_to_inequiv(i_corr_shells) = i_inequiv_shells
inequiv_to_corr : list
Mapping between inequivalent shell index and correlated shell index.
inequiv_to_corr(i_inequiv_shells) = i_corr_shells
Note
----
This is needed to set the self energies of all equivalent shells and to extract G_loc.
"""
corr_to_inequiv = [0 for i in range(len(corr_shells))]
inequiv_to_corr = [0]
n_inequiv_shells = 1

View File

@ -32,14 +32,30 @@ class HkConverter(ConverterTools):
Conversion from general H(k) file to an hdf5 file that can be used as input for the SumKDFT class.
"""
def __init__(self, hk_filename, hdf_filename, dft_subgrp = 'dft_input', symmcorr_subgrp = 'dft_symmcorr_input', repacking = False):
def __init__(self, filename, hdf_filename = None, dft_subgrp = 'dft_input', symmcorr_subgrp = 'dft_symmcorr_input', repacking = False):
"""
Init of the class.
Initialise the class.
Parameters
----------
filename : string
Name of file containing the H(k) and other relevant data.
hdf_filename : string, optional
Name of hdf5 archive to be created.
dft_subgrp : string, optional
Name of subgroup storing necessary DFT data.
symmcorr_subgrp : string, optional
Name of subgroup storing correlated-shell symmetry data.
The group is actually empty; it is just included for compatibility.
repacking : boolean, optional
Does the hdf5 archive need to be repacked to save space?
"""
assert type(hk_filename)==StringType,"HkConverter: hk_filename must be a filename."
assert type(filename)==StringType,"HkConverter: filename must be a filename."
if hdf_filename is None: hdf_filename = filename+'.h5'
self.hdf_file = hdf_filename
self.dft_file = hk_filename
self.dft_file = filename
self.dft_subgrp = dft_subgrp
self.symmcorr_subgrp = symmcorr_subgrp
self.fortran_to_replace = {'D':'E', '(':' ', ')':' ', ',':' '}
@ -52,7 +68,17 @@ class HkConverter(ConverterTools):
def convert_dft_input(self, first_real_part_matrix = True, only_upper_triangle = False, weights_in_file = False):
"""
Reads the input files, and stores the data in the HDFfile
Reads the appropriate files and stores the data for the dft_subgrp in the hdf5 archive.
Parameters
----------
first_real_part_matrix : boolean, optional
Should all the real components for given k be read in first, followed by the imaginary parts?
only_upper_triangle : boolean, optional
Should only the upper triangular part of H(k) be read in?
weights_in_file : boolean, optional
Are the k-point weights to be read in?
"""
# Read and write only on the master node

View File

@ -37,10 +37,34 @@ class Wien2kConverter(ConverterTools):
bands_subgrp = 'dft_bands_input', misc_subgrp = 'dft_misc_input',
transp_subgrp = 'dft_transp_input', repacking = False):
"""
Init of the class. Variable filename gives the root of all filenames, e.g. case.ctqmcout, case.h5, and so on.
Initialise the class.
Parameters
----------
filename : string
Base name of DFT files.
hdf_filename : string, optional
Name of hdf5 archive to be created.
dft_subgrp : string, optional
Name of subgroup storing necessary DFT data.
symmcorr_subgrp : string, optional
Name of subgroup storing correlated-shell symmetry data.
parproj_subgrp : string, optional
Name of subgroup storing partial projector data.
symmpar_subgrp : string, optional
Name of subgroup storing partial-projector symmetry data.
bands_subgrp : string, optional
Name of subgroup storing band data.
misc_subgrp : string, optional
Name of subgroup storing miscellaneous DFT data.
transp_subgrp : string, optional
Name of subgroup storing transport data.
repacking : boolean, optional
Does the hdf5 archive need to be repacked to save space?
"""
assert type(filename)==StringType, "Please provide the DFT files' base name as a string."
assert type(filename)==StringType, "Wien2kConverter: Please provide the DFT files' base name as a string."
if hdf_filename is None: hdf_filename = filename+'.h5'
self.hdf_file = hdf_filename
self.dft_file = filename+'.ctqmcout'
@ -68,7 +92,14 @@ class Wien2kConverter(ConverterTools):
def convert_dft_input(self):
"""
Reads the input files, and stores the data in the HDFfile
Reads the appropriate files and stores the data for the
- dft_subgrp
- symmcorr_subgrp
- misc_subgrp
in the hdf5 archive.
"""
# Read and write only on the master node
@ -210,14 +241,18 @@ class Wien2kConverter(ConverterTools):
# Symmetries are used, so now convert symmetry information for *correlated* orbitals:
self.convert_symmetry_input(orbits=self.corr_shells,symm_file=self.symmcorr_file,symm_subgrp=self.symmcorr_subgrp,SO=self.SO,SP=self.SP)
self.convert_misc_input(bandwin_file=self.bandwin_file,struct_file=self.struct_file,outputs_file=self.outputs_file,
misc_subgrp=self.misc_subgrp,SO=self.SO,SP=self.SP,n_k=self.n_k)
self.convert_misc_input()
def convert_parproj_input(self):
"""
Reads the input for the partial charges projectors from case.parproj, and stores it in the symmpar_subgrp
group in the HDF5.
Reads the appropriate files and stores the data for the
- parproj_subgrp
- symmpar_subgrp
in the hdf5 archive.
"""
if not (mpi.is_master_node()): return
@ -292,12 +327,12 @@ class Wien2kConverter(ConverterTools):
def convert_bands_input(self):
"""
Converts the input for momentum resolved spectral functions, and stores it in bands_subgrp in the
HDF5.
Reads the appropriate files and stores the data for the bands_subgrp in the hdf5 archive.
"""
if not (mpi.is_master_node()): return
mpi.report("Reading bands input from %s..."%self.band_file)
mpi.report("Reading input from %s..."%self.band_file)
R = ConverterTools.read_fortran_file(self,self.band_file,self.fortran_to_replace)
try:
@ -372,14 +407,29 @@ class Wien2kConverter(ConverterTools):
del ar
def convert_misc_input(self, bandwin_file, struct_file, outputs_file, misc_subgrp, SO, SP, n_k):
def convert_misc_input(self):
"""
Reads input for the band window from bandwin_file, which is case.oubwin,
structure from struct_file, which is case.struct,
symmetries from outputs_file, which is case.outputs.
Reads additional information on:
- the band window from :file:`case.oubwin`,
- lattice parameters from :file:`case.struct`,
- symmetries from :file:`case.outputs`,
if those Wien2k files are present and stores the data in the hdf5 archive.
This function is automatically called by :meth:`convert_dft_input <pytriqs.applications.dft.converters.wien2k_converter.Wien2kConverter.convert_dft_input>`.
"""
if not (mpi.is_master_node()): return
# Check if SP, SO and n_k are already in h5
ar = HDFArchive(self.hdf_file, 'a')
if not (self.dft_subgrp in ar): raise IOError, "convert_misc_input: No %s subgroup in hdf file found! Call convert_dft_input first." %self.dft_subgrp
SP = ar[self.dft_subgrp]['SP']
SO = ar[self.dft_subgrp]['SO']
n_k = ar[self.dft_subgrp]['n_k']
del ar
things_to_save = []
# Read relevant data from .oubwin/up/dn files
@ -392,7 +442,7 @@ class Wien2kConverter(ConverterTools):
elif SP == 1:
files = [self.bandwin_file+'up', self.bandwin_file+'dn']
else: # SO and SP can't both be 1
assert 0, "convert_transport_input: Reding oubwin error! Check SP and SO!"
assert 0, "convert_misc_input: Reding oubwin error! Check SP and SO!"
band_window = [numpy.zeros((n_k, 2), dtype=int) for isp in range(SP + 1 - SO)]
for isp, f in enumerate(files):
@ -463,21 +513,26 @@ class Wien2kConverter(ConverterTools):
# Save it to the HDF:
ar=HDFArchive(self.hdf_file,'a')
if not (misc_subgrp in ar): ar.create_group(misc_subgrp)
for it in things_to_save: ar[misc_subgrp][it] = locals()[it]
if not (self.misc_subgrp in ar): ar.create_group(self.misc_subgrp)
for it in things_to_save: ar[self.misc_subgrp][it] = locals()[it]
del ar
def convert_transport_input(self):
"""
Reads the input files necessary for transport calculations
and stores the data in the HDFfile
Reads the necessary information for transport calculations on:
- the optical band window and the velocity matrix elements from :file:`case.pmat`
and stores the data in the hdf5 archive.
"""
if not (mpi.is_master_node()): return
# Check if SP, SO and n_k are already in h5
ar = HDFArchive(self.hdf_file, 'a')
if not (self.dft_subgrp in ar): raise IOError, "convert_transport_input: No %s subgroup in hdf file found! Call convert_dmft_input first." %self.dft_subgrp
if not (self.dft_subgrp in ar): raise IOError, "convert_transport_input: No %s subgroup in hdf file found! Call convert_dft_input first." %self.dft_subgrp
SP = ar[self.dft_subgrp]['SP']
SO = ar[self.dft_subgrp]['SO']
n_k = ar[self.dft_subgrp]['n_k']
@ -535,7 +590,23 @@ class Wien2kConverter(ConverterTools):
def convert_symmetry_input(self, orbits, symm_file, symm_subgrp, SO, SP):
"""
Reads input for the symmetrisations from symm_file, which is case.sympar or case.symqmc.
Reads and stores symmetrisation data from symm_file, which can be is case.sympar or case.symqmc.
Parameters
----------
orbits : list of dicts
This is either shells or corr_shells depending on whether the symmetry
information is for correlated shells or partial projectors.
symm_file : string
Name of the file containing symmetry data.
This is case.symqmc for correlated shells and case.sympar for partial projectors.
symm_subgrp : string, optional
Name of subgroup storing symmetry data.
SO : integer
Is spin-orbit coupling considered?
SP : integer
Is the system spin-polarised?
"""
if not (mpi.is_master_node()): return

View File

@ -36,12 +36,43 @@ class SumkDFT:
dft_data = 'dft_input', symmcorr_data = 'dft_symmcorr_input', parproj_data = 'dft_parproj_input',
symmpar_data = 'dft_symmpar_input', bands_data = 'dft_bands_input', transp_data = 'dft_transp_input',
misc_data = 'dft_misc_input'):
"""
Initialises the class from data previously stored into an HDF5
r"""
Initialises the class from data previously stored into an hdf5 archive.
Parameters
----------
hdf_file : string
Name of hdf5 containing the data.
h_field : scalar, optional
The value of magnetic field to add to the DFT Hamiltonian.
The contribution -h_field*sigma is added to diagonal elements of the Hamiltonian.
It cannot be used with the spin-orbit coupling on; namely h_field is set to 0 if self.SO=True.
use_dft_blocks : boolean, optional
If True, the local Green's function matrix for each spin is divided into smaller blocks
with the block structure determined from the DFT density matrix of the corresponding correlated shell.
dft_data : string, optional
Name of hdf5 subgroup in which DFT data for projector and lattice Green's function construction are stored.
symmcorr_data : string, optional
Name of hdf5 subgroup in which DFT data on symmetries of correlated shells
(symmetry operations, permutaion matrices etc.) are stored.
parproj_data : string, optional
Name of hdf5 subgroup in which DFT data on non-normalized projectors for non-correlated
states (used in the partial density of states calculations) are stored.
symmpar_data : string, optional
Name of hdf5 subgroup in which DFT data on symmetries of the non-normalized projectors
are stored.
bands_data : string, optional
Name of hdf5 subgroup in which DFT data necessary for band-structure/k-resolved spectral
function calculations (projectors, DFT Hamiltonian for a chosen path in the Brillouin zone etc.)
are stored.
transp_data : string, optional
Name of hdf5 subgroup in which DFT data necessary for transport calculations are stored.
misc_data : string, optional
Name of hdf5 subgroup in which miscellaneous DFT data are stored.
"""
if not type(hdf_file) == StringType:
mpi.report("Give a string for the HDF5 filename to read the input!")
mpi.report("Give a string for the hdf5 filename to read the input!")
else:
self.hdf_file = hdf_file
self.dft_data = dft_data
@ -99,14 +130,28 @@ class SumkDFT:
# Analyse the block structure and determine the smallest gf_struct blocks and maps, if desired
if use_dft_blocks: self.analyse_block_structure()
################
# HDF5 FUNCTIONS
# hdf5 FUNCTIONS
################
def read_input_from_hdf(self, subgrp, things_to_read):
"""
Reads data from the HDF file
r"""
Reads data from the HDF file. Prints a warning if a requested dataset is not found.
Parameters
----------
subgrp : string
Name of hdf5 file subgroup from which the data are to be read.
things_to_read : list of strings
List of datasets to be read from the hdf5 file.
Returns
-------
subgroup_present : boolean
Is the subgrp is present in hdf5 file?
value_read : boolean
Did the reading of requested datasets succeed?
"""
value_read = True
@ -126,7 +171,7 @@ class SumkDFT:
mpi.report("Loading %s failed!"%it)
value_read = False
else:
if (len(things_to_read) != 0): mpi.report("Loading failed: No %s subgroup in HDF5!"%subgrp)
if (len(things_to_read) != 0): mpi.report("Loading failed: No %s subgroup in hdf5!"%subgrp)
subgroup_present = False
value_read = False
del ar
@ -139,7 +184,17 @@ class SumkDFT:
def save(self, things_to_save, subgrp='user_data'):
"""Saves given quantities into the subgroup ('user_data' by default) of the HDF5 archive"""
r"""
Saves data from a list into the HDF file. Prints a warning if a requested data is not found in SumkDFT object.
Parameters
----------
things_to_save : list of strings
List of datasets to be saved into the hdf5 file.
subgrp : string, optional
Name of hdf5 file subgroup in which the data are to be stored.
"""
if not (mpi.is_master_node()): return # do nothing on nodes
ar = HDFArchive(self.hdf_file,'a')
@ -153,7 +208,21 @@ class SumkDFT:
def load(self, things_to_load, subgrp='user_data'):
"""Loads given quantities from the subgroup ('user_data' by default) of the HDF5 archive"""
r"""
Loads user data from the HDF file. Raises an exeption if a requested dataset is not found.
Parameters
----------
things_to_read : list of strings
List of datasets to be read from the hdf5 file.
subgrp : string, optional
Name of hdf5 file subgroup from which the data are to be read.
Returns
-------
list_to_return : list
A list containing data read from hdf5.
"""
if not (mpi.is_master_node()): return # do nothing on nodes
ar = HDFArchive(self.hdf_file,'a')
@ -172,7 +241,38 @@ class SumkDFT:
################
def downfold(self,ik,ish,bname,gf_to_downfold,gf_inp,shells='corr',ir=None):
"""Downfolding a block of the Greens function"""
r"""
Downfolds a block of the Green's function for a given shell and k-point using the corresponding projector matrices.
Parameters
----------
ik : integer
k-point index for which the downfolding is to be done.
ish : integer
Shell index of GF to be downfolded.
- if shells='corr': ish labels all correlated shells (equivalent or not)
- if shells='all': ish labels only representative (inequivalent) non-correlated shells
bname : string
Block name of the target block of the lattice Green's function.
gf_to_downfold : Gf
Block of the Green's function that is to be downfolded.
gf_inp : Gf
FIXME
shells : string, optional
- if shells='corr': orthonormalized projectors for correlated shells are used for the downfolding.
- if shells='all': non-normalized projectors for all included shells are used for the downfolding.
ir : integer, optional
Index of equivalent site in the non-correlated shell 'ish', only used if shells='all'.
Returns
-------
gf_downfolded : Gf
Downfolded block of the lattice Green's function.
"""
gf_downfolded = gf_inp.copy()
isp = self.spin_names_to_ind[self.SO][bname] # get spin index for proj. matrices
@ -191,7 +291,38 @@ class SumkDFT:
def upfold(self,ik,ish,bname,gf_to_upfold,gf_inp,shells='corr',ir=None):
"""Upfolding a block of the Greens function"""
r"""
Upfolds a block of the Green's function for a given shell and k-point using the corresponding projector matrices.
Parameters
----------
ik : integer
k-point index for which the upfolding is to be done.
ish : integer
Shell index of GF to be upfolded.
- if shells='corr': ish labels all correlated shells (equivalent or not)
- if shells='all': ish labels only representative (inequivalent) non-correlated shells
bname : string
Block name of the target block of the lattice Green's function.
gf_to_upfold : Gf
Block of the Green's function that is to be upfolded.
gf_inp : Gf
FIXME
shells : string, optional
- if shells='corr': orthonormalized projectors for correlated shells are used for the upfolding.
- if shells='all': non-normalized projectors for all included shells are used for the upfolding.
ir : integer, optional
Index of equivalent site in the non-correlated shell 'ish', only used if shells='all'.
Returns
-------
gf_upfolded : Gf
Upfolded block of the lattice Green's function.
"""
gf_upfolded = gf_inp.copy()
isp = self.spin_names_to_ind[self.SO][bname] # get spin index for proj. matrices
@ -210,8 +341,35 @@ class SumkDFT:
def rotloc(self,ish,gf_to_rotate,direction,shells='corr'):
"""Local <-> Global rotation of a GF block.
direction: 'toLocal' / 'toGlobal' """
r"""
Rotates a block of the local Green's function from the local frame to the global frame and vice versa.
Parameters
----------
ish : integer
Shell index of GF to be upfolded.
- if shells='corr': ish labels all correlated shells (equivalent or not)
- if shells='all': ish labels only representative (inequivalent) non-correlated shells
gf_to_rotate : Gf
Block of the Green's function that is to be rotated.
direction : string
The direction of rotation can be either
- 'toLocal' : global -> local transformation,
- 'toGlobal' : local -> global transformation.
shells : string, optional
- if shells='corr': the rotation matrix for the correlated shell 'ish' is used,
- if shells='all': the rotation matrix for the generic (non-correlated) shell 'ish' is used.
Returns
-------
gf_rotated : Gf
Rotated block of the local Green's function.
"""
assert ((direction == 'toLocal') or (direction == 'toGlobal')),"rotloc: Give direction 'toLocal' or 'toGlobal'."
gf_rotated = gf_to_rotate.copy()
@ -242,9 +400,42 @@ class SumkDFT:
def lattice_gf(self, ik, mu=None, iw_or_w="iw", beta=40, broadening=None, mesh=None, with_Sigma=True, with_dc=True):
"""Calculates the lattice Green function from the DFT hopping and the self energy at k-point number ik
and chemical potential mu."""
r"""
Calculates the lattice Green function for a given k-point from the DFT Hamiltonian and the self energy.
Parameters
----------
ik : integer
k-point index.
mu : real, optional
Chemical potential for which the Green's function is to be calculated.
If not provided, self.chemical_potential is used for mu.
iw_or_w : string, optional
- `iw_or_w` = 'iw' for a imaginary-frequency self-energy
- `iw_or_w` = 'w' for a real-frequency self-energy
beta : real, optional
Inverse temperature.
broadening : real, optional
Imaginary shift for the axis along which the real-axis GF is calculated.
If not provided, broadening will be set to double of the distance between mesh points in 'mesh'.
mesh : list, optional
Data defining mesh on which the real-axis GF will be calculated, given in the form
(om_min,om_max,n_points), where om_min is the minimum omega, om_max is the maximum omega and n_points is the number of points.
with_Sigma : boolean, optional
If True the GF will be calculated with the self-energy stored in self.Sigmaimp_(w/iw), for real/Matsubara GF, respectively.
In this case the mesh is taken from the self.Sigma_imp object.
If with_Sigma=True but self.Sigmaimp_(w/iw) is not present, with_Sigma is reset to False.
with_dc : boolean, optional
if True and with_Sigma=True, the dc correction is substracted from the self-energy before it is included into GF.
Returns
-------
G_latt : BlockGf
Lattice Green's function.
"""
if mu is None: mu = self.chemical_potential
ntoi = self.spin_names_to_ind[self.SO]
spn = self.spin_block_names[self.SO]
@ -319,7 +510,16 @@ class SumkDFT:
def put_Sigma(self, Sigma_imp):
"""Sets the impurity self energies for inequivalent atoms into the class, respects the multiplicity of the atoms."""
r"""
Inserts the impurity self-energies into the sumk_dft class.
Parameters
----------
Sigma_imp : list of BlockGf (Green's function) objects
List containing impurity self-energy for all inequivalent correlated shells.
Self-energies for equivalent shells are then automatically set by this function.
The self-energies can be of the real or imaginary-frequency type.
"""
assert isinstance(Sigma_imp,list), "put_Sigma: Sigma_imp has to be a list of Sigmas for the correlated shells, even if it is of length 1!"
assert len(Sigma_imp) == self.n_inequiv_shells, "put_Sigma: give exactly one Sigma for each inequivalent corr. shell!"
@ -357,10 +557,24 @@ class SumkDFT:
def extract_G_loc(self, mu=None, with_Sigma=True, with_dc=True):
"""
Extracts the local downfolded Green function at the chemical potential of the class.
At the end, the local G is rotated from the global coordinate system to the local system.
if with_Sigma = False: Sigma is not included => non-interacting local GF
r"""
Extracts the local downfolded Green function by the Brillouin-zone integration of the lattice Green's function.
Parameters
----------
mu : real, optional
Input chemical potential. If not provided the value of self.chemical_potential is used as mu.
with_Sigma : boolean, optional
If True then the local GF is calculated with the self-energy self.Sigma_imp.
with_dc : boolean, optional
If True then the double-counting correction is subtracted from the self-energy in calculating the GF.
Returns
-------
G_loc_inequiv : list of BlockGf (Green's function) objects
List of the local Green's functions for all inequivalent correlated shells,
rotated into the corresponding local frames.
"""
if mu is None: mu = self.chemical_potential
@ -409,7 +623,24 @@ class SumkDFT:
def analyse_block_structure(self, threshold = 0.00001, include_shells = None, dm = None):
""" Determines the Green's function block structure from simple point integration."""
r"""
Determines the block structure of local Green's functions by analysing the structure of
the corresponding density matrices. The resulting block structures for correlated shells
are stored in self.gf_struct_solver list.
Parameters
----------
threshold : real, optional
If the difference between density matrix elements is below threshold,
they are considered to be equal.
include_shells : list of integers, optional
List of correlated shells to be analysed.
If include_shells is not provided all correlated shells will be analysed.
dm : list of dict, optional
List of density matrices from which block stuctures are to be analysed.
Each density matrix is a dict {block names: 2d numpy arrays}.
If not provided, dm will be calculated from the DFT Hamiltonian by a simple-point BZ integration.
"""
self.gf_struct_solver = [ {} for ish in range(self.n_inequiv_shells) ]
self.sumk_to_solver = [ {} for ish in range(self.n_inequiv_shells) ]
@ -493,11 +724,24 @@ class SumkDFT:
def density_matrix(self, method = 'using_gf', beta = 40.0):
"""Calculate density matrices in one of two ways:
if 'using_gf': First get lattice gf (g_loc is not set up), then density matrix.
It is useful for Hubbard I, and very quick.
No assumption on the hopping structure is made (ie diagonal or not).
if 'using_point_integration': Only works for diagonal hopping matrix (true in wien2k).
"""Calculate density matrices in one of two ways.
Parameters
----------
method : string, optional
- if 'using_gf': First get lattice gf (g_loc is not set up), then density matrix.
It is useful for Hubbard I, and very quick.
No assumption on the hopping structure is made (ie diagonal or not).
- if 'using_point_integration': Only works for diagonal hopping matrix (true in wien2k).
beta : float, optional
Inverse temperature.
Returns
-------
dens_mat : list of dicts
Density matrix for each spin in each correlated shell.
"""
dens_mat = [ {} for icrsh in range(self.n_corr_shells)]
for icrsh in range(self.n_corr_shells):
@ -569,7 +813,28 @@ class SumkDFT:
# For simple dft input, get crystal field splittings.
def eff_atomic_levels(self):
"""Calculates the effective atomic levels needed as input for the Hubbard I Solver."""
r"""
Calculates the effective local Hamiltonian required as an input for
the Hubbard I Solver.
The local Hamiltonian (effective atomic levels) is calculated by
projecting the on-site Bloch Hamiltonian:
.. math:: H^{loc}_{m m'} = \sum_{k} P_{m \nu}(k) H_{\nu\nu'}(k) P^{*}_{\nu' m'}(k),
where
.. math:: H_{\nu\nu'}(k) = [\epsilon_{\nu k} - h_{z} \sigma_{z}] \delta_{\nu\nu'}.
Parameters
----------
None
Returns
-------
eff_atlevels : gf_struct_solver like
Effective local Hamiltonian :math:`H^{loc}_{m m'}` for each correlated shell.
"""
# define matrices for inequivalent shells:
eff_atlevels = [ {} for ish in range(self.n_inequiv_shells) ]
@ -617,8 +882,14 @@ class SumkDFT:
def init_dc(self):
""" Initialise the double counting terms to have the correct shape."""
r"""
Initializes the double counting terms.
Parameters
----------
None
"""
self.dc_imp = [ {} for icrsh in range(self.n_corr_shells)]
for icrsh in range(self.n_corr_shells):
dim = self.corr_shells[icrsh]['dim']
@ -628,20 +899,61 @@ class SumkDFT:
def set_dc(self,dc_imp,dc_energ):
"""Sets double counting terms dc_imp and dc_energ to known values."""
r"""
Sets double counting corrections to given values.
Parameters
----------
dc_imp : gf_struct_sumk like
Double-counting self-energy term.
dc_energ : list of floats
Double-counting energy corrections for each correlated shell.
"""
self.dc_imp = dc_imp
self.dc_energ = dc_energ
def calc_dc(self,dens_mat,orb=0,U_interact=None,J_hund=None,use_dc_formula=0,use_dc_value=None):
"""Sets the double counting corrections in the correct form for inequiv orbital orb:
1) either using U_interact, J_hund and
use_dc_formula = 0: fully-localised limit (FLL),
use_dc_formula = 1: Held's formula,
use_dc_formula = 2: around mean-field (AMF).
2) or using a given dc value in use_dc_value.
Be sure that you are using the correct interaction Hamiltonian!"""
r"""
Calculates and sets the double counting corrections.
If 'use_dc_value' is provided the double-counting term is uniformly initialized
with this constant and 'U_interact' and 'J_hund' are ignored.
If 'use_dc_value' is None the correction is evaluated according to
one of the following formulae:
* use_dc_formula = 0: fully-localised limit (FLL)
* use_dc_formula = 1: Held's formula, i.e. mean-field formula for the Kanamori
type of the interaction Hamiltonian
* use_dc_formula = 2: around mean-field (AMF)
Note that FLL and AMF formulae were derived assuming a full Slater-type interaction
term and should be thus used accordingly. For the Kanamori-type interaction
one should use formula 1.
The double-counting self-energy term is stored in `self.dc_imp` and the energy
correction in `self.dc_energ`.
Parameters
----------
dens_mat : gf_struct_solver like
Density matrix for the specified correlated shell.
orb : int, optional
Index of an inequivalent shell.
U_interact : float, optional
Value of interaction parameter `U`.
J_hund : float, optional
Value of interaction parameter `J`.
use_dc_formula : int, optional
Type of double-counting correction (see description).
use_dc_value : float, optional
Value of the double-counting correction. If specified
`U_interact`, `J_hund` and `use_dc_formula` are ignored.
"""
for icrsh in range(self.n_corr_shells):
@ -704,7 +1016,22 @@ class SumkDFT:
def add_dc(self,iw_or_w="iw"):
"""Substracts the double counting term from the impurity self energy."""
r"""
Subtracts the double counting term from the impurity self energy.
Parameters
----------
iw_or_w : string, optional
- `iw_or_w` = 'iw' for a imaginary-frequency self-energy
- `iw_or_w` = 'w' for a real-frequency self-energy
Returns
-------
sigma_minus_dc : gf_struct_sumk like
Self-energy with a subtracted double-counting term.
"""
# Be careful: Sigma_imp is already in the global coordinate system!!
sigma_minus_dc = [s.copy() for s in getattr(self,"Sigma_imp_"+iw_or_w)]
@ -718,7 +1045,21 @@ class SumkDFT:
def symm_deg_gf(self,gf_to_symm,orb):
"""Symmetrises a GF for the given degenerate shells self.deg_shells"""
r"""
Averages a GF over degenerate shells.
Degenerate shells of an inequivalent correlated shell are defined by
`self.deg_shells`. This function enforces corresponding degeneracies
in the input GF.
Parameters
----------
gf_to_symm : gf_struct_solver like
Input GF.
orb : int
Index of an inequivalent shell.
"""
for degsh in self.deg_shells[orb]:
ss = gf_to_symm[degsh[0]].copy()
@ -729,14 +1070,41 @@ class SumkDFT:
def total_density(self, mu=None, with_Sigma=True, with_dc=True):
"""
Calculates the total charge for the energy window for a given chemical potential mu.
r"""
Calculates the total charge within the energy window for a given chemical potential.
The chemical potential is either given by parameter `mu` or, if it is not specified,
taken from `self.chemical_potential`.
The total charge is calculated from the trace of the GF in the Bloch basis.
By deafult, a full interacting GF is used. To use the non-interacting GF, set
parameter `with_Sigma = False`.
The number of bands within the energy windows generally depends on `k`. The trace is
therefore calculated separately for each `k`-point.
Since in general n_orbitals depends on k, the calculation is done in the following order:
G_aa'(k,iw) -> n(k) = Tr G_aa'(k,iw) -> sum_k n_k
..math:: n_{tot} = \sum_{k} n(k),
with
..math:: n(k) = Tr G_{\nu\nu'}(k, i\omega_{n}).
The calculation is done in the global coordinate system, if distinction is made between local/global.
Parameters
----------
mu : float, optional
Input chemical potential. If not specified, `self.chemical_potential` is used instead.
with_Sigma : boolean, optional
If `True` the full interacing GF is evaluated, otherwise the self-energy is not
included and the charge would correspond to a non-interacting system.
with_dc : boolean, optional
Whether or not to subtract the double-counting term from the self-energy.
Returns
-------
dens : float
Total charge :math:`n_{tot}`.
The calculation is done in the global coordinate system, if distinction is made between local/global!
"""
if mu is None: mu = self.chemical_potential
dens = 0.0
ikarray = numpy.array(range(self.n_k))
@ -751,18 +1119,36 @@ class SumkDFT:
def set_mu(self,mu):
"""Sets a new chemical potential"""
r"""
Sets a new chemical potential.
Parameters
----------
mu : float
New value of the chemical potential.
"""
self.chemical_potential = mu
def calc_mu(self, precision = 0.01):
"""
Searches for mu in order to give the desired charge
A desired precision can be specified in precision.
"""
def calc_mu(self, precision=0.01):
r"""
Searches for the chemical potential that gives the DFT total charge.
A simple bisection method is used.
F = lambda mu : self.total_density(mu = mu)
Parameters
----------
precision : float, optional
A desired precision of the resulting total charge.
Returns
-------
mu : float
Value of the chemical potential giving the DFT total charge
within specified precision.
"""
F = lambda mu : self.total_density(mu=mu)
density = self.density_required - self.charge_below
self.chemical_potential = dichotomy.dichotomy(function = F,
@ -774,8 +1160,30 @@ class SumkDFT:
return self.chemical_potential
def calc_density_correction(self,filename = 'dens_mat.dat'):
""" Calculates the density correction in order to feed it back to the DFT calculations."""
def calc_density_correction(self, filename='dens_mat.dat'):
r"""
Calculates the charge density correction and stores it into a file.
The charge density correction is needed for charge-self-consistent DFT+DMFT calculations.
It represents a density matrix of the interacting system defined in Bloch basis
and it is calculated from the sum over Matsubara frequecies of the full GF,
..math:: N_{\nu\nu'}(k) = \sum_{i\omega_{n}} G_{\nu\nu'}(k, i\omega_{n})
The density matrix for every `k`-point is stored into a file.
Parameters
----------
filename : string
Name of the file to store the charge density correction.
Returns
-------
(deltaN, dens) : tuple
Returns a tuple containing the density matrix `deltaN` and
the corresponing total charge `dens`.
"""
assert type(filename) == StringType, "calc_density_correction: filename has to be a string!"

View File

@ -27,13 +27,18 @@ from symmetry import *
from sumk_dft import SumkDFT
class SumkDFTTools(SumkDFT):
"""Extends the SumkDFT class with some tools for analysing the data."""
"""
Extends the SumkDFT class with some tools for analysing the data.
"""
def __init__(self, hdf_file, h_field = 0.0, use_dft_blocks = False, dft_data = 'dft_input', symmcorr_data = 'dft_symmcorr_input',
parproj_data = 'dft_parproj_input', symmpar_data = 'dft_symmpar_input', bands_data = 'dft_bands_input',
transp_data = 'dft_transp_input', misc_data = 'dft_misc_input'):
"""
Initialisation of the class. Parameters are exactly as for SumKDFT.
"""
SumkDFT.__init__(self, hdf_file=hdf_file, h_field=h_field, use_dft_blocks=use_dft_blocks,
dft_data=dft_data, symmcorr_data=symmcorr_data, parproj_data=parproj_data,
symmpar_data=symmpar_data, bands_data=bands_data, transp_data=transp_data,
@ -41,10 +46,37 @@ class SumkDFTTools(SumkDFT):
def dos_wannier_basis(self, mu=None, broadening=None, mesh=None, with_Sigma=True, with_dc=True, save_to_file=True):
"""
Calculates the density of states in the basis of the Wannier functions.
Parameters
----------
mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
broadening : double, optional
Lorentzian broadening of the spectra. If not given, standard value of lattice_gf is used.
mesh : real frequency MeshType, optional
Omega mesh for the real-frequency Green's function. Given as parameter to lattice_gf.
with_Sigma : boolean, optional
If True, the self energy is used for the calculation. If false, the DOS is calculated without self energy.
with_dc : boolean, optional
If True the double counting correction is used.
save_to_file : boolean, optional
If True, text files with the calculated data will be created.
Returns
-------
DOS : Dict of numpy arrays
Contains the full density of states.
DOSproj : Dict of numpy arrays
DOS projected to atoms.
DOSproj_orb : Dict of numpy arrays
DOS projected to atoms and resolved into orbital contributions.
"""
if (mesh is None) and (not with_Sigma):
raise ValueError, "lattice_gf: Give the mesh=(om_min,om_max,n_points) for the lattice GfReFreq."
if mesh is None:
if mesh is None:
om_mesh = [x.real for x in self.Sigma_imp_w[0].mesh]
om_min = om_mesh[0]
om_max = om_mesh[-1]
@ -130,7 +162,36 @@ class SumkDFTTools(SumkDFT):
def dos_parproj_basis(self, mu=None, broadening=None, mesh=None, with_Sigma=True, with_dc=True, save_to_file=True):
"""Calculates the orbitally-resolved DOS"""
"""
Calculates the orbitally-resolved DOS.
Different to dos_Wannier_basis is that here we calculate projections also to non-Wannier projectors, in the
flavour of Wien2k QTL calculatuions.
Parameters
----------
mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
broadening : double, optional
Lorentzian broadening of the spectra. If not given, standard value of lattice_gf is used.
mesh : real frequency MeshType, optional
Omega mesh for the real-frequency Green's function. Given as parameter to lattice_gf.
with_Sigma : boolean, optional
If True, the self energy is used for the calculation. If false, the DOS is calculated without self energy.
with_dc : boolean, optional
If True the double counting correction is used.
save_to_file : boolean, optional
If True, text files with the calculated data will be created.
Returns
-------
DOS : Dict of numpy arrays
Contains the full density of states.
DOSproj : Dict of numpy arrays
DOS projected to atoms.
DOSproj_orb : Dict of numpy arrays
DOS projected to atoms and resolved into orbital contributions.
"""
things_to_read = ['n_parproj','proj_mat_all','rot_mat_all','rot_mat_all_time_inv']
value_read = self.read_input_from_hdf(subgrp=self.parproj_data,things_to_read = things_to_read)
@ -228,7 +289,30 @@ class SumkDFTTools(SumkDFT):
def spaghettis(self,broadening=None,plot_shift=0.0,plot_range=None,ishell=None,mu=None,save_to_file='Akw_'):
""" Calculates the correlated band structure with a real-frequency self energy."""
"""
Calculates the correlated band structure using a real-frequency self energy.
Parameters
----------
mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
broadening : double, optional
Lorentzian broadening of the spectra. If not given, standard value of lattice_gf is used.
plot_shift : double, optional
Offset for each A(k,w) for stacked plotting of spectra.
plot_range : list of double, optional
Sets the energy window for plotting to (plot_range[0],plot_range[1]). If not provided, the energy mesh of the self energy is used.
ishell : integer, optional
Contains the index of the shell on which the spectral function is projected. If ishell=None, the total spectrum without projection is calculated.
save_to_file : string, optional
Filename where the spectra are stored.
Returns
-------
Akw : Dict of numpy arrays
Data as it is also written to the files.
"""
assert hasattr(self,"Sigma_imp_w"), "spaghettis: Set Sigma_imp_w first."
things_to_read = ['n_k','n_orbitals','proj_mat','hopping','n_parproj','proj_mat_all']
@ -322,9 +406,29 @@ class SumkDFTTools(SumkDFT):
return Akw
def partial_charges(self,beta=40,mu=None,with_Sigma=True,with_dc=True):
"""Calculates the orbitally-resolved density matrix for all the orbitals considered in the input.
The theta-projectors are used, hence case.parproj data is necessary"""
"""
Calculates the orbitally-resolved density matrix for all the orbitals considered in the input, consistent with
the definition of Wien2k. Hence, (possibly non-orthonormal) projectors have to be provided in the partial projectors subgroup of
the hdf5 archive.
Parameters
----------
with_Sigma : boolean, optional
If True, the self energy is used for the calculation. If false, partial charges are calculated without self-energy correction.
beta : double, optional
In case the self-energy correction is not used, the inverse temperature where the calculation should be done has to be given here.
mu : double, optional
Chemical potential, overrides the one stored in the hdf5 archive.
with_dc : boolean, optional
If True the double counting correction is used.
Returns
-------
dens_mat : list of numpy array
A list of density matrices projected to all shells provided in the input.
"""
things_to_read = ['dens_mat_below','n_parproj','proj_mat_all','rot_mat_all','rot_mat_all_time_inv']
value_read = self.read_input_from_hdf(subgrp=self.parproj_data,things_to_read = things_to_read)
if not value_read: return value_read
@ -387,7 +491,10 @@ class SumkDFTTools(SumkDFT):
def print_hamiltonian(self):
""" Print Hamiltonian for checks."""
"""
Prints the Kohn-Sham Hamiltonian to the text files hamup.dat and hamdn.dat (no spin orbit-coupling), or to ham.dat (with spin-orbit coupling).
"""
if self.SP == 1 and self.SO == 0:
f1 = open('hamup.dat','w')
f2 = open('hamdn.dat','w')
@ -412,8 +519,8 @@ class SumkDFTTools(SumkDFT):
# ----------------- transport -----------------------
def read_transport_input_from_hdf(self):
"""
Reads the data for transport calculations from the HDF file
r"""
Reads the data for transport calculations from the hdf5 archive.
"""
thingstoread = ['band_window_optics','velocities_k']
self.read_input_from_hdf(subgrp=self.transp_data,things_to_read = thingstoread)
@ -422,31 +529,71 @@ class SumkDFTTools(SumkDFT):
def cellvolume(self, lattice_type, lattice_constants, latticeangle):
r"""
Determines the conventional und primitive unit cell volumes.
Parameters
----------
lattice_type : string
Lattice type according to the Wien2k convention (P, F, B, R, H, CXY, CYZ, CXZ).
lattice_constants : list of double
Lattice constants (a, b, c).
lattice angles : list of double
Lattice angles (:math:`\alpha, \beta, \gamma`).
Returns
-------
vol_c : double
Conventional unit cell volume.
vol_p : double
Primitive unit cell volume.
"""
Calculate cell volume: volumecc conventional cell, volumepc, primitive cell.
"""
a = lattice_constants[0]
b = lattice_constants[1]
c = lattice_constants[2]
c_al = numpy.cos(latticeangle[0])
c_be = numpy.cos(latticeangle[1])
c_ga = numpy.cos(latticeangle[2])
volumecc = a * b * c * numpy.sqrt(1 + 2 * c_al * c_be * c_ga - c_al ** 2 - c_be * 82 - c_ga ** 2)
vol_c = a * b * c * numpy.sqrt(1 + 2 * c_al * c_be * c_ga - c_al ** 2 - c_be * 82 - c_ga ** 2)
det = {"P":1, "F":4, "B":2, "R":3, "H":1, "CXY":2, "CYZ":2, "CXZ":2}
volumepc = volumecc / det[lattice_type]
vol_p = vol_c / det[lattice_type]
return volumecc, volumepc
return vol_c, vol_p
def transport_distribution(self, directions=['xx'], energy_window=None, Om_mesh=[0.0], beta=40.0, with_Sigma=False, n_om=None, broadening=0.0):
"""
calculate Tr A(k,w) v(k) A(k, w+Om) v(k).
energy_window: regime for omega integral
Om_mesh: mesh for optic conductivitity. Om_mesh is repinned to the self-energy mesh!
directions: list of directions: xx,yy,zz,xy,yz,zx.
with_Sigma: Use Sigma_w = 0 if False (In this case it is necessary to specifiy the energywindow (energy_window),
the number of omega points (n_om) in the window and the broadening (broadening)).
def transport_distribution(self, beta, directions=['xx'], energy_window=None, Om_mesh=[0.0], with_Sigma=False, n_om=None, broadening=0.0):
r"""
Calculates the transport distribution
.. math::
\Gamma_{\alpha\beta}\left(\omega+\Omega/2, \omega-\Omega/2\right) = \frac{1}{V} \sum_k Tr\left(v_{k,\alpha}A_{k}(\omega+\Omega/2)v_{k,\beta}A_{k}\left(\omega-\Omega/2\right)\right)
in the direction :math:`\alpha\beta`. The velocities :math:`v_{k}` are read from the transport subgroup of the hdf5 archive.
Parameters
----------
beta : double
Inverse temperature :math:`\beta`.
directions : list of double, optional
:math:`\alpha\beta` e.g.: ['xx','yy','zz','xy','xz','yz'].
energy_window : list of double, optional
Specifies the upper and lower limit of the frequency integration for :math:`\Omega=0.0`. The window is automatically enlarged by the largest :math:`\Omega` value,
hence the integration is performed in the interval [energy_window[0]-max(Om_mesh), energy_window[1]+max(Om_mesh)].
Om_mesh : list of double, optional
:math:`\Omega` frequency mesh of the optical conductivity. For the conductivity and the Seebeck coefficient :math:`\Omega=0.0` has to be
part of the mesh. In the current version Om_mesh is repined to the mesh provided by the self-energy! The actual mesh is printed on the screen and stored as
member Om_mesh.
with_Sigma : boolean, optional
Determines whether the calculation is performed with or without self energy. If this parameter is set to False the self energy is set to zero (i.e. the DFT band
structure :math:`A(k,\omega)` is used). Note: For with_Sigma=False it is necessary to specify the parameters energy_window, n_om and broadening.
n_om : integer, optional
Number of equidistant frequency points in the interval [energy_window[0]-max(Om_mesh), energy_window[1]+max(Om_mesh)]. This parameters is only used if
with_Sigma = False.
broadening : double, optional
Lorentzian broadening. It is necessary to specify the boradening if with_Sigma = False, otherwise this parameter can be set to 0.0.
"""
# Check if wien converter was called and read transport subgroup form hdf file
@ -479,7 +626,7 @@ class SumkDFTTools(SumkDFT):
# calculate A(k,w)
#######################################
# Define mesh for Greens function and in the specified energy window
# Define mesh for Green's function and in the specified energy window
if (with_Sigma == True):
self.omega = numpy.array([round(x.real,12) for x in self.Sigma_imp_w[0].mesh])
mesh = None
@ -525,7 +672,7 @@ class SumkDFTTools(SumkDFT):
print "where the omega vector is:"
print self.omega
print "Calculation requested for Omega mesh: ", numpy.array(Om_mesh)
print "Omega mesh automatically repinned to: ", self.Om_mesh
print "Omega mesh automatically repined to: ", self.Om_mesh
self.Gamma_w = {direction: numpy.zeros((len(self.Om_mesh), n_om), dtype=numpy.float_) for direction in self.directions}
@ -567,13 +714,28 @@ class SumkDFTTools(SumkDFT):
/ self.cellvolume(self.lattice_type, self.lattice_constants, self.lattice_angles)[1] / self.n_symmetries)
def transport_coefficient(self, direction, iq=0, n=0, beta=40):
"""
calculates the transport coefficients A_n in a given direction and for a given Omega. (see documentation)
A_1 is set to nan if requested for Omega != 0.0
iq: index of Omega point in Om_mesh
direction: 'xx','yy','zz','xy','xz','yz'
def transport_coefficient(self, direction, iq, n, beta):
r"""
Calculates the transport coefficient A_n in a given direction for a given :math:`\Omega`. The required members (Gamma_w, directions, Om_mesh) have to be obtained first
by calling the function :meth:`transport_distribution <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.transport_distribution>`. For n>0 A is set to NaN if :math:`\Omega` is not 0.0.
Parameters
----------
direction : string
:math:`\alpha\beta` e.g.: 'xx','yy','zz','xy','xz','yz'.
iq : integer
Index of :math:`\Omega` point in the member Om_mesh.
n : integer
Number of the desired moment of the transport distribution.
beta : double
Inverse temperature :math:`\beta`.
Returns
-------
A : double
Transport coefficient.
"""
if not (mpi.is_master_node()): return
assert hasattr(self,'Gamma_w'), "transport_coefficient: Run transport_distribution first or load data from h5!"
@ -589,13 +751,32 @@ class SumkDFTTools(SumkDFT):
/ (self.Om_mesh[iq] * beta) * d_omega)
else:
A = numpy.nan
return A * numpy.pi * (2.0-self.SP)
A = A * numpy.pi * (2.0-self.SP)
return A
def conductivity_and_seebeck(self, beta=40):
def conductivity_and_seebeck(self, beta):
r"""
Calculates the Seebeck coefficient and the optical conductivity by calling
:meth:`transport_coefficient <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.transport_coefficient>`.
The required members (Gamma_w, directions, Om_mesh) have to be obtained first by calling the function
:meth:`transport_distribution <pytriqs.applications.dft.sumk_dft_tools.SumkDFTTools.transport_distribution>`.
Parameters
----------
beta : double
Inverse temperature :math:`\beta`.
Returns
-------
optic_cond : dictionary of double vectors
Optical conductivity in each direction and frequency given by Om_mesh.
seebeck : dictionary of double
Seebeck coefficient in each direction. If zero is not present in Om_mesh the Seebeck coefficient is set to NaN.
"""
Calculates the Seebeck coefficient and the conductivity for a given Gamma_w
"""
if not (mpi.is_master_node()): return
assert hasattr(self,'Gamma_w'), "conductivity_and_seebeck: Run transport_distribution first or load data from h5!"
@ -620,10 +801,24 @@ class SumkDFTTools(SumkDFT):
print "Conductivity in direction %s for Omega = %.2f %f x 10^4 Ohm^-1 cm^-1" % (direction, self.Om_mesh[iq], self.optic_cond[direction][iq])
if not (numpy.isnan(A1[direction][iq])):
print "Seebeck in direction %s for Omega = 0.00 %f x 10^(-6) V/K" % (direction, self.seebeck[direction])
return self.optic_cond, self.seebeck
def fermi_dis(self, x):
"""
fermi distribution at x = omega * beta
r"""
Fermi distribution.
.. math::
f(x) = 1/(e^x+1).
Parameters
----------
x : double
Inverse temperature times frequency :math:`\beta\omega`.
Returns
-------
f : double
"""
return 1.0/(numpy.exp(x)+1)

View File

@ -27,17 +27,24 @@ from pytriqs.archive import *
import pytriqs.utility.mpi as mpi
class Symmetry:
"""This class provides the routines for applying symmetry operations for the k sums.
It contains the permutations of the atoms in the unti cell, and the corresponding
rotational matrices for each symmetry operation."""
"""
This class provides the routines for applying symmetry operations for the k sums.
It contains the permutations of the atoms in the unit cell, and the corresponding
rotational matrices for each symmetry operation.
"""
def __init__(self, hdf_file, subgroup = None):
"""Initialises the class.
Reads the permutations and rotation matrizes from the file, and constructs the mapping for
the given orbitals. For each orbit a matrix is read!!!
SO: Flag for spin-orbit coupling.
SP: Flag for spin polarisation.
"""
"""
Initialises the class.
Parameters
----------
hdf_file : string
Base name of the hdf5 archive with the symmetry data.
subgroup : string, optional
Name of subgroup storing correlated-shell symmetry data. If not given, it is assumed that
the data is stored at the root of the hdf5 archive.
"""
assert type(hdf_file) == StringType, "Symmetry: hdf_file must be a filename."
self.hdf_file = hdf_file
@ -72,6 +79,23 @@ class Symmetry:
def symmetrize(self,obj):
"""
Symmetrizes a given object.
Parameters
----------
obj : list
object to symmetrize. It has to be given as list, where its length is determined by the number
of equivalent members of the object. Two types of objects are supported:
- BlockGf : list of Green's functions,
- Matrices : The format is taken from density matrices as obtained from Green's functions (DictType).
Returns
-------
symm_obj : list
Symmetrized object, of the same type as input object.
"""
assert isinstance(obj,list), "symmetrize: obj has to be a list of objects."
assert len(obj) == self.n_orbits, "symmetrize: obj has to be a list of the same length as defined in the init."

View File

@ -1,17 +1,33 @@
from pytriqs.applications.dft.sumk_dft import *
from pytriqs.applications.dft.converters import Wien2kConverter
from pytriqs.gf.local.block_gf import BlockGf
from pytriqs.gf.local.gf_imfreq import GfImFreq
from pytriqs.gf.local import *
from pytriqs.archive import *
import pytriqs.utility.mpi as mpi
import numpy
import copy
class TransBasis:
'''Computates rotations into a new basis in order to make certain quantities diagonal.'''
"""
Computates rotations into a new basis, using the condition that a given property is diagonal in the new basis.
"""
def __init__(self, SK=None, hdf_datafile=None):
'''Inits the class by reading the input.'''
"""
Initialization of the class. There are two ways to do so:
- existing SumkLDA class : when you have an existing SumkLDA instance
- from hdf5 archive : when you want to use data from hdf5 archive
Giving the class instance overrides giving the string for the hdf5 archive.
Parameters
----------
SK : class SumkLDA, optional
Existing instance of SumkLDA class.
hdf5_datafile : string, optional
Name of hdf5 archive to be used.
"""
if SK is None:
# build our own SK instance
@ -31,8 +47,24 @@ class TransBasis:
self.w = numpy.identity(SK.corr_shells[0]['dim'])
def __call__(self, prop_to_be_diagonal = 'eal'):
'''Calculates the diagonalisation.'''
def calculate_diagonalisation_matrix(self, prop_to_be_diagonal = 'eal'):
"""
Calculates the diagonalisation matrix w, and stores it as member of the class.
Parameters
----------
prop_to_be_diagonal : string, optional
Defines the property to be diagonalized.
- 'eal' : local hamiltonian (i.e. crystal field)
- 'dm' : local density matrix
Returns
-------
wsqr : double
Measure for the degree of rotation done by the diagonalisation. wsqr=1 means no rotation.
"""
if prop_to_be_diagonal == 'eal':
prop = self.SK.eff_atomic_levels()[0]
@ -57,7 +89,19 @@ class TransBasis:
def rotate_gf(self,gf_to_rot):
'''Rotates a given GF into the new basis.'''
"""
Uses the diagonalisation matrix w to rotate a given GF into the new basis.
Parameters
----------
gf_to_rot : BlockGf
Green's function block to rotate.
Returns
-------
gfreturn : BlockGf
Green's function rotated into the new basis.
"""
# build a full GF
gfrotated = BlockGf( name_block_generator = [ (block,GfImFreq(indices = inner, mesh = gf_to_rot.mesh)) for block,inner in self.SK.gf_struct_sumk[0] ], make_copies = False)
@ -84,7 +128,15 @@ class TransBasis:
def write_trans_file(self, filename):
'''Writes the new transformation into a file readable by dmftproj.'''
"""
Writes the new transformation T into a file readable by dmftproj. By that, the requested quantity is
diagonal already at input.
Parameters
----------
filename : string
Name of the file where the transformation is stored.
"""
f = open(filename,'w')
Tnew = self.T.conjugate()