From 52b5265298a56a0ff6083d0540078f2795ae038a Mon Sep 17 00:00:00 2001
From: "Pyry Runko (Puck)" <pyjorunk@student.jyu.fi>
Date: Wed, 26 Feb 2025 09:15:30 +0200
Subject: [PATCH] removed overloaded sumAmplitudes

---
 src/ipglasma.cpp | 85 +-----------------------------------------------
 src/ipglasma.hpp |  1 -
 src/main.cpp     |  7 ----
 3 files changed, 1 insertion(+), 92 deletions(-)

diff --git a/src/ipglasma.cpp b/src/ipglasma.cpp
index b356be9..77781e6 100644
--- a/src/ipglasma.cpp
+++ b/src/ipglasma.cpp
@@ -475,6 +475,7 @@ int IPGlasma::WilsonLineCoordinate(int  xind, int yind)
 }
 
 
+
 // compute complex amplitude with one wilson line and two indices
 std::complex<double> IPGlasma::ComplexAmplitude(double xpom, WilsonLine quark, int q2[2])
 {
@@ -517,57 +518,7 @@ std::complex<double> IPGlasma::ComplexAmplitude(double xpom, WilsonLine quark, i
     return amp;
 }
 
-// overload amplitude when given coordinates are integers i.e. indices
-std::complex<double> IPGlasma::ComplexAmplitude(double xpom, int q1[2], int q2[2])
-{
-    //TODO: make work with int?
-    //ApplyPeriodicBoundaryConditions(q1);
-    //ApplyPeriodicBoundaryConditions(q2);
 
-    // TODO: make work with indices (xMax?
-    // Out of grid? Return 0 (probably very large dipole)
-
-    //if (q1[0] < xcoords[0] or q1[0] > xcoords[xcoords.size()-1]
-    //    or q1[1] < ycoords[0] or q1[1] > ycoords[ycoords.size()-1]
-    //    etc...
-    // ?TODO?: (double?) check if dipole is less than lattice spacing   
-
-    // First find corresponding grid indeces
-    WilsonLine quark = GetWilsonLine(WilsonLineCoordinate(q1[0], q1[1]));
-    WilsonLine antiquark = GetWilsonLine(WilsonLineCoordinate(q2[0], q2[1]));
-
-    //antiquark = antiquark.HermitianConjugate();
-
-    WilsonLine prod;
-    try {
-        prod = quark.MultiplyByHermitianConjugate(antiquark);
-        //prod =  quark*antiquark;
-    } catch (...) {
-        cerr << "Matrix multiplication failed!" << endl;
-        cout << "Quark: " << q1[0] << ", " << q1[1] << endl;
-        cout << quark << endl;
-        cout << "Antiquark: " << q2[0] << ", " << q2[1] << endl;
-        cout << antiquark << endl;
-        exit(1);
-    }
-    std::complex<double > amp =  1.0 - 1.0/NC * prod.Trace();
-
-    double result = amp.real();
-    if (result < 0) return 0;
-    return result;
-    if (result > 1)
-        return 1;
-    if (result < 0)
-        return 0;
-
-    if (isnan(result))
-    {
-        cerr << "Wilson line trance NaN, quark coords " << q1[0] << ", " << q1[1] << " and " << q2[0] << ", " << q2[1] << endl;
-        exit(1);
-    }
-
-    return result;
-}
 
 //TODO: check
 double IPGlasma::DistanceToOrigin(int q[2]){
@@ -580,40 +531,6 @@ double IPGlasma::DistanceToOrigin(int q[2]){
 }
 
 
-//TODO: check
-std::complex<double> IPGlasma::SumAmplitudes(int w)
-{
-    std::complex<double> sum = 0.0;
-    int L = xcoords.size();
-    cout << "# Summing with lattice size L = " << L << endl;
-    WilsonLine quark;
-    for(int i =0; i < L; i += 1){
-        for(int j =0; j < L; j += 1){
-            int q1[2] = {i,j};
-            //TODO: pointer instead of copy?
-            quark = GetWilsonLine(WilsonLineCoordinate(i, j));
-            for(int v =0; v < L; v +=1){
-                int q2[2] = {v,w};
-                double r1 = DistanceToOrigin(q1);
-                double r2 = DistanceToOrigin(q2);
-                if (r1 > 1. && r2 > 1.){
-                    //cout << "#!!Throwing away large dipole separation!" << endl;
-                    //cout << "#Quark coordinate indices " << q1[0] << "," << q1[1] << " and " << q2[0] << "," << q2[1] << endl;
-                    //cout << "#Dipole size is " << r1-r2 << endl;
-                    //cout << "#Dipole amplitude is " << Amplitude(0, q1, q2) << endl;
-                    continue;
-                }
-
-                sum += ComplexAmplitude(0, quark, q2);
-            }
-        }
-    }
-    cout << "# Intermediate sum" << endl;
-    cout << sum << endl;
-    cout << "#---------" << endl;
-    
-    return sum;
-}
 
 //TODO: check
 std::complex<double> IPGlasma::SumAmplitudes()
diff --git a/src/ipglasma.hpp b/src/ipglasma.hpp
index 1da59da..049caad 100644
--- a/src/ipglasma.hpp
+++ b/src/ipglasma.hpp
@@ -60,7 +60,6 @@ public:
     std::complex<double> ComplexAmplitude(double xpom, int q1[2], int q2[2]);
     std::complex<double> ComplexAmplitude(double xpom, WilsonLine quark, int q2[2]);
     std::complex<double> SumAmplitudes();
-    std::complex<double> SumAmplitudes(int w);
 
     struct quark_flavor{
         double mass;
diff --git a/src/main.cpp b/src/main.cpp
index 064ae29..9c7da0e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -77,13 +77,6 @@ int main(int argc, char* argv[])
         printDipoleAmplitudes(fname, ipglasma);
     }
 
-    int task_id = 0;
-    if (argc > 3){ 
-        task_id= atoi(argv[3]);
-        cout << "#Integrating array job #" << task_id << endl;
-        ipglasma.SumAmplitudes(task_id);   
-    }
-
     
     else{ 
         std::complex<double> sum = ipglasma.SumAmplitudes();
-- 
GitLab