From 3b67084a73d1e8ad5fcbe9aae0cb962cd2a18abc Mon Sep 17 00:00:00 2001 From: nscolonna Date: Fri, 14 Jun 2024 15:20:58 +0200 Subject: [PATCH] Add tutorial_6: KCP calculation for a FM system (CrI3) --- tutorials/tutorial_6/cri3.json | 80 ++++++++++++++++++++++++++++++ tutorials/tutorial_6/plot_bands.py | 23 +++++++++ 2 files changed, 103 insertions(+) create mode 100644 tutorials/tutorial_6/cri3.json create mode 100644 tutorials/tutorial_6/plot_bands.py diff --git a/tutorials/tutorial_6/cri3.json b/tutorials/tutorial_6/cri3.json new file mode 100644 index 000000000..2f14dda3c --- /dev/null +++ b/tutorials/tutorial_6/cri3.json @@ -0,0 +1,80 @@ +{ + "workflow": { + "task": "singlepoint", + "functional": "ki", + "base_functional": "lda", + "method": "dscf", + "init_orbitals": "mlwfs", + "calculate_alpha" : false, + "alpha_guess" : 0.122, + "pseudo_library": "pseudo_dojo_standard", + "gb_correction" : true, + "from_scratch": true, + "spin_polarized": true + }, + "atoms": { + "cell_parameters": { + "periodic": true, + "units": "angstrom", + "vectors": [[ 3.4335000000, 1.9823321493, 6.6023333333], + [-3.4335000000, 1.9823321493, 6.6023333333], + [ 0.0000000000, -3.9646642985, 6.6023333333]] + }, + "atomic_positions": { + "units": "crystal", + "positions": [ + [ "Cr", 0.333676666700, 0.333676666700, -0.666323333300], + [ "Cr", 0.666323333300, 0.666323333300, -0.333676666700], + [ "I", 0.569940000100, 0.922230000000, -0.729070000000], + [ "I", 0.922230000000, 0.270930000000, -0.430059999900], + [ "I", 0.270930000000, 0.569940000100, -0.077770000000], + [ "I", 0.430059999900, 0.077770000000, -0.270930000000], + [ "I", 1.077770000000, -0.270930000000, -0.569940000100], + [ "I", 0.729070000000, -0.569940000100, 0.077770000000] + + ] + } + }, + "kpoints": { + "grid": [ + 2, + 2, + 2 + ], + "path": "GLFG", + "density": 30 + }, + "calculator_parameters": { + "ecutwfc": 30.0, + "tot_magnetization": 6, + "pw": { + "system": { + "nbnd": 42, + "starting_magnetization(1)": 3.5714285714e-01, + "starting_magnetization(2)": 1.0000000000e-01 + } + }, + "w90": { + "up":{ + "projections": [ + [{"site": "Cr", "ang_mtm": "l=0"}], + [{"site": "Cr", "ang_mtm": "l=1"}], + [{"site": "I", "ang_mtm": "l=0"}], + [{"site": "I", "ang_mtm": "l=1"},"Cr:l=2,mr=1", "Cr:l=2,mr=4", "Cr:l=2,mr=5"], + ["Cr:l=2,mr=2", "Cr:l=2,mr=3"] + ] + }, + "down":{ + "projections": [ + [{"site": "Cr", "ang_mtm": "l=0"}], + [{"site": "Cr", "ang_mtm": "l=1"}], + [{"site": "I" , "ang_mtm": "l=0"}], + [{"site": "I" , "ang_mtm": "l=1"}], + ["Cr:l=2,mr=1", "Cr:l=2,mr=4", "Cr:l=2,mr=5"], + ["Cr:l=2,mr=2", "Cr:l=2,mr=3"] + ] + } + } + } +} + diff --git a/tutorials/tutorial_6/plot_bands.py b/tutorials/tutorial_6/plot_bands.py new file mode 100644 index 000000000..6a4fb6a7a --- /dev/null +++ b/tutorials/tutorial_6/plot_bands.py @@ -0,0 +1,23 @@ +from koopmans.io import read +import matplotlib.pyplot as plt + +# Load the workflow +wf = read('cri3.kwf') + +# The Koopmans bands were generated by the very last calculation in the workflow +ui_calc = wf.calculations[-1] + +# Fetch the Koopmans bands, and shift them so that the valence band maximum is zero +ki_bs = ui_calc.results['band structure'] +ki_bs_shifted = ki_bs.subtract_reference() + + +# Plot the two band structures +ax = ki_bs_shifted.plot( spin=0, label='KI@LDA-up', color='tab:red', ls="-") +ax = ki_bs_shifted.plot(ax=ax, spin=1, label='KI@LDA-down', color='tab:red', ls="--") + +ax.legend(loc='lower right', ncol=2, bbox_to_anchor=(1, 1)) +ax.set_ylim([-5, 5]) + +plt.show() +