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_Utils.cc 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**********************************************************
  2. This software is part of J.-S. Caux's ABACUS library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: LiebLin_Utils.cc
  6. Purpose: Utilities for Lieb-Liniger gas
  7. ***********************************************************/
  8. #include "ABACUS.h"
  9. using namespace std;
  10. namespace ABACUS {
  11. DP LiebLin_dE0_dc (DP c_int, DP L, int N)
  12. {
  13. LiebLin_Bethe_State groundstate (c_int, L, N);
  14. groundstate.Compute_All(true);
  15. DP dc_int = 1.0e-5 * c_int;
  16. LiebLin_Bethe_State groundstate_2 (c_int + dc_int, L, N);
  17. groundstate_2.Compute_All(true);
  18. return((groundstate_2.E - groundstate.E)/dc_int);
  19. }
  20. DP LiebLin_vs (DP c_int, DP L, int N)
  21. {
  22. LiebLin_Bethe_State gstate (c_int, L, N);
  23. gstate.Compute_All(true);
  24. DP Egs = gstate.E;
  25. gstate.Ix2[N-1] += 2;
  26. gstate.Compute_All(false);
  27. return((gstate.E - Egs) * L/twoPI);
  28. }
  29. DP LiebLin_Dressed_Charge_N (DP c_int, DP L, int N)
  30. {
  31. LiebLin_Bethe_State gstate(c_int, L, N);
  32. gstate.Compute_All(true);
  33. return(twoPI/(c_int * L * (gstate.lambdaoc[N-1] - gstate.lambdaoc[N-2]))); // lambda in units of c within code
  34. }
  35. // For computation of threshold exponents:
  36. int Momentum_Right_Excitations (LiebLin_Bethe_State& ScanState)
  37. {
  38. // Calculates the momentum of the excitations on the right of Fermi
  39. // surface, discarding the rightmost excitation.
  40. int nr = 0;
  41. for (int i = ScanState.N - 2; i >= ScanState.N/2; --i)
  42. if (ScanState.Ix2[i] >= 0) nr += (ScanState.Ix2[i] + ScanState.N - 1 - 2*i)/2;
  43. return(nr);
  44. }
  45. int Momentum_Left_Excitations (LiebLin_Bethe_State& ScanState)
  46. {
  47. // Calculates the momentum of the excitations on the left of Fermi
  48. // surface, discarding the rightmost excitation.
  49. int nl = 0;
  50. for (int i = 0; i < ScanState.N/2; ++i)
  51. if (ScanState.Ix2[i] < 0) nl -= (ScanState.Ix2[i] + ScanState.N - 1 - 2*i)/2;
  52. return(nl);
  53. }
  54. DP ln_Overlap_with_BEC (LiebLin_Bethe_State& lambda) // Note: factorial approximated with Lanczos
  55. {
  56. int N = lambda.N;
  57. int L = lambda.L;
  58. DP c_int = lambda.c_int;
  59. // The overlap identically vanishes if the state is not parity invariant:
  60. if (!lambda.Check_Symmetry()) return(-300.0);
  61. SQMat_DP Gaudin( N);
  62. SQMat_DP Gaudin_Quench( N/2);
  63. lambda.Build_Reduced_Gaudin_Matrix ( Gaudin);
  64. lambda.Build_Reduced_BEC_Quench_Gaudin_Matrix (Gaudin_Quench);
  65. DP ln_prefactor = N/2.0 * log(2./(c_int*L) ) + 0.5 * real(ln_Gamma(complex<double>(N+1.0)));
  66. for(int i =N/2; i<N; i ++)
  67. ln_prefactor -= log(fabs(lambda.lambdaoc[i ])) + 0.5*log( 1. + 4. * lambda.lambdaoc[i ]*lambda.lambdaoc[i ]) ;
  68. return (ln_prefactor + real(lndet_LU_dstry(Gaudin_Quench)) - 0.5 * real(lndet_LU_dstry(Gaudin)));
  69. }
  70. }