Evaluating a derivative in gp/pari

186 Views Asked by At

Specifically, I'm trying to evaluate the derivative of the Weierstrass P function at a specific point.

I know that I can set up a function like the following

p(z) = ellwp([1,I],z);

Which will allow me to input p(z), where z is a copmlex number, and have the output be the desired evaluation of the Weierstrass P function at z.

The problem is, I can't seem to do anything similar with the derivative. For example something like

p(z) = deriv(ellwp([1,I],z));

will return $0$ for any input $z$ (because pari is computing the value of the Weierstrass P function at z and then differentiating the resulting constant).

If there is any way this can be done, I would be grateful to hear about it.

1

There are 1 best solutions below

1
On BEST ANSWER

Look at the help:

? ?ellwp
ellwp(w,{z='x},{flag=0}): computes the value at z of the Weierstrass P function
attached to the lattice w, as given by ellperiods. Optional flag means 0
(default), compute only P(z), 1 compute [P(z),P'(z)].

So you can compute the function value and the derivative in one call

? ellwp([1,I], 1.2 + 2.1*I, 1)
%1 = [12.28012262 - 15.62055727*I, -28.28677598 + 177.9634914*I]

Now define the derivative dp(z) and get

? dp(z) = my{local a; a=ellwp([1,I],z,1); a[2]}
%2 = (z)->mylocala;a=ellwp([1,I],z,1);a[2]
? dp(1.2+2.1*I)
%3 = -28.28677598 + 177.9634914*I