QMCPACK
RPABFeeBreakup< T > Struct Template Reference
+ Collaboration diagram for RPABFeeBreakup< T >:

Public Member Functions

 RPABFeeBreakup ()
 
void reset (ParticleSet &ref)
 
void reset (ParticleSet &ref, T rs)
 
operator() (T r, T rinv) const
 
df (T r) const
 
Fk (T k, T rc) const
 
Xk (T k, T rc) const
 
integrate_r2 (T rc) const
 
Uk (T kk) const
 return RPA value at |k| More...
 
derivUk (T kk) const
 return d u(k)/d rs More...
 
urpa (T q) const
 
Dlindhard (T q, T w) const
 
Dlindhardp (T q, T w) const
 

Public Attributes

Rs
 
kf
 
kfm [2]
 
Density
 
volume
 
hbs2m
 
int nelec
 
int nspin
 
int nppss [2]
 

Detailed Description

template<class T = double>
struct qmcplusplus::RPABFeeBreakup< T >

Definition at line 489 of file LRBreakupUtilities.h.

Constructor & Destructor Documentation

◆ RPABFeeBreakup()

RPABFeeBreakup ( )
inline

Definition at line 500 of file LRBreakupUtilities.h.

500 {}

Member Function Documentation

◆ derivUk()

T derivUk ( kk) const
inline

return d u(k)/d rs

Implement a correct one

Definition at line 606 of file LRBreakupUtilities.h.

606 { return 0.0; }

◆ df()

T df ( r) const
inline

Definition at line 547 of file LRBreakupUtilities.h.

547 { return 0.0; }

◆ Dlindhard()

T Dlindhard ( q,
w 
) const
inline

Definition at line 620 of file LRBreakupUtilities.h.

References qmcplusplus::abs(), RPABFeeBreakup< T >::hbs2m, RPABFeeBreakup< T >::kfm, qmcplusplus::log(), RPABFeeBreakup< T >::nspin, and qmcplusplus::sqrt().

Referenced by RPABFeeBreakup< T >::Xk().

621  {
622  T xd1, xd2, small = 0.00000001, xdummy, rq1, rq2;
623  T res = 0.0;
624  for (int i = 0; i < nspin; i++)
625  {
626  if (kfm[i] > 0.0)
627  {
628  T xq = q / kfm[i];
629  if (xq < small)
630  xq = small;
631  T om = w / (kfm[i] * kfm[i] * hbs2m * 2.0);
632  xd1 = om / xq - xq / 2.0;
633  xd2 = om / xq + xq / 2.0;
634  if (std::abs(xd1 - 1.0) <= small)
635  {
636  if (xd1 >= 1.0)
637  xd1 = 1.0 + small;
638  else
639  xd1 = 1.0 - small;
640  }
641  else if (std::abs(xd2 - 1.0) <= small)
642  {
643  if (xd2 >= 1.0)
644  xd2 = 1.0 + small;
645  else
646  xd2 = 1.0 - small;
647  }
648 #if OHMMS_DIM == 3
649  rq1 = std::log(std::abs(1.0 + xd1) / std::abs(1.0 - xd1));
650  rq2 = std::log(std::abs(1.0 + xd2) / std::abs(1.0 - xd2));
651  xdummy = -1.0 + 0.5 * (1.0 - xd1 * xd1) / xq * rq1 - 0.50 * (1.0 - xd2 * xd2) / xq * rq2;
652  xdummy *= kfm[i] / (8.0 * M_PI * M_PI * hbs2m);
653 #elif OHMMS_DIM == 2
654  T sd1, sd2;
655  if (std::abs(xd1) < small)
656  sd1 = 0.0;
657  else
658  sd1 = xd1 / std::abs(xd1);
659  if (std::abs(xd2) < small)
660  sd2 = 0.0;
661  else
662  sd2 = xd2 / std::abs(xd2);
663  if (xd1 * xd1 - 1.0 > 1.0)
664  rq1 = std::sqrt(xd1 * xd1 - 1.0) * sd1;
665  else
666  rq1 = 0.0;
667  if (xd2 * xd2 - 1.0 > 1.0)
668  rq2 = std::sqrt(xd2 * xd2 - 1.0) * sd2;
669  else
670  rq2 = 0.0;
671  xdummy = -(xq + rq1 - rq2) / (4.0 * M_PI * xq * hbs2m);
672 #endif
673  res += xdummy;
674  }
675  }
676  return res;
677  }
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnLog, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t log(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ Dlindhardp()

T Dlindhardp ( q,
w 
) const
inline

Definition at line 680 of file LRBreakupUtilities.h.

References qmcplusplus::abs(), RPABFeeBreakup< T >::hbs2m, RPABFeeBreakup< T >::kfm, qmcplusplus::log(), RPABFeeBreakup< T >::nspin, and qmcplusplus::sqrt().

Referenced by RPABFeeBreakup< T >::Xk().

681  {
682  T xd1, xd2, small = 0.00000001, xdummy, rq1, rq2;
683  T res = 0.0;
684  for (int i = 0; i < nspin; i++)
685  {
686  if (kfm[i] > 0.0)
687  {
688  T xq = q / kfm[i];
689  if (xq < small)
690  xq = small;
691  T om = w / (kfm[i] * kfm[i] * hbs2m * 2.0);
692  xd1 = om / xq - xq / 2.0;
693  xd2 = om / xq + xq / 2.0;
694  if (std::abs(xd1 - 1.0) <= small)
695  {
696  if (xd1 >= 1.0)
697  xd1 = 1.0 + small;
698  else
699  xd1 = 1.0 - small;
700  }
701  else if (std::abs(xd2 - 1.0) <= small)
702  {
703  if (xd2 >= 1.0)
704  xd2 = 1.0 + small;
705  else
706  xd2 = 1.0 - small;
707  }
708 #if OHMMS_DIM == 3
709  rq1 = std::log(std::abs(1.0 + xd1) / std::abs(1.0 - xd1));
710  rq2 = std::log(std::abs(1.0 + xd2) / std::abs(1.0 - xd2));
711  xdummy = -xd1 / (xq * kfm[i] * kfm[i] * 2.0 * hbs2m) * rq1 + xd2 / (xq * kfm[i] * kfm[i] * 2.0 * hbs2m) * rq2;
712  xdummy *= kfm[i] / (8.0 * M_PI * M_PI * hbs2m * xq);
713 #elif OHMMS_DIM == 2
714  T sd1, sd2;
715  if (std::abs(xd1) < small)
716  sd1 = 0.0;
717  else
718  sd1 = xd1 / std::abs(xd1);
719  if (std::abs(xd2) < small)
720  sd2 = 0.0;
721  else
722  sd2 = xd2 / std::abs(xd2);
723  if (xd1 * xd1 - 1.0 > 1.0)
724  rq1 = sd1 * xd1 / std::sqrt(xd1 * xd1 - 1.0);
725  else
726  rq1 = 0.0;
727  if (xd2 * xd2 - 1.0 > 1.0)
728  rq2 = sd2 * xd2 / std::sqrt(xd2 * xd2 - 1.0);
729  else
730  rq2 = 0.0;
731  xdummy = -(rq1 - rq2) / (8.0 * M_PI * (xq * kfm[i] * hbs2m) * (xq * kfm[i] * hbs2m));
732 #endif
733  res += xdummy;
734  }
735  }
736  return res;
737  }
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnLog, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t log(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ Fk()

T Fk ( k,
rc 
) const
inline

Definition at line 549 of file LRBreakupUtilities.h.

References RPABFeeBreakup< T >::Xk().

549 { return -Xk(k, rc); }

◆ integrate_r2()

T integrate_r2 ( rc) const
inline

Definition at line 595 of file LRBreakupUtilities.h.

595 { return 0.0; }

◆ operator()()

T operator() ( r,
rinv 
) const
inline

Definition at line 545 of file LRBreakupUtilities.h.

545 { return 0.0; }

◆ reset() [1/2]

void reset ( ParticleSet ref)
inline

Definition at line 503 of file LRBreakupUtilities.h.

References RPABFeeBreakup< T >::Density, ParticleSet::first(), ParticleSet::getLattice(), ParticleSet::getTotalNum(), ParticleSet::groups(), RPABFeeBreakup< T >::hbs2m, RPABFeeBreakup< T >::kf, RPABFeeBreakup< T >::kfm, ParticleSet::last(), RPABFeeBreakup< T >::nelec, RPABFeeBreakup< T >::nppss, RPABFeeBreakup< T >::nspin, OHMMS_DIM, qmcplusplus::pow(), RPABFeeBreakup< T >::Rs, and RPABFeeBreakup< T >::volume.

504  {
505  volume = ref.getLattice().Volume;
506  nspin = ref.groups();
507  for (int i = 0; i < nspin; ++i)
508  nppss[i] = ref.last(i) - ref.first(i);
509  Density = ref.getTotalNum() / ref.getLattice().Volume;
510  Rs = std::pow(3.0 / (4.0 * M_PI * Density), 1.0 / 3.0);
511  nelec = ref.getTotalNum();
512  hbs2m = 0.5;
513  kf = 0.0;
514  kfm[0] = kfm[1] = 0.0;
515  for (int i = 0; i < nspin; i++)
516  {
517  T a3 = 3.0 * volume / (4.0 * M_PI * nppss[i]);
518  kfm[i] = std::pow(9.0 * M_PI / (2.0 * a3), 1.0 / OHMMS_DIM);
519  kf += kfm[i] * nppss[i] / ref.getTotalNum();
520  }
521  }
#define OHMMS_DIM
Definition: config.h:64
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)

◆ reset() [2/2]

void reset ( ParticleSet ref,
rs 
)
inline

Definition at line 524 of file LRBreakupUtilities.h.

References RPABFeeBreakup< T >::Density, ParticleSet::first(), ParticleSet::getLattice(), ParticleSet::getTotalNum(), ParticleSet::groups(), RPABFeeBreakup< T >::hbs2m, RPABFeeBreakup< T >::kf, RPABFeeBreakup< T >::kfm, ParticleSet::last(), RPABFeeBreakup< T >::nelec, RPABFeeBreakup< T >::nppss, RPABFeeBreakup< T >::nspin, OHMMS_DIM, qmcplusplus::pow(), RPABFeeBreakup< T >::Rs, and RPABFeeBreakup< T >::volume.

525  {
526  Density = ref.getTotalNum() / ref.getLattice().Volume;
527  volume = ref.getLattice().Volume;
528  nspin = ref.groups();
529  for (int i = 0; i < nspin; ++i)
530  nppss[i] = ref.last(i) - ref.first(i);
531  Rs = rs;
532  nelec = ref.getTotalNum();
533  hbs2m = 0.5;
534  kf = 0.0;
535  kfm[0] = kfm[1] = 0.0;
536  for (int i = 0; i < nspin; i++)
537  {
538  T a3 = 3.0 * volume / (4.0 * M_PI * nppss[i]);
539  kfm[i] = std::pow(9.0 * M_PI / (2.0 * a3), 1.0 / OHMMS_DIM);
540  kf += kfm[i] * nppss[i] / ref.getTotalNum();
541  }
542  }
#define OHMMS_DIM
Definition: config.h:64
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)

◆ Uk()

T Uk ( kk) const
inline

return RPA value at |k|

Parameters
kk|k|^2

Definition at line 600 of file LRBreakupUtilities.h.

600 { return 0.0; }

◆ urpa()

T urpa ( q) const
inline

Definition at line 608 of file LRBreakupUtilities.h.

References RPABFeeBreakup< T >::Density, RPABFeeBreakup< T >::hbs2m, and qmcplusplus::sqrt().

Referenced by RPABFeeBreakup< T >::Xk().

609  {
610  T a = 0.0, vkbare;
611  if (q > 0.0)
612  {
613  vkbare = 4.0 * M_PI / (q * q);
614  a = 2.0 * Density * vkbare / (hbs2m * q * q);
615  }
616  return -0.5 + 0.5 * std::sqrt(1.0 + a);
617  }
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ Xk()

T Xk ( k,
rc 
) const
inline

Definition at line 551 of file LRBreakupUtilities.h.

References qmcplusplus::asin(), RPABFeeBreakup< T >::Density, RPABFeeBreakup< T >::Dlindhard(), RPABFeeBreakup< T >::Dlindhardp(), RPABFeeBreakup< T >::hbs2m, RPABFeeBreakup< T >::kfm, RPABFeeBreakup< T >::nelec, RPABFeeBreakup< T >::nppss, RPABFeeBreakup< T >::nspin, OHMMS_DIM, qmcplusplus::pow(), qmcplusplus::sqrt(), RPABFeeBreakup< T >::urpa(), and RPABFeeBreakup< T >::volume.

Referenced by RPABFeeBreakup< T >::Fk().

552  {
553  T u = urpa(k) * volume / nelec;
554  T eq = k * k * hbs2m;
555  T vlr = u * u * 2.0 * Density * eq;
556  T vq = (2.0 * M_PI * (OHMMS_DIM - 1.0)) / (std::pow(k, OHMMS_DIM - 1.0));
557  T veff = vq - vlr;
558  T op2 = Density * 2.0 * vq * eq;
559 #if OHMMS_DIM == 3
560  // T op2kf=Density*2.0*(2.0*M_PI*(OHMMS_DIM-1.0))*hbs2m;
561  T op = (op2 + 1.2 * (kfm[0] * kfm[0] + kfm[1] * kfm[1]) * eq * hbs2m + eq * eq);
562 #elif OHMMS_DIM == 2
563  // T op2kf=Density*2.0*(2.0*M_PI*(OHMMS_DIM-1.0))*std::pow(kf,3.0-OHMMS_DIM)*hbs2m;
564  T op = (op2 + 1.5 * (kfm[0] * kfm[0] + kfm[1] * kfm[1]) * hbs2m * eq + eq * eq);
565 #endif
566  op = std::sqrt(op);
567  T denom = 1.0 / veff - Dlindhard(k, -eq);
568  T dp = -Dlindhardp(k, -eq);
569  T s0 = 0.0, ss = 0.0;
570  for (int i = 0; i < nspin; i++)
571  {
572  if (nppss[i] > 0)
573  {
574  T y = 0.5 * k / kfm[i];
575  if (y < 1.0)
576  {
577 #if OHMMS_DIM == 3
578  ss = 0.5 * y * (3.0 - y * y);
579 #elif OHMMS_DIM == 2
580  ss = (2.0 / M_PI) * (std::asin(y) + y * std::sqrt(1.0 - y * y));
581 #endif
582  }
583  else
584  {
585  ss = 1.0;
586  }
587  s0 += nppss[i] * ss / nelec;
588  }
589  }
590  T yq = s0 * s0 / (4.0 * k * k) * (1.0 / (eq * denom) + dp / (denom * denom)) +
591  2.0 * hbs2m * vlr / (op * (std::sqrt(op2) + eq));
592  return yq / volume;
593  }
#define OHMMS_DIM
Definition: config.h:64
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnArcSin, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t asin(const Vector< T1, C1 > &l)

Member Data Documentation

◆ Density

◆ hbs2m

◆ kf

T kf

Definition at line 492 of file LRBreakupUtilities.h.

Referenced by RPABFeeBreakup< T >::reset().

◆ kfm

◆ nelec

int nelec

Definition at line 497 of file LRBreakupUtilities.h.

Referenced by RPABFeeBreakup< T >::reset(), and RPABFeeBreakup< T >::Xk().

◆ nppss

int nppss[2]

Definition at line 499 of file LRBreakupUtilities.h.

Referenced by RPABFeeBreakup< T >::reset(), and RPABFeeBreakup< T >::Xk().

◆ nspin

◆ Rs

T Rs

Definition at line 491 of file LRBreakupUtilities.h.

Referenced by RPABFeeBreakup< T >::reset().

◆ volume

T volume

Definition at line 495 of file LRBreakupUtilities.h.

Referenced by RPABFeeBreakup< T >::reset(), and RPABFeeBreakup< T >::Xk().


The documentation for this struct was generated from the following file: