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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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: d for rho rho, g for psi psi{dagger}, o for psi{dagger} psi" << endl;
  18. cout << "DP c_int \t\t Value of the interaction parameter" << endl;
  19. cout << "DP L \t\t\t Length of the system" << endl;
  20. cout << "int N \t\t\t Number of particles" << endl;
  21. cout << "char* defaultScanStatename:\t\t file [].Ix2 contains the quantum numbers defining the AveragingState; used as defaultScanStatename" << endl;
  22. cout << "int iKmin" << endl << "int iKmax \t\t Min and max momentum integers" << endl;
  23. //cout << "DP kBT \t\t Temperature" << endl;
  24. cout << "int DiK \t\t\t Window of iK over which DSF is averaged (DiK == 0 means a single iK is used; DiK == 1 means 3 are used (iK-1, iK, iK+1), etc.)" << endl;
  25. cout << "DP ommin" << endl << "DP ommax \t\t Min and max frequencies to cover in smoothened DSF" << endl;
  26. cout << "Nom \t\t\t Number of frequency points used for discretization" << endl;
  27. cout << "DP width \t\t Gaussian width used in smoothing, in units of two-particle level spacing" << endl;
  28. cout << endl << "EXAMPLE: " << endl << endl;
  29. cout << "Smoothen_LiebLin_DSF d 1.0 100.0 100 0 200 5.0 1 0.0 10.0 500 2.0" << endl << endl;
  30. }
  31. else if (argc == 13) { // !fixed_iK
  32. int n = 1;
  33. char whichDSF = *argv[n++];
  34. DP c_int = atof(argv[n++]);
  35. DP L = atof(argv[n++]);
  36. int N = atoi(argv[n++]);
  37. char* Ix2filenameprefix = argv[n++];
  38. int iKmin = atoi(argv[n++]);
  39. int iKmax = atoi(argv[n++]);
  40. //DP kBT = atof(argv[7]);
  41. DP kBT = 0.0;
  42. int DiK = atoi(argv[n++]);
  43. DP ommin = atof(argv[n++]);
  44. DP ommax = atof(argv[n++]);
  45. int Nom = atoi(argv[n++]);
  46. DP width = atof(argv[n++]);
  47. stringstream filenamestrstream;
  48. filenamestrstream << Ix2filenameprefix;
  49. string defaultScanStatename = filenamestrstream.str();
  50. stringstream filenameprefix;
  51. //void Data_File_Name (stringstream& name, char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, DP L2)
  52. //Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, "");
  53. Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, defaultScanStatename);
  54. string prefix = filenameprefix.str();
  55. DP normalization = twoPI * L;
  56. DP denom_sum_K = L;
  57. Write_K_File (L, iKmin, iKmax);
  58. Write_Omega_File (Nom, ommin, ommax);
  59. //cout << "Smoothing: sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, width, normalization) << endl;
  60. // We use the scaled width function as default:
  61. DP sumcheck;
  62. //if (kBT < 0.1)
  63. //sumcheck = Smoothen_RAW_into_SF_LiebLin_Scaled (prefix, L, N, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization);
  64. sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization, denom_sum_K);
  65. //else sumcheck = Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, width, normalization);
  66. //cout << "Smoothing: sumcheck = " << sumcheck << endl;
  67. }
  68. /*
  69. else if (argc == 11) { // fixed_iK
  70. char whichDSF = *argv[1];
  71. DP c_int = atof(argv[2]);
  72. DP L = atof(argv[3]);
  73. int N = atoi(argv[4]);
  74. int iK_UL = atoi(argv[5]);
  75. int iKneeded = atoi(argv[6]);
  76. DP ommin = atof(argv[7]);
  77. DP ommax = atof(argv[8]);
  78. int Nom = atoi(argv[9]);
  79. DP gwidth = atof(argv[10]);
  80. //bool fixed_iK = true;
  81. //LiebLin_Bethe_State GroundState (c_int, L, N, iK_UL, 0LL);
  82. stringstream filenameprefix;
  83. //Data_File_Name (filenameprefix, whichDSF, fixed_iK, iKneeded, GroundState, GroundState);
  84. //Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iK_UL, fixed_iK, iKneeded, 0.0);
  85. Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iK_UL, iKneeded, iKneeded, 0.0);
  86. string prefix = filenameprefix.str();
  87. DP normalization = twoPI * L;
  88. int iKmin = iKneeded;
  89. int iKmax = iKneeded;
  90. cout << "Smoothing: sumcheck = " << Smoothen_RAW_into_SF (prefix, iKmin, iKmax, ommin, ommax, Nom, gwidth, normalization) << endl;
  91. }
  92. */
  93. //else ABACUSerror("Wrong number of arguments to Smoothen_LiebLin_DSF executable.");
  94. return(0);
  95. }