100 行
2.4 KiB
Bash
可执行文件
100 行
2.4 KiB
Bash
可执行文件
#! /bin/zsh
|
|
|
|
# For given N (L) and k_fact (multiple of kF/4), this
|
|
# computes the required DSF (up to required sumrule)
|
|
# over a range of values of c_int.
|
|
|
|
# This script cannot be restarted, it must be run as a one-off towards successful completion.
|
|
|
|
# The data can then be used to produce animated graphs (with c_int evolving),
|
|
# see the `build_LiebLin_c_scan_k_fixed_dsfs[_plot]` scripts, or
|
|
# (better) the shortcuts `build_LiebLin_c_scan_k_fixed_set[_plots]`.
|
|
|
|
if [[ $# -ne 5 ]]; then
|
|
echo "Arguments needed: whichDSF, kBT, target_sumrule, N, nk (momentum in units of kF/4)."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $1 != 'd' && $1 != 'g' && $1 != 'o' ]]; then
|
|
echo "Only the d, g and o scanning options are implemented."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $2 -lt 0 ]]; then
|
|
echo "Temperature kBT must be > 0."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $3 -lt 0 || $3 -gt 1 ]]; then
|
|
echo "Requirement: 0 < target_sumrule < 1."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $4 -lt 0 ]]; then
|
|
echo "N must be > 0."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $5 -lt 0 ]]; then
|
|
echo "nk must be > 0."
|
|
exit 1
|
|
fi
|
|
|
|
|
|
whichDSF=$1
|
|
kBT=$2
|
|
target_sumrule=$3
|
|
N=$4
|
|
nk=$5
|
|
|
|
correlator='rho-rho'
|
|
if [[ $whichDSF == 'o' ]]; then
|
|
correlator='psidag-psi'
|
|
elif [[ $whichDSF == 'g' ]]; then
|
|
correlator='psi-psidag'
|
|
fi
|
|
|
|
mkdir -p logs
|
|
logfile='logs/run_c_scan_k_fixed_'$whichDSF'_kBT_'$kBT'_sr_'$target_sumrule'_N_'$N'_nk_'$nk'_'$(date '+%Y-%m-%d-%Hh%M')'.log'
|
|
touch $logfile
|
|
|
|
iK=$(($nk * $N/8))
|
|
|
|
Max_Secs=3600
|
|
refine=0
|
|
|
|
#clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625)
|
|
|
|
# List of interactions: fractional powers of 2
|
|
clist_raw=()
|
|
for nc in {-128..128}
|
|
do
|
|
clist_raw=($clist_raw $(( 4 * 2**($nc/16.) )))
|
|
done
|
|
# Now cast the integer values to true integers
|
|
zmodload zsh/mathfunc
|
|
clist=()
|
|
for c in $clist_raw
|
|
do
|
|
if [[ $((floor($c))) == $((ceil($c))) ]]; then
|
|
clist=($clist $((int($c))))
|
|
else
|
|
clist=($clist $c)
|
|
fi
|
|
done
|
|
|
|
basedir="$(pwd)"
|
|
|
|
for c in $clist
|
|
do
|
|
echo '** Starting run for c =' $c', N = '$N', k = '$nk'kF/4' | tee -a $logfile
|
|
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/data/N_'$N'/c_'$c
|
|
mkdir -p $dir
|
|
cd $dir
|
|
LiebLin_DSF $whichDSF $c $N $N $iK $iK $kBT $Max_Secs $target_sumrule $refine
|
|
cd $basedir
|
|
echo ' Successfully computed DSFs for c =' $c', N = '$N', k = '$nk'kF/4.\n' | tee -a $logfile
|
|
done
|
|
|
|
echo '\n\n*** Successfully completed build_LiebLin_c_scan_k_fixed on '$(date '+%Y-%m-%d-%Hh%M') | tee -a $logfile
|