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.

Smoothen_LiebLin_DSF_GeneralState.cc 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: Smoothen_LiebLin_DSF_GeneralState.cc
  6. Purpose: produces .dsf and .ssf files from a .raw file
  7. ***********************************************************/
  8. #include "ABACUS.h"
  9. using namespace std;
  10. using namespace ABACUS;
  11. int main(int argc, char* argv[])
  12. {
  13. if (argc != 13) { // Print out instructions
  14. cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl;
  15. cout << endl << "Usage of Smoothen_LiebLin_DSF executable: " << endl;
  16. cout << endl << "Provide the following arguments:" << endl << endl;
  17. cout << "char whichDSF \t\t Which structure factor should be calculated ? Options are: "
  18. "d for rho rho, g for psi psi{dagger}, o for psi{dagger} psi" << endl;
  19. cout << "DP c_int \t\t Value of the interaction parameter" << endl;
  20. cout << "DP L \t\t\t Length of the system" << endl;
  21. cout << "int N \t\t\t Number of particles" << endl;
  22. cout << "char* defaultScanStatename:\t\t file [].Ix2 contains the quantum numbers defining the "
  23. "AveragingState; used as defaultScanStatename" << endl;
  24. cout << "int iKmin" << endl << "int iKmax \t\t Min and max momentum integers" << endl;
  25. cout << "int DiK \t\t\t Window of iK over which DSF is averaged (DiK == 0 means a single iK is used; "
  26. "DiK == 1 means 3 are used (iK-1, iK, iK+1), etc.)" << endl;
  27. cout << "DP ommin" << endl << "DP ommax \t\t Min and max frequencies to cover in smoothened DSF" << endl;
  28. cout << "Nom \t\t\t Number of frequency points used for discretization" << endl;
  29. cout << "DP width \t\t Gaussian width used in smoothing, in units of two-particle level spacing" << endl;
  30. cout << endl << "EXAMPLE: " << endl << endl;
  31. cout << "Smoothen_LiebLin_DSF d 1.0 100.0 100 0 200 5.0 1 0.0 10.0 500 2.0" << endl << endl;
  32. }
  33. else if (argc == 13) { // !fixed_iK
  34. int n = 1;
  35. char whichDSF = *argv[n++];
  36. DP c_int = atof(argv[n++]);
  37. DP L = atof(argv[n++]);
  38. int N = atoi(argv[n++]);
  39. char* Ix2filenameprefix = argv[n++];
  40. int iKmin = atoi(argv[n++]);
  41. int iKmax = atoi(argv[n++]);
  42. DP kBT = 0.0;
  43. int DiK = atoi(argv[n++]);
  44. DP ommin = atof(argv[n++]);
  45. DP ommax = atof(argv[n++]);
  46. int Nom = atoi(argv[n++]);
  47. DP width = atof(argv[n++]);
  48. stringstream filenamestrstream;
  49. filenamestrstream << Ix2filenameprefix;
  50. string defaultScanStatename = filenamestrstream.str();
  51. stringstream filenameprefix;
  52. Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, defaultScanStatename);
  53. string prefix = filenameprefix.str();
  54. DP normalization = twoPI * L;
  55. DP denom_sum_K = L;
  56. Write_K_File (L, iKmin, iKmax);
  57. Write_Omega_File (Nom, ommin, ommax);
  58. // We use the scaled width function as default:
  59. DP sumcheck;
  60. sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, 0.0, ommin, ommax, Nom, width, normalization, denom_sum_K);
  61. }
  62. /*
  63. else if (argc == 11) { // fixed_iK
  64. char whichDSF = *argv[1];
  65. DP c_int = atof(argv[2]);
  66. DP L = atof(argv[3]);
  67. int N = atoi(argv[4]);
  68. int iK_UL = atoi(argv[5]);
  69. int iKneeded = atoi(argv[6]);
  70. DP ommin = atof(argv[7]);
  71. DP ommax = atof(argv[8]);
  72. int Nom = atoi(argv[9]);
  73. DP gwidth = atof(argv[10]);
  74. //bool fixed_iK = true;
  75. //LiebLin_Bethe_State GroundState (c_int, L, N, iK_UL, 0LL);
  76. stringstream filenameprefix;
  77. //Data_File_Name (filenameprefix, whichDSF, fixed_iK, iKneeded, GroundState, GroundState);
  78. //Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iK_UL, fixed_iK, iKneeded, 0.0);
  79. Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iK_UL, iKneeded, iKneeded, 0.0);
  80. string prefix = filenameprefix.str();
  81. DP normalization = twoPI * L;
  82. int iKmin = iKneeded;
  83. int iKmax = iKneeded;
  84. cout << "Smoothing: sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, 0.0, ommin, ommax, Nom, gwidth, normalization) << endl;
  85. }
  86. */
  87. return(0);
  88. }