From 1eb13e11ed60fd9cf1b800e67061e926a2eaaba9 Mon Sep 17 00:00:00 2001
From: Lars Hubatsch <hubatsch@pks.mpg.de>
Date: Sun, 14 Mar 2021 16:39:28 +0100
Subject: [PATCH] Trying to combine lb with corrected i->i, o->o.

---
 int_prob.m | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/int_prob.m b/int_prob.m
index 96f038c..82c3c83 100644
--- a/int_prob.m
+++ b/int_prob.m
@@ -3,35 +3,24 @@ function p = int_prob(l, T, x0, direc, ind_t, bp, ind_delta, lb, T_mov)
 %                                      2: left->left,  -2: right->right
 % ind_t     ... time index at which propagators are evaluated
 % bp        ... boundary position at t==ind_t
-<<<<<<< Updated upstream
 % lb        ... distance from boundary not to take into account
 
-=======
 ss = T{1}.system_size;
->>>>>>> Stashed changes
 delta_x0 = diff(x0);
 p = 0;
+
+if lb ~= 0 && abs(direc)==2
+    disp('Jump within same phase not implemented for lb!=0');
+    p = nan;
+    return;
+end
+
 for i = 1:length(delta_x0)
     x = (x0(i)+x0(i+1))/2;
     % 1. cond.: corr. starting point?  2. cond: jumped outside of domain?
     corr_starting_point = direc*x < direc*bp-lb;
     if abs(direc) == 1 % jump across the boundary?
-<<<<<<< Updated upstream
         corr_end_point = direc*(x-l) > direc*(bp-T{i}.v*T{1}.t(ind_delta+1))+lb;
-    elseif abs(direc) == 2 % jump within the same phase?
-        if lb ~= 0
-            disp('Jump within same phase not implemented for lb!=0');
-            break;
-        end
-        l = abs(l); % both directions need to be considered.
-        if (x < bp)
-            if (x + l < bp);    right = 1;  else; right = 0;    end
-            if (x - l > 0);   left = 1;   else; left = 0;     end
-        else
-            if (x + l < T{1}.system_size);  right =1;   else; right = 0;    end
-            if (x -l > bp);     left = 1;   else; left = 0;     end
-=======
-        corr_end_point = direc*(x-l) > direc*(bp-T{i}.v*T{1}.t(ind_delta+1));
     elseif direc == 2 % jump left -> left
         if l < 0 && x-l < bp; corr_end_point = 1; else; corr_end_point=0; end
         if l > 0 % jump to left
@@ -44,7 +33,6 @@ for i = 1:length(delta_x0)
             corr_end_point = 1;
             % Reflecting boundary if jumping out on right side of system
             if x-l > ss; x = 2*ss+l-x; end
->>>>>>> Stashed changes
         end
     end
     if corr_starting_point && corr_end_point
-- 
GitLab