Skip to content

Instantly share code, notes, and snippets.

@yomichi
Created February 13, 2019 05:46
Show Gist options
  • Save yomichi/ce790e09168fc9f63695c4809c750bfd to your computer and use it in GitHub Desktop.
Save yomichi/ce790e09168fc9f63695c4809c750bfd to your computer and use it in GitHub Desktop.
L=16
omegamax=3.15
omegaim=0.1
output="spectrum-L${L}.dat"
MPIEXEC="mpiexec -np 2"
HPHI=HPhi
cat << PARAM > gs.in
model = "spin"
method = "cg"
lattice = "chain lattice"
2S = 1
2Sz = 0
J = 1
L = $L
PARAM
cp gs.in exc.in.org
echo 'EigenvecIO = "out"' >> gs.in
$MPIEXEC $HPHI -s gs.in
cat << PARAM >> exc.in.org
LanczosEPS = 8
CalcSpec = "Normal"
SpectrumType = "SzSz"
OmegaMin = 0.0
OmegaMax = $omegamax
OmegaIM = $omegaim
PARAM
ge=$(gawk '$1~/Energy/ {print $2}' output/zvo_energy.dat)
rm -f $output
L2=$(echo "$L / 2" | bc)
for iq in `seq 0 $L2`; do
cp exc.in.org exc.in
q=$(echo "$iq/$L" | bc -l)
echo "spectrumQL = $q" >> exc.in
$MPIEXEC $HPHI -sdry exc.in
gsed -i "" "s/OmegaOrg[ \t]\+0.0/OmegaOrg $ge/" modpara.def
$MPIEXEC $HPHI -e namelist.def
gawk --assign=q=$q '{print q, $1, $3, $4}' output/zvo_DynamicalGreen.dat >> $output
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment