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.

LiebLin_DSF_MosesState.cc 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: LiebLin_DSF.cc
  6. Purpose: main function for ABACUS for LiebLin gas
  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) { // provide some info
  14. cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl;
  15. cout << endl << "Usage of LiebLin_DSF_MosesState 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: use positive real values only" << endl;
  19. cout << "DP L \t\t\t Length of the system: use positive real values only" << endl;
  20. cout << "int N \t\t\t Number of particles: use positive integer values only" << endl;
  21. cout << "int Nl \t\t\t Number of particles in left Fermi sea (Nr is then N - Nl)" << endl;
  22. cout << "int DIl \t\t shift of left sea as compared to its ground state position" << endl;
  23. cout << "int DIr \t\t shift of right sea as compared to its ground state position" << endl;
  24. cout << "int iKmin" << endl << "int iKmax \t\t Min and max momentum integers to scan over: recommended values: -2*N and 2*N" << endl;
  25. //cout << "DP kBT \t\t Temperature (positive only of course)" << endl;
  26. cout << "int Max_Secs \t\t Allowed computational time: (in seconds)" << endl;
  27. cout << "DP target_sumrule \t sumrule saturation you're satisfied with" << endl;
  28. cout << "bool refine \t\t Is this a refinement of earlier calculations ? (0 == false, 1 == true)" << endl;
  29. cout << endl << "EXAMPLE: " << endl << endl;
  30. cout << "LiebLin_DSF_MosesState d 1.0 100.0 100 50 -30 20 0 200 600 1.0 0" << endl << endl;
  31. }
  32. else { // (argc == 13), correct nr of arguments
  33. char whichDSF = *argv[1];
  34. DP c_int = atof(argv[2]);
  35. DP L = atof(argv[3]);
  36. int N = atoi(argv[4]);
  37. int Nl = atoi(argv[5]);
  38. //int Nr = N - Nl;
  39. int DIl = atoi(argv[6]);
  40. int DIr = atoi(argv[7]);
  41. int iKmin = atoi(argv[8]);
  42. int iKmax = atoi(argv[9]);
  43. //DP kBT = atof(argv[7]);
  44. int Max_Secs = atoi(argv[10]);
  45. DP target_sumrule = atof(argv[11]);
  46. bool refine = (atoi(argv[12]) == 1);
  47. // Define the Moses state:
  48. LiebLin_Bethe_State MosesState (c_int, L, N);
  49. // Split the sea:
  50. for (int i = 0; i < Nl; ++i) MosesState.Ix2[i] += 2 * DIl;
  51. for (int i = Nl; i < N; ++i) MosesState.Ix2[i] += 2 * DIr;
  52. MosesState.Compute_All (true);
  53. //cout << MosesState << endl;
  54. // Handy default name:
  55. stringstream defaultScanStatename_strstream;
  56. defaultScanStatename_strstream << "Moses_Nl_" << Nl << "_DIl_" << DIl << "_DIr_" << DIr;
  57. string defaultScanStatename = defaultScanStatename_strstream.str();
  58. // Compute the correlation:
  59. Scan_LiebLin (whichDSF, MosesState, defaultScanStatename, iKmin, iKmax, Max_Secs, target_sumrule, refine);
  60. }
  61. return(0);
  62. }