# gnuscript of the simiplied models for the AFM spin splitting project.
# conduction-band.dat
# fit the energy data for down spin, the 4th column

set size square
set key left
set pointsize 1.5
unset grid

set style line 1\
	linecolor rgb 'black' \
	linetype 1 linewidth 2 \
	pointtype 8 pointsize 0

FIT_LIMIT = 1e-50

f(kx, ky, kz) = a000 + a100*cos(2*pi*kx) + a010*cos(2*pi*ky) + a200*cos(4*pi*kx) + a101*cos(2*pi*kx)*cos(2*pi*kz)

fit [kx = -0.5:0.5] [ky = -0.5:0.5] [kz = -0.5:0.5] f(kx, ky, kz) 'conduction-band.dat' using 1:2:3:4 \
via a000, a100, a010, a200, a101

plot 'conduction-band.dat' using ($1 == 0 && $3==$2 && $2>=0 ? $2:1/0):($4),\
'' using ($2 == 0 && $1==-$3 && $3<=0 ? $3:1/0):($4),\
'' using ($1 == 0 && $3==$2 && $2>=0 ? $2:1/0):(f($1, $2, $3)),\
'' using ($2 == 0 && $1==-$3 && $3<=0 ? $3:1/0):(f($1, $2, $3))

set print "conduction_band_selected_data_down_simplified.txt"
do for [x=0:50:5] {print 0, 0.01*x, 0.01*x, f(0, 0.01*x, 0.01*x)}
do for [x=0:50:5] {print 0.01*x, 0, -0.01*x, f(0.01*x, 0, -0.01*x)}

set xlabel 'L-GAMMA-Z'
set ylabel 'Energy'
