Skip to content

Commit 59156c9

Browse files
authored
Merge pull request #14 from scarrazza/bubblederivative
Bubble derivative
2 parents af35d18 + a3c5b45 commit 59156c9

File tree

4 files changed

+144
-1
lines changed

4 files changed

+144
-1
lines changed

src/bubble.cc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,73 @@ namespace ql
217217
res[2] = this->_czero;
218218
}
219219

220+
/*!
221+
* Computes the Bubble derivative.
222+
* Implementation of the formulae from Eq. (4.25) of A. Denner, arXiv:0709.1075.
223+
*
224+
* \param res output object res[0,1,2] the coefficients in the Laurent series
225+
* \param mu2 is the squre of the scale mu
226+
* \param m are the squares of the masses of the internal lines
227+
* \param p are the four-momentum squared of the external lines
228+
*/
229+
template<typename TOutput, typename TMass, typename TScale>
230+
void Bubble<TOutput,TMass,TScale>::derivative(vector<TOutput> &res,
231+
const TScale& mu2,
232+
vector<TMass> const& m,
233+
vector<TScale> const& p)
234+
{
235+
if (mu2 < 0)
236+
throw RangeError("Bubble::derivative","mu2 is negative!");
237+
238+
if ((Real(m[0]) < 0 || Real(m[1]) < 0) || (Imag(m[0]) > 0 || Imag(m[1]) > 0))
239+
throw RangeError("Bubble::derivative","Real masses must be positive, imag. negative");
240+
241+
if (res.size() != 3) { res.reserve(3); }
242+
std::fill(res.begin(), res.end(), this->_czero);
243+
244+
if (this->iszero(p[0]))
245+
{
246+
if (this->iszero(Abs(m[0])) && this->iszero(Abs(m[1])))
247+
return;
248+
if (this->iszero(Abs(m[0])-Abs(m[1])))
249+
res[0] = this->_cone / (6.0 * m[0]);
250+
}
251+
else
252+
{
253+
if (this->iszero(Abs(m[0])) && this->iszero(Abs(m[1])))
254+
res[0] = - this->_cone / p[0];
255+
else if (this->iszero(Min(m[0], m[1])))
256+
{
257+
TMass msq;
258+
if (Abs(m[0]) >= Abs(m[1])) msq = m[0];
259+
else msq = m[1];
260+
261+
if (this->iszero(Abs(p[0] - msq)))
262+
{
263+
res[1] = - this->_chalf / msq;
264+
res[0] = - this->_chalf / msq * this->Lnrat(mu2, msq) - this->_cone / msq;
265+
}
266+
else
267+
res[0] = - (this->_cone + msq / p[0] * this->Lnrat(msq - p[0], msq)) / p[0];
268+
}
269+
else
270+
{
271+
const TMass a = Sqrt(m[0] * m[1]);
272+
const TMass c = a;
273+
const TOutput b = m[0] + m[1] - TMass(p[0]) - this->_ieps;
274+
const TOutput root = Sqrt(Pow(b, 2) - this->_cfour*a*c);
275+
const TOutput sgn = TOutput(Sign(Real( Conjg(b) * root)));
276+
const TOutput q = this->_chalf * (b + sgn*root);
277+
const TOutput rm = q / a;
278+
const TOutput r = rm;
279+
res[0] = - this->_chalf * (m[0] - m[1]) / Pow(p[0], 2) * Log(m[1]/m[0]) +
280+
Sqrt(m[0] * m[1]) / Pow(p[0], 2) * (this->_cone / r - r) * Log(r)
281+
- (1.0 + (Pow(r, 2) + this->_cone) / (Pow(r, 2) - this->_cone) * Log(r)) / p[0];
282+
}
283+
}
284+
return;
285+
}
286+
220287
// explicity tyoename declaration
221288
template class Bubble<complex,double,double>;
222289
template class Bubble<complex,complex,double>;

src/qcdloop/bubble.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@ namespace ql
4343

4444
//! Special configuration I(0;m0,m1)
4545
void BB5(vector<TOutput> &res, TScale const& mu2, TMass const& m0, TMass const& m1) const;
46+
47+
//! Computes the Bubble derivative
48+
void derivative(vector<TOutput> &res, TScale const& mu2, vector<TMass> const& m, vector<TScale> const& p);
4649
};
4750
}

src/qcdloop/wrapper.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ extern"C" {
5555
qcomplex qli2q_(qdouble const& p1, qdouble const& m1, qdouble const& m2, qdouble const& mu2, int const& ep);
5656
qcomplex qli2qc_(qdouble const& p1, qcomplex const& m1, qcomplex const& m2, qdouble const& mu2, int const& ep);
5757

58+
complex qli2p_(double const& p1, double const& m1, double const& m2, double const& mu2, int const& ep);
59+
complex qli2pc_(double const& p1, complex const& m1, complex const& m2, double const& mu2, int const& ep);
60+
qcomplex qli2pq_(qdouble const& p1, qdouble const& m1, qdouble const& m2, qdouble const& mu2, int const& ep);
61+
qcomplex qli2pqc_(qdouble const& p1, qcomplex const& m1, qcomplex const& m2, qdouble const& mu2, int const& ep);
62+
5863
complex qli3_(double const& p1, double const& p2, double const& p3, double const& m1, double const& m2, double const& m3, double const& mu2, int const& ep);
5964
complex qli3c_(double const& p1, double const& p2, double const& p3, complex const& m1, complex const& m2, complex const& m3, double const& mu2, int const& ep);
6065
qcomplex qli3q_(qdouble const& p1, qdouble const& p2, qdouble const& p3, qdouble const& m1, qdouble const& m2, qdouble const& m3, qdouble const& mu2, int const& ep);

src/wrapper.cc

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ void qlboxcq_(qcomplex (&out)[3], qdouble const& mu2, qcomplex const& m1, qcompl
533533
{
534534
std::cout << e.what() << std::endl;
535535
exit(-1);
536-
}
536+
}
537537
return r[abs(ep)];
538538
}
539539

@@ -588,6 +588,74 @@ void qlboxcq_(qcomplex (&out)[3], qdouble const& mu2, qcomplex const& m1, qcompl
588588
return rq[abs(ep)];
589589
}
590590

591+
complex qli2p_(double const& p1, double const& m1, double const& m2, double const& mu2, int const& ep)
592+
{
593+
try
594+
{
595+
mI2[0] = m1;
596+
mI2[1] = m2;
597+
pI2[0] = p1;
598+
bb.derivative(r, mu2, mI2, pI2);
599+
}
600+
catch (std::exception &e)
601+
{
602+
std::cout << e.what() << std::endl;
603+
exit(-1);
604+
}
605+
return r[abs(ep)];
606+
}
607+
608+
complex qli2pc_(double const& p1, complex const& m1, complex const& m2, double const& mu2, int const& ep)
609+
{
610+
try
611+
{
612+
mI2c[0] = m1;
613+
mI2c[1] = m2;
614+
pI2[0] = p1;
615+
bbc.derivative(r, mu2, mI2c, pI2);
616+
}
617+
catch (std::exception &e)
618+
{
619+
std::cout << e.what() << std::endl;
620+
exit(-1);
621+
}
622+
return r[abs(ep)];
623+
}
624+
625+
qcomplex qli2pq_(qdouble const& p1, qdouble const& m1, qdouble const& m2, qdouble const& mu2, int const& ep)
626+
{
627+
try
628+
{
629+
mI2q[0] = m1;
630+
mI2q[1] = m2;
631+
pI2q[0] = p1;
632+
bbq.derivative(rq, mu2, mI2q, pI2q);
633+
}
634+
catch (std::exception &e)
635+
{
636+
std::cout << e.what() << std::endl;
637+
exit(-1);
638+
}
639+
return rq[abs(ep)];
640+
}
641+
642+
qcomplex qli2pqc_(qdouble const& p1, qcomplex const& m1, qcomplex const& m2, qdouble const& mu2, int const& ep)
643+
{
644+
try
645+
{
646+
mI2cq[0] = m1;
647+
mI2cq[1] = m2;
648+
pI2q[0] = p1;
649+
bbcq.derivative(rq, mu2, mI2cq, pI2q);
650+
}
651+
catch (std::exception &e)
652+
{
653+
std::cout << e.what() << std::endl;
654+
exit(-1);
655+
}
656+
return rq[abs(ep)];
657+
}
658+
591659
complex qli3_(double const& p1, double const& p2, double const& p3, double const& m1, double const& m2, double const& m3, double const& mu2, int const& ep)
592660
{
593661
try

0 commit comments

Comments
 (0)