You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build_LiebLin_c_scan_k_range.sh 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #! /bin/zsh
  2. # For given N (L), this
  3. # computes the required DSF (up to required sumrule)
  4. # over a range of values of c_int.
  5. # The data can then be used to produce animated graphs (with c_int evolving),
  6. # see the `build_LiebLin_c_scan_k_range_dsfs[_plot]` scripts.
  7. if [[ $# -ne 5 ]]; then
  8. echo "Arguments needed: whichDSF, kBT, target_sumrule, N, nkmax (max momentum in units of kF/4)."
  9. exit 1
  10. fi
  11. if [[ $1 != 'd' && $1 != 'g' && $1 != 'o' ]]; then
  12. echo "Only the d, g and o scanning options are implemented."
  13. exit 1
  14. fi
  15. if [[ $2 -lt 0 ]]; then
  16. echo "Temperature kBT must be > 0."
  17. exit 1
  18. fi
  19. if [[ $3 -lt 0 || $3 -gt 1 ]]; then
  20. echo "Requirement: 0 < target_sumrule < 1."
  21. exit 1
  22. fi
  23. if [[ $4 -lt 0 ]]; then
  24. echo "N must be > 0."
  25. exit 1
  26. fi
  27. if [[ $5 -lt 0 ]]; then
  28. echo "nkmax must be > 0."
  29. exit 1
  30. fi
  31. whichDSF=$1
  32. kBT=$2
  33. target_sumrule=$3
  34. N=$4
  35. nkmax=$5
  36. correlator='rho-rho'
  37. if [[ $whichDSF == 'o' ]]; then
  38. correlator='psidag-psi'
  39. elif [[ $whichDSF == 'g' ]]; then
  40. correlator='psi-psidag'
  41. fi
  42. mkdir -p logs
  43. logfile='logs/run_c_scan_k_range_'$whichDSF'_kBT_'$kBT'_sr_'$target_sumrule'_N_'$N'_nkmax_'$nkmax'_'$(date '+%Y-%m-%d-%Hh%M')'.log'
  44. touch $logfile
  45. iKmax=$(($nkmax * $N/8))
  46. Max_Secs=3600
  47. refine=0
  48. #clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625)
  49. # List of interactions: fractional powers of 2
  50. clist_raw=()
  51. for nc in {-128..128}
  52. do
  53. clist_raw=($clist_raw $(( 4 * 2**($nc/16.) )))
  54. done
  55. # Now cast the integer values to true integers
  56. zmodload zsh/mathfunc
  57. clist=()
  58. for c in $clist_raw
  59. do
  60. if [[ $((floor($c))) == $((ceil($c))) ]]; then
  61. clist=($clist $((int($c))))
  62. else
  63. clist=($clist $c)
  64. fi
  65. done
  66. basedir="$(pwd)"
  67. for c in $clist
  68. do
  69. echo '** Starting run for c =' $c', N = '$N | tee -a $logfile
  70. dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan/k_range/k_0_to_'${(l:2::0:)nkmax}'kFo4/sr_'$target_sumrule'/store/data/N_'$N'/c_'$c
  71. mkdir -p $dir
  72. cd $dir
  73. LiebLin_DSF $whichDSF $c $N $N 0 $iKmax $kBT $Max_Secs $target_sumrule $refine
  74. cd $basedir
  75. echo ' Successfully computed DSFs for c =' $c', N = '$N'.\n' | tee -a $logfile
  76. done
  77. echo '\n\n*** Successfully completed build_LiebLin_c_scan_k_range on '$(date '+%Y-%m-%d-%Hh%M') | tee -a $logfile