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

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