Computing with the residue in Sagemath
I have done the following computation to calculate W12(z1,z2) I am expecting the result
W1,2(z1,z2)=Resz=0K(z)1z−z1(W0,3(z,−z,z2)+W0,2(z,z2)W1,1(−z)+W0,2(−z,z2)W1,1(z))=1/8(2az12+5a2)z24+(2az14+3a2z12)z22+5a2z14z16z26 I got the correct result for W11, W03 with the code. For computing W12 I have to use the subsitution function, but at the end I not getting the correct result. I got the result I have computed in Maple. So please let me know what mistake I am making in the following code.
var('z,b,z1,z2,z3');
assume(b > 0);
y = lambda z: 2*arcsinh( z / (sqrt(2)*b) ) / sqrt(z^2 + 2*b^2)
K = lambda z: 1 / (z*(y(z) - y(-z)))
W02 = lambda z1, z2: 1/(z1 - z2)^2
W11 = lambda z1: ( K(z) / (z - z1) * (W02(z1,z2).substitute(z1==z, z2==-z))*derivative(-z,z) ).residue(z == 0).canonicalize_radical()
W03 = lambda z1, z2, z3 : ( K(z) / (z - z1) *( W02(z, z2)*W02(-z,z3)+W02(z, z3)*W02(-z,z2))*derivative(-z,z)
).residue(z == 0).canonicalize_radical()
W12 = lambda z1, z2: ( K(z) / (z - z1) *(W03(z1,z2,z2).substitute(z1==z , z2==-z, z3 ==z2)
+W02(z1, z2).substitute(z1==z)*W11(z1).substitute(z1==-z)
+W02(z1, z2).substitute(z1==-z)*W11(z1).substitute(z1==z))
* derivative(-z,z)).residue(z == 0).canonicalize_radical()
Would you mind defining Wi,j(z1,z2) ?
It's a recursive definition Wg,n(z1,…,zn)=Resz=0(Wg−1,n+1(z,−z,z2,…zn)+∑g1+g2=g,n1+n2=n−1Wg1,n1()Wg2,n2())$. I writing the recursive code in general. So it might be more with that progarmme, but I am stuck here.
Your definition isn't complete :
It doesn't give the initial definitions for starting values of g and n.
it doesn't specify the use of the arguments z1,…zp.
The term Wg−1,n+1(z,−z,z2,…zn) isn't specially clear, introducing a new argument z and missing (?) z1.
By ∑g1+g2=g,n1+n2=n−1Wg1,n1()Wg2,n2(), do you mean
∑g1+g2=g∑n1+n2=n−1Wg1,n1(z1,…zp)Wg2,n2(z1,…zp)
or something else ?
In the latter, what about z ?
This might be due to LaTeX mistyping or cunt n' paste mishaps. Could you clarify by writing complete definitions, avoiding any abbreviation ? I'm not especially good at divination...
In my thesis https://bridges.monash.edu/articles/t... Page 30 eq 3.6 have the expression So in this case x(z)=z2 y(z) as I have defined in the code. k(z) I have defined in the code Page 31 I gave a picture to make the understanding clear.
So the initial data given is w0,1 and w0,2 and the rest we compute by the recursion. I am writing a code for this recursion. I have computed it in the maple files, I don't know how to share it here.