IM-SRG++  0
imsrg_util.hh
1 #ifndef imsrg_util_hh
2 #define imsrg_util_hh 1
3 
4 #include "ModelSpace.hh"
5 #include "Operator.hh"
6 #include "HartreeFock.hh"
7 #include "IMSRGSolver.hh"
8 #include <gsl/gsl_math.h>
9 #include <gsl/gsl_sf_laguerre.h>
10 #include <gsl/gsl_sf_gamma.h>
11 #include <vector>
12 
13 #define HBARC 197.3269718 // hc in MeV * fm
14 #define M_NUCLEON 938.9185 // average nucleon mass in MeV
15 
16 namespace imsrg_util
17 {
18  Operator OperatorFromString(ModelSpace& modelspace, string str);
19  map<index_t,double> GetSecondOrderOccupations(Operator& H, int emax);
20 
21  Operator NumberOp(ModelSpace& modelspace, int n, int l, int j2, int tz2);
22  Operator NumberOpAlln(ModelSpace& modelspace, int l, int j2, int tz2);
23  Operator PSquaredOp(ModelSpace& modelspace);
24  Operator RSquaredOp(ModelSpace& modelspace);
25  Operator E0Op(ModelSpace& modelspace);
26  Operator ElectricMultipoleOp(ModelSpace& modelspace, int L);
27  Operator MagneticMultipoleOp(ModelSpace& modelspace, int L);
28  Operator MagneticMultipoleOp_pn(ModelSpace& modelspace, int L, string pn);
29  Operator Trel_Op(ModelSpace& modelspace);
30  Operator TCM_Op(ModelSpace& modelspace);
31  Operator HCM_Op(ModelSpace& modelspace);
32 
33  Operator R2CM_Op(ModelSpace& modelspace);
34  Operator Rp2_corrected_Op(ModelSpace& modelspace, int A, int Z);
35  Operator Rn2_corrected_Op(ModelSpace& modelspace, int A, int Z);
36  Operator Rm2_corrected_Op(ModelSpace& modelspace, int A, int Z);
37  Operator R2_p1_Op(ModelSpace& modelspace);
38  Operator R2_1body_Op(ModelSpace& modelspace, string option);
39  Operator R2_p2_Op(ModelSpace& modelspace);
40  Operator R2_2body_Op(ModelSpace& modelspace, string option);
41  Operator ProtonDensityAtR(ModelSpace& modelspace, double R);
42  Operator NeutronDensityAtR(ModelSpace& modelspace, double R);
43  Operator RpSpinOrbitCorrection(ModelSpace& modelspace);
44  Operator FourierBesselCoeff(ModelSpace& modelspace, int nu, double R, vector<index_t> index_list);
45 
46  Operator Isospin2_Op(ModelSpace& modelspace);
47  Operator AllowedFermi_Op(ModelSpace& modelspace);
49  Operator Sigma_Op(ModelSpace& modelspace);
50  Operator Sigma_Op_pn(ModelSpace& modelspace, string pn);
51  Operator RadialOverlap(ModelSpace& modelspace);
52  Operator LdotS_Op(ModelSpace& modelspace);
53 
54  Operator Single_Ref_1B_Density_Matrix(ModelSpace& modelspace); // This doesn't work
55  double Get_Charge_Density(Operator& DM, double r); // This doesn't work
56 
57 
58  double Calculate_p1p2(ModelSpace& modelspace, Ket & bra, Ket & ket, int J);
59  void Calculate_p1p2_all(Operator& OpIn);
60  double Calculate_r1r2(ModelSpace& modelspace, Ket & bra, Ket & ket, int J);
61  double HO_density(int n, int l, double hw, double r);
62  double HO_Radial_psi(int n, int l, double hw, double r);
63  double RadialIntegral(int na, int la, int nb, int lb, int L);
64  double RadialIntegral_RpowK(int na, int la, int nb, int lb, int k);
65  double TalmiI(int p, double k);
66  double TalmiB(int na, int la, int nb, int lb, int p);
67  vector<double> GetOccupationsHF(HartreeFock& hf);
68  vector<double> GetOccupations(HartreeFock& hf, IMSRGSolver& imsrgsolver);
69  vector<double> GetDensity(vector<double>& occ, vector<double>& R, vector<int>& orbits, ModelSpace& modelspace);
70 
71  void Embed1BodyIn2Body(Operator& op1, int A);
72  double GetEmbeddedTBME(Operator& op1, index_t i, index_t j, index_t k, index_t l, int Jbra,int Jket, int Lambda);
73 
74  double FrequencyConversionCoeff(int n1, int l1, double hw1, int n2, int l2, double hw2);
75 
76  void CommutatorTest(Operator& X, Operator& Y);
77  void Reduce(Operator&);
78  void UnReduce(Operator&);
79 
80 
81 // Templated functions need to be defined in the header file (or else explicitly declared in the .cc file).
82  template <typename T>
83  T VectorUnion(T& v1)
84  {
85  return v1;
86  }
87 
88  template <typename T, typename... Args>
89  T VectorUnion(T& v1, T& v2, Args... args)
90  {
91  T vec(v1.size()+v2.size());
92  copy(v1.begin(),v1.end(),vec.begin());
93  copy(v2.begin(),v2.end(),vec.begin()+v1.size());
94  return VectorUnion(vec, args...);
95  }
96 
97 }
98 
99 
100 
101 
102 #endif
Definition: Operator.hh:21
Operator R2_2body_Op(ModelSpace &modelspace, string option)
Definition: imsrg_util.cc:906
Operator Isospin2_Op(ModelSpace &modelspace)
Returns the operator.
Definition: imsrg_util.cc:1049
Definition: HartreeFock.hh:11
imsrg_util namespace. Used to define some helpful functions.
Definition: imsrg_util.cc:11
Operator Sigma_Op_pn(ModelSpace &modelspace, string pn)
Pauli spin operator .
Definition: imsrg_util.cc:1320
Definition: IMSRGSolver.hh:16
Operator TCM_Op(ModelSpace &modelspace)
Definition: imsrg_util.cc:293
void Embed1BodyIn2Body(Operator &op1, int A)
Definition: imsrg_util.cc:1430
Operator Trel_Op(ModelSpace &modelspace)
Definition: imsrg_util.cc:273
Operator ElectricMultipoleOp(ModelSpace &modelspace, int L)
Definition: imsrg_util.cc:1125
Operator Sigma_Op(ModelSpace &modelspace)
Pauli spin operator .
Definition: imsrg_util.cc:1314
double TalmiB(int na, int la, int nb, int lb, int p)
Definition: imsrg_util.cc:1242
double GetEmbeddedTBME(Operator &op1, index_t i, index_t j, index_t k, index_t l, int Jbra, int Jket, int Lambda)
Definition: imsrg_util.cc:1470
double Calculate_r1r2(ModelSpace &modelspace, Ket &bra, Ket &ket, int J)
Definition: imsrg_util.cc:696
double RadialIntegral(int na, int la, int nb, int lb, int L)
Definition: imsrg_util.cc:1198
Operator MagneticMultipoleOp(ModelSpace &modelspace, int L)
Returns a reduced magnetic multipole operator with units fm .
Definition: imsrg_util.cc:1147
Operator E0Op(ModelSpace &modelspace)
Definition: imsrg_util.cc:979
Definition: ModelSpace.hh:157
Operator HCM_Op(ModelSpace &modelspace)
Definition: imsrg_util.cc:811
Operator R2CM_Op(ModelSpace &modelspace)
Definition: imsrg_util.cc:622
Operator RSquaredOp(ModelSpace &modelspace)
Definition: imsrg_util.cc:826
Operator MagneticMultipoleOp_pn(ModelSpace &modelspace, int L, string pn)
Definition: imsrg_util.cc:1155
Operator AllowedGamowTeller_Op(ModelSpace &modelspace)
Definition: imsrg_util.cc:1291
Operator Rp2_corrected_Op(ModelSpace &modelspace, int A, int Z)
Definition: imsrg_util.cc:676
Operator R2_1body_Op(ModelSpace &modelspace, string option)
Definition: imsrg_util.cc:864
Definition: ModelSpace.hh:51
double Calculate_p1p2(ModelSpace &modelspace, Ket &bra, Ket &ket, int J)
Definition: imsrg_util.cc:380
double TalmiI(int p, double k)
Definition: imsrg_util.cc:1234