4
$\begingroup$

I am using a recursion algorithm developed by Migdal for Lattice Field Theory, and I have the following code:

(** The dimension of the representation **)
dim[r_] := 2 r + 1 
(**The trace of a product around the loop, also the sum of the eigenvalues **)
χ[r_] := Sin[dim[r] θ/2]/Sin[θ/2] 
(** The main equation in the paper I went out to 12 terms in the above sum **)
migdal[a_] := Sum[
   ((1/dim[r]) NIntegrate[(Sin[θ/2]^2)/(2 π) a χ[r], {θ, 0, 4 π}])^(λ^2) 
 * dim[r] χ[r], {r, 0, 3, 1/2}
]^(λ^(d - 2)) 

(** The λ used as expansion parameter **)
λ = 2^(1/10) 

d = 4 


l6 = Table[Table[Simplify[
 Re[NIntegrate[
  Log[Nest[
   migdal, 
   Exp[(9/1000) (χ[1/2] - dim[1/2]) - (3/100000) (χ[1] - dim[1]) 
       + 0 (χ[3/2] - dim[3/2])],
   i]] χ[j] Sin[θ/2]^2/(2 π), {θ, 0, 4 π}]]
], {i,0, 20}] , {j, 1/2, 1, 1/2}]

and it says that

NIntegrate::ncvb: "NIntegrate failed to converge to prescribed accuracy 
after 9 recursive bisections in θ near {θ} = {9.71911}. NIntegrate obtained
6.127043317150083`*^-15 and 1.1472584029987046`*^-16 for the integral and
error estimates."

I have tried to change the MinRecursion, on the first NIntegrate, but then the integral converges too slowly, and there are further errors. Mathematica makes a number of recommendations having to do with changing error estimates, however I don't understand what it is referring to.

In my code $a$ is where my Boltzmann factor goes, more or less, as an initial input, followed by subsequent recursion of that factor. The factor itself depends the trace, $\chi$, and so depends on $\theta$.

FYI the initial conditions that are variable in this are the 9/1000, 3/100 000, and 0. The first two numbers are initial points that are plotted against each other with the first number corresponding to the x-axis, and the second corresponding to the y-axis. I have been varying their range andwhere from the current numbers to (1.2, 0.1) respectively.

If someone would be so kind as to help me with these error messages I would be grateful.

Thanks,

$\endgroup$
13
  • $\begingroup$ I think you should define \[Chi] = \[Chi][r_,\[Theta]_] in order to avoid confusion. For instance, there is \[Chi] both inside and outside NIntegrate in your definition of migdal. $\endgroup$ Commented Jun 15, 2012 at 17:58
  • $\begingroup$ You could try to beautify your code a little $\endgroup$ Commented Jun 15, 2012 at 17:59
  • $\begingroup$ I would love to, I'm still a little naive though about coding, sorry... I will get better with practice I promise. I will try and rewrite the code so that it's more streamline and better looking. $\endgroup$
    – kηives
    Commented Jun 15, 2012 at 18:01
  • $\begingroup$ I think he's referring to the post itself which I formatted for you. When formatting code, I try to ensure that the reader does not have to scroll in order to read it. That way, mistakes or inconsistencies can be more easily seen. For instance, in your exponential you have the term 0 (χ[3/2] - dim[3/2]), and I don't know if you intended to keep that term, or not, because of the 0 coefficient. $\endgroup$
    – rcollyer
    Commented Jun 15, 2012 at 18:15
  • 2
    $\begingroup$ @kηives simple: LaTeX is enabled, so I used $\chi \pi \theta \lambda$ and copied the result from the preview pane. :) $\endgroup$
    – rcollyer
    Commented Jun 15, 2012 at 19:37

1 Answer 1

3
$\begingroup$

I found this to help somewhat. Note that it uses Chop, hence changes the semantics a bit. Probably not any more than different settings for NIntegrate though.

migdal[a_] := 
 Sum[Chop[((1/dim[r]) NIntegrate[
         ExpToTrig[
          ExpandAll[
           TrigToExp[(Sin[\[Theta]/2]^2)/(2 \[Pi]) a \[Chi][
              r]]]], {\[Theta], 0, 4 \[Pi]}, 
         Method -> "LocalAdaptive"])^(\[Lambda]^2)*dim[r] \[Chi][r], 
    10^(-8)], {r, 0, 3, 1/2}]^(\[Lambda]^(d - 2))

Whether the results are plausible is something I am not able to assess.

$\endgroup$
1
  • $\begingroup$ Well, I do have some reference numbers that I know are correct and this was almost able to give them all, but it stopped working after seven iterations, whereas my original code did seven iterations fine... Thank you for your help though. $\endgroup$
    – kηives
    Commented Jun 16, 2012 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.