%load_ext autoreload
%autoreload 2
%matplotlib inline
from aiida import load_profile
load_profile()
from aiida.orm import load_node
import numpy as np
import matplotlib.pyplot as plt
from aiida_kkr.tools import plot_kkr
from aiida_kkr.calculations import KkrCalculation
from masci_tools.io.common_functions import interpolate_dos
from masci_tools.util.constants import RY_TO_EV
The autoreload extension is already loaded. To reload it, use: %reload_ext autoreload
# load nodes from database
struc_kkr21 = load_node('c285e2a3-2994-4e61-ba66-b7a3ed805ea7') # 4 Vac, KKR structure
struc_eos_bulk = load_node('afd6141a-cb29-4c65-b0be-1a7d5501090a') # bulk structure, relaxed
size_axis_labels = 20
size_tick_labels = 18
size_legend = 20
size_plabel = 24
# single column figure: width = 10
# double column = width=20
import numpy as np
import matplotlib.pyplot as plt
plt.figure(figsize=(10,6))
z = np.array([i.position[2] for i in struc_kkr21.sites])[4:-4]
plt.xlabel('layer index', fontsize='x-large')
dz = z[1:]-z[:-1]
plt.plot(np.arange(len(dz))+0.5, dz, 'o-', lw=3, ms=10, color='C0')
plt.ylabel('layer distance ($\mathrm{\AA}$)', fontsize='x-large')
plt.twinx()
plt.plot(np.arange(len(dz))+0.5, np.round((dz/dz[10]-1)*100, 2), 'o', ms=1, color='C0')
plt.ylabel('relaxation (%)', fontsize='x-large')
plt.xticks(range(0,21), fontsize='x-large')
plt.savefig('layer_relaxation.pdf')
plt.show()
# Bulk lattice constant
np.round(np.array(struc_eos_bulk.cell),2)
array([[3.32, 0. , 0. ],
[0. , 4.69, 0. ],
[0. , 0. , 4.69]])
# Bravais matrix of the relaxed film
np.round(np.array(struc_kkr21.cell),2)
array([[ 3.32, 0. , 0. ],
[ 1.66, 2.35, 0. ],
[ 0. , 0. , 67.74]])