mirror of
https://github.com/triqs/dft_tools
synced 2024-12-23 04:43:42 +01:00
test: correct broken tests and append new one
This commit is contained in:
parent
e949d4c1b0
commit
d4ef98edfd
@ -59,8 +59,8 @@ def read_transport_input_from_hdf(sum_k):
|
|||||||
thingstoread = ['band_window', 'n_symmetries',
|
thingstoread = ['band_window', 'n_symmetries',
|
||||||
'rot_symmetries','cell_vol']
|
'rot_symmetries','cell_vol']
|
||||||
sum_k.read_input_from_hdf(subgrp=sum_k.misc_data, things_to_read=thingstoread)
|
sum_k.read_input_from_hdf(subgrp=sum_k.misc_data, things_to_read=thingstoread)
|
||||||
if(self.dft_code=="wien2k"):
|
if(sum_k.dft_code=="wien2k"):
|
||||||
self.cell_vol = self.cellvolume(self.lattice_type, self.lattice_constants, self.lattice_angles)[1]
|
sum_k.cell_vol = cellvolume(sum_k.lattice_type, sum_k.lattice_constants, sum_k.lattice_angles)[1]
|
||||||
|
|
||||||
return sum_k
|
return sum_k
|
||||||
|
|
||||||
|
BIN
test/python/sr2ruo4_transp.ref.h5
Normal file
BIN
test/python/sr2ruo4_transp.ref.h5
Normal file
Binary file not shown.
@ -24,6 +24,7 @@ from h5 import HDFArchive
|
|||||||
from triqs_dft_tools.converters.wien2k import *
|
from triqs_dft_tools.converters.wien2k import *
|
||||||
from triqs_dft_tools.sumk_dft import *
|
from triqs_dft_tools.sumk_dft import *
|
||||||
from triqs_dft_tools.sumk_dft_tools import *
|
from triqs_dft_tools.sumk_dft_tools import *
|
||||||
|
from triqs_dft_tools.sumk_dft_transport import transport_distribution, init_spectroscopy, conductivity_and_seebeck, write_output_to_hdf
|
||||||
from triqs.utility.comparison_tests import *
|
from triqs.utility.comparison_tests import *
|
||||||
from triqs.utility.h5diff import h5diff
|
from triqs.utility.h5diff import h5diff
|
||||||
|
|
||||||
@ -40,12 +41,16 @@ with HDFArchive('SrVO3_Sigma_transport.h5', 'a') as ar:
|
|||||||
SK.chemical_potential = ar['dmft_transp_input']['chemical_potential']
|
SK.chemical_potential = ar['dmft_transp_input']['chemical_potential']
|
||||||
SK.dc_imp = ar['dmft_transp_input']['dc_imp']
|
SK.dc_imp = ar['dmft_transp_input']['dc_imp']
|
||||||
|
|
||||||
SK.transport_distribution(directions=['xx'], broadening=0.0, energy_window=[-0.3,0.3], Om_mesh=[0.00, 0.02] , beta=beta, with_Sigma=True)
|
SK = init_spectroscopy(SK, code='wien2k')
|
||||||
|
Gamma_w, omega, Om_mesh = transport_distribution(SK, directions=['xx'], broadening=0.0, energy_window=[-0.3,0.3],
|
||||||
|
Om_mesh=[0.00, 0.02], beta=beta, with_Sigma=True, code='wien2k')
|
||||||
|
|
||||||
#SK.save(['Gamma_w','Om_meshr','omega','directions'])
|
#SK.save(['Gamma_w','Om_meshr','omega','directions'])
|
||||||
#SK.load(['Gamma_w','Om_meshr','omega','directions'])
|
#SK.load(['Gamma_w','Om_meshr','omega','directions'])
|
||||||
SK.conductivity_and_seebeck(beta=beta)
|
optic_cond, seebeck, kappa = conductivity_and_seebeck(Gamma_w, omega, Om_mesh, SK.SP, ['xx'], beta=beta)
|
||||||
SK.hdf_file = 'srvo3_transp.out.h5'
|
output_dict = {'seebeck': seebeck, 'optic_cond': optic_cond, 'kappa': kappa}
|
||||||
SK.save(['seebeck','optic_cond','kappa'])
|
write_output_to_hdf(SK, output_dict, 'transp_output')
|
||||||
|
|
||||||
|
|
||||||
if mpi.is_master_node():
|
if mpi.is_master_node():
|
||||||
h5diff("srvo3_transp.out.h5","srvo3_transp.ref.h5")
|
h5diff('SrVO3.ref.h5', "srvo3_transp.ref.h5")
|
||||||
|
Binary file not shown.
@ -4,6 +4,7 @@ import numpy as np
|
|||||||
import triqs.utility.mpi as mpi
|
import triqs.utility.mpi as mpi
|
||||||
from h5 import HDFArchive
|
from h5 import HDFArchive
|
||||||
from triqs.gf import MeshReFreq
|
from triqs.gf import MeshReFreq
|
||||||
|
from triqs.utility.h5diff import h5diff
|
||||||
|
|
||||||
from triqs_dft_tools.sumk_dft import SumkDFT
|
from triqs_dft_tools.sumk_dft import SumkDFT
|
||||||
from triqs_dft_tools.sumk_dft_transport import transport_distribution, init_spectroscopy, conductivity_and_seebeck, write_output_to_hdf
|
from triqs_dft_tools.sumk_dft_transport import transport_distribution, init_spectroscopy, conductivity_and_seebeck, write_output_to_hdf
|
||||||
@ -59,12 +60,18 @@ Om_mesh = [0.0, 0.2]
|
|||||||
eta_lattice = 0.001
|
eta_lattice = 0.001
|
||||||
directions = ['xx']
|
directions = ['xx']
|
||||||
|
|
||||||
sum_k, cell_volume = init_spectroscopy(sum_k, code='wannier90', w90_params=w90_params)
|
sum_k = init_spectroscopy(sum_k, code='wannier90', w90_params=w90_params)
|
||||||
|
|
||||||
Gamma_w, omega, Om_mesh = transport_distribution(sum_k, directions=directions,
|
Gamma_w, omega, Om_mesh = transport_distribution(sum_k, directions=directions,
|
||||||
Om_mesh=Om_mesh, energy_window=window,
|
Om_mesh=Om_mesh, energy_window=window,
|
||||||
with_Sigma=True, broadening=eta_lattice,
|
with_Sigma=True, broadening=eta_lattice,
|
||||||
beta=beta, code='wannier90', cell_volume=cell_volume)
|
beta=beta, code='wannier90')
|
||||||
|
|
||||||
if mpi.is_master_node():
|
if mpi.is_master_node():
|
||||||
optic_cond, seebeck, kappa = conductivity_and_seebeck(Gamma_w, omega, Om_mesh, sum_k.SP, directions, beta=beta, method=None)
|
optic_cond, seebeck, kappa = conductivity_and_seebeck(Gamma_w, omega, Om_mesh, sum_k.SP, directions, beta=beta, method=None)
|
||||||
|
|
||||||
|
output_dict = {'Gamma_w': Gamma_w, 'Om_mesh': Om_mesh, 'omega': omega, 'directions': directions,
|
||||||
|
'seebeck': seebeck, 'optic_cond': optic_cond, 'kappa': kappa}
|
||||||
|
write_output_to_hdf(sum_k, output_dict, 'transp_output')
|
||||||
|
|
||||||
|
h5diff(h5_archive, "sr2ruo4_transp.ref.h5")
|
||||||
|
Loading…
Reference in New Issue
Block a user