I need to integrate expressions containing powers of the function:

Hb = U1.U2*U3.U4 + (permutations of the first term like U1.U3*U2.U4) 
           + Determinant of the matrix [U1,U2,U3,U4].

The U's are 4D unit vectors on different sites, so site 1 has

U1 = [ Cos(t21), Sin(t21)*Sin(t11)*Cos(p1), 
       Sin(t21)*Sin(t11)Sin(p1), Sin(t21)*Cos(t11) ], 

where t21 refers to the angle theta_2 on site 1. This means that Hb has a large number of terms with 12 variables each.

I have to integrate terms like Hb^5, attempting to do this using scipy.integrate.nquad is the problem. I can't tell which of the integrals is done first, so how do I specify the limits of integration to match the proper variables?

  • 1
    $\begingroup$ Please format your answer so it is easier to read $\endgroup$
    – whpowell96
    Jul 8, 2023 at 0:55
  • $\begingroup$ What is a "site"? $\endgroup$ Jul 8, 2023 at 5:51
  • $\begingroup$ The order of the limits corresponds to the order of the variables, and that order is defined by you. Integration is left-to-right for inner-to-outer integrals. $\endgroup$ Jul 8, 2023 at 9:08


Your Answer

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