BDG Tutorial
BDG Tutorial
md 9/30/2021
Requirements
In the setup of this tutorial we used the following versions of AiiDA-KKR and its dependencies:
https://github.com/JuDFTteam/aiida-kkr, commit:
1261e8b5bd263d647258b8235b3dbb9c84b85ab9
1 / 11
BdG-tutorial.md 9/30/2021
https://github.com/aiidateam/aiida-core, commit:
ec97fcf4e4022ed3d099a0e8ecc8f7477d1f468d
https://github.com/JuDFTteam/masci-tools, commit:
3083e19d991737598eb68044206b55b584236f4d
You need to install KKRhost from the BdG branch to be able to run this.
To load the nodes (and have the BdG code in the database) import the export file for this tutorial:
import numpy as np
import matplotlib.pyplot as plt
from aiida.orm import load_node, Dict, StructureData, Code
from aiida.engine import submit
from masci_tools.io.common_functions import get_aBohr2Ang
from masci_tools.io.common_functions import search_string
from aiida_kkr import __version__ as aiida_kkr_version
from aiida_kkr.tools import plot_kkr, kkrparams
from aiida_kkr.workflows import kkr_scf_wc, kkr_dos_wc
2 / 11
BdG-tutorial.md 9/30/2021
# code that uses AMD nodes and has the BdG functionality
kkr_BdG = Code.get_from_string('kkrhost_BdG_AMD@iffslurm')
options_AMD = {
'withmpi': True,
'resources': {'num_machines': 1, 'tot_num_mpiprocs': 32},
'queue_name': 'th1-2020-32', # select AMD nodes that match the AMD
codes (see above)
'max_wallclock_seconds': 3600*4 # 4 hours max runtime
}
# plot_kkr(struc, silent=True)
scf_settings = kkr_scf_wc.get_wf_defaults(silent=True)[0]
scf_settings['mag_init'] = False
scf_settings['check_dos'] = False
scf_settings['nsteps'] = 100
scf_settings.convergence_setting_coarse =
scf_settings.convergence_setting_fine
para = kkrparams(NSPIN=1, LMAX=2, RMAX=10, GMAX=100)
builder = kkr_scf_wc.get_builder()
builder.kkr = kkr_BdG # BdG code on AMD nodes
builder.voronoi = Code.get_from_string('voronoi_3.5_AMD@iffslurm')
builder.calc_parameters = Dict(dict=para)
builder.wf_parameters = Dict(dict=scf_settings)
builder.metadata.label = 'Nb_bulk_scf'
builder.structure = struc
builder.options = Dict(dict=options_AMD)
if not Nb_scf.is_finished_ok:
raise ValueError('Wait for scf to finish!')
4 / 11
BdG-tutorial.md 9/30/2021
# this is for the use of the Chebychev solver (required to run BdG
mode)
RUNOPT=['NEWSOSOL'],
R_LOG= 0.6,
NPAN_EQ= 7,
NPAN_LOG= 18,
NCHEB= 12,
DECOUPLE_SPIN_CHEBY=True, # use the Chebychev solver without SOC to
speed everything up
)
This is the energy contour we used (the color indicates the k-mesh):
ec = []
ec = np.array(ec, dtype=float)
plt.figure(figsize=(12,6))
plt.scatter(ec[:,0], ec[:,1], c=ec[:,2], )
plt.xlabel('Re(E) (Ry)')
plt.ylabel('Im(E) (Ry)')
cb = plt.colorbar()
plt.title('Energy contour')
plt.ylim(0)
plt.show()
5 / 11
BdG-tutorial.md 9/30/2021
if not Nb_semi_circ.is_finished_ok:
raise ValueError('Wait for semi-circle calculation to finish!')
# use e/h symmetry (uses only half of the mirrored contour, makes
everything faster)
use_e_symm_BdG= True,
6 / 11
BdG-tutorial.md 9/30/2021
the structure)
at_scale_BdG = [1.0 for i in range(len(struc.sites))],
)
3. BdG scf
if not BdG_scf_start.is_finished_ok:
raise ValueError('Wait for BdG init to finish!')
# BdG mixing:
mixfac_BdG = 0.3, # mixing factor for BdG Broyden mixing
Ninit_Broyden_BdG = 5, # number of BdG simple mixing steps (should be
between 5 and 50 for stability)
7 / 11
BdG-tutorial.md 9/30/2021
# plot convergence
plot_kkr(BdG_scf, silent=True)
8 / 11
BdG-tutorial.md 9/30/2021
4. BdG DOS
Finally we can look at the density of states in the superconducting state. The overview in an energy range of
-3 to +1 eV around EF does not show a lot of differences to the normal state.
if not BdG_scf.is_finished_ok:
raise ValueError('Wait for BdG scf to finish!')
builder = kkr_dos_wc.get_builder()
builder.kkr = kkr_BdG
builder.options = Dict(dict=options_AMD)
builder.remote_data = BdG_scf.outputs.remote_folder
builder.wf_parameters = Dict(dict=dos_settings)
builder.metadata.label = BdG_scf.label + '_DOS_overview'
9 / 11
BdG-tutorial.md 9/30/2021
To see the superconducting gap we have to focus closely around the Fermi level (+/-10meV around EF):
if not BdG_scf.is_finished_ok:
raise ValueError('Wait for BdG scf to finish!')
builder = kkr_dos_wc.get_builder()
builder.kkr = kkr_BdG
builder.options = Dict(dict={
'withmpi': True,
'resources': {'num_machines': 1, 'tot_num_mpiprocs': 64},
'queue_name': 'th1-2020-64',
'max_wallclock_seconds': 14400}
)
builder.remote_data = BdG_scf.outputs.remote_folder
builder.wf_parameters = Dict(dict=dos_settings)
builder.metadata.label = BdG_scf.label + '_DOS_zoom'
10 / 11
BdG-tutorial.md 9/30/2021
11 / 11