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.

ABACUS_Usage_Example_LiebLin.cc 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: ABACUS_Usage_Example_LiebLin.cc
  6. Purpose: examples of calculations for Lieb-Liniger
  7. ***********************************************************/
  8. #include "ABACUS.h"
  9. using namespace std;
  10. using namespace ABACUS;
  11. int main()
  12. {
  13. clock_t StartTime = clock();
  14. DP c_int = 25.0;
  15. DP L = 50.0;
  16. int N = 10;
  17. DP nbar_required = 1.0;
  18. DP kBT = 4.0;
  19. int Npts = 4*N;
  20. DP req_diff = 1.0e-4;
  21. int Max_Secs = 60;
  22. if (true) { // State-by-state checks
  23. DP c_int = 25.0;
  24. DP L = 50.0;
  25. int N = 10;
  26. LiebLin_Bethe_State gstate (c_int, L, N);
  27. gstate.Compute_All(true);
  28. cout << setprecision(16) << gstate << endl;
  29. LiebLin_Bethe_State estate (c_int, L, N-1);
  30. //estate.Set_to_ids (1LL, 1LL, 2LL, 0LL);
  31. //estate.Set_to_Label ("64_2_028ysn1", gstate.Ix2);
  32. //for (int i = 0; i < N; ++i) estate.Ix2[i] += 2;
  33. // estate.Ix2[0] -= 8;
  34. // estate.Ix2[1] -= 4;
  35. // estate.Ix2[N-3] += 2;
  36. // estate.Ix2[N-2] += 4;
  37. // estate.Ix2[N-1] += 6;
  38. // estate.Set_Label_from_Ix2(gstate.Ix2);
  39. estate.Compute_All(true);
  40. cout << setprecision(16) << estate << endl;
  41. //Scan_LiebLin ('o', estate, "28_3_i3y55yf3", -2*N, 2*N, 60, 1.0e+6, 0, 0, 1);
  42. //stringstream filenameprefix;
  43. //Data_File_Name (filenameprefix, 'd', -2*N, 2*N, 0.0, estate, estate, "28_3_i3y55yf3");
  44. //string prefix = filenameprefix.str();
  45. DP ommin = 0.0; DP ommax = 10.0; DP gwidth = 1.0;// meaningless
  46. int Nom = 10;
  47. DP normalization = twoPI * L;
  48. //Smoothen_RAW_into_SF (filenameprefix.str(), -2*N, 2*N, 0, ommin, ommax, Nom, gwidth, normalization, L);
  49. //Density-density matrix elements:
  50. // cout << setprecision(16) << "omega = " << estate.E - gstate.E << "\t"
  51. // << exp(real(ln_Density_ME(gstate, estate))) << "\t" << exp(real(ln_Density_ME(estate, gstate))) << endl;
  52. //Field operator matrix elements:
  53. // cout << "omega\tiK\t< estate | Psi | gstate > matrix element:" << endl;
  54. // cout << setprecision(16) << estate.E - gstate.E << "\t" << estate.iK - gstate.iK << "\t"
  55. // << exp(ln_Psi_ME(estate, gstate)) << endl;
  56. //LiebLin_Bethe_State flipstate = estate;
  57. //flipstate.Parity_Flip();
  58. //cout << "Flipping: " << endl;
  59. //cout << "omega = " << flipstate.E - gstate.E << "\t" << exp(real(ln_Density_ME(gstate, flipstate))) << endl;
  60. // Finite T checks:
  61. DP kBT = 1.0;
  62. // Delta is the number of sites involved in the smoothing of the entropy
  63. //int Delta = int(sqrt(N))/2;//6;//N/20;
  64. //DP epsilon = log(L)/L;
  65. DP epsilon = log(L)/L;
  66. // Construct the finite-size saddle-point state:
  67. //LiebLin_Bethe_State spstate = Canonical_Saddle_Point_State (c_int, L, N, kBT, Delta);
  68. //LiebLin_Bethe_State spstate = Canonical_Saddle_Point_State (c_int, L, N, kBT, epsilon);
  69. //spstate.Compute_All(true);
  70. //cout << spstate << endl;
  71. }
  72. clock_t StopTime = clock();
  73. //cout << "Total time: " << (StopTime - StartTime)/*/CLOCKS_PER_SEC*/ << " hundreths of a second."
  74. cout << "Total time: " << DP(StopTime - StartTime)/CLOCKS_PER_SEC << " seconds."
  75. << endl;
  76. return(0);
  77. }