elliptic_e._eval_conjugate for one arg?

26 views
Skip to first unread message

Chris Smith

unread,
Sep 27, 2014, 9:15:06 PM9/27/14
to sy...@googlegroups.com
elliptic_e can take 1 or two args but the _eval_conjugate assumes 2 (and fails in a branch I am working on). The following mod works without returning anything for the 1 arg case, but can someone tell me if I should be uncommenting the 2 lines that I added for the 1 arg case?

    def _eval_conjugate(self):
        if len(self.args) == 2:
            z, m = self.args
            if (m.is_real and (m - 1).is_positive) is False:
                return self.func(z.conjugate(), m.conjugate())
        #else:
        #    return self.func(self.args[0].conjugate())

Aaron Meurer

unread,
Sep 28, 2014, 3:12:05 AM9/28/14
to sy...@googlegroups.com
According to the docs
(http://docs.sympy.org/dev/modules/functions/special.html?highlight=elliptic_e#sympy.functions.special.elliptic_integrals.elliptic_e),
elliptic_e(z) == elliptic_e(pi/2, z), so I think for the 1-arg case
one just needs to apply the same conditions on z as the 2-arg case
does for m.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/b70fd201-9bf9-43a6-8be5-966cbe9882ee%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Kalevi Suominen

unread,
Sep 28, 2014, 6:18:42 AM9/28/14
to sy...@googlegroups.com
 The arguments of elliptic integrals and functions are confusing because they appear in many forms. The most important argument is the modulus m = k^2, which is usually considered as a (non-varying) parameter. It is also represented by q=exp(i\pi\tau), sometimes called nome, in the theory of elliptic functions (many-to-one correspondence), and by the j-invariant j(\tau), which is also valid in the algebraic theory. To emphasize its parametrical nature it is usually written as the second argument, and often notationally separated from the first (varying) argument by a semicolon or bar. The modulus has no default value.

The first (actual) argument has two common forms, z and \phi, connected by z = sin(\phi). Its default value is 1=sin(\pi/2), and the corresponding integrals are called complete elliptic integrals.

In sympy the roles of the two arguments appear to have become mixed. The one-argument form of elliptic-e is useless (in is present form) because the modulus has no default value. It has apparently been intended to represent the complete integral, but setting a default value for the first argument has not been successful.

Since the default value z=1 can be readily added in the call, the simplest solution might be to drop the one-argument form of elliptic-e altogether.

Sergey Kirpichev

unread,
Sep 28, 2014, 10:15:29 AM9/28/14
to sy...@googlegroups.com


On Sunday, September 28, 2014 5:15:06 AM UTC+4, Chris Smith wrote:
elliptic_e can take 1 or two args but the _eval_conjugate assumes 2 (and fails in a branch I am working on). The following mod works without returning anything for the 1 arg case, but can someone tell me if I should be uncommenting the 2 lines that I added for the 1 arg case?

Should be:

    def _eval_conjugate(self):
        if len(self.args) == 2:
            z, m = self.args
            if (m.is_real and (m - 1).is_positive) is False:
                return self.func(z.conjugate(), m.conjugate())
        else:
            z = self.args[0]
            if (z.is_real and (z - 1).is_positive) is False:
                return self.func(z.conjugate())

Sergey Kirpichev

unread,
Sep 28, 2014, 10:19:09 AM9/28/14
to sy...@googlegroups.com


On Sunday, September 28, 2014 2:18:42 PM UTC+4, Kalevi Suominen wrote:

The one-argument form of elliptic-e is useless (in is present form) because the modulus has no default value.

Oh, no.  It's just the Legendre complete elliptic integral of the second kind.  Please read the docs.

Kalevi Suominen

unread,
Sep 28, 2014, 11:31:35 AM9/28/14
to sy...@googlegroups.com


On Sunday, September 28, 2014 5:19:09 PM UTC+3, Sergey Kirpichev wrote:
 

Oh, no.  It's just the Legendre complete elliptic integral of the second kind.  Please read the docs.

 Yes, you are right. But denoting the argument by z is very confusing as it really is the modulus. There are two kinds of complete integrals, E(m) and E(k).

Chris Smith

unread,
Sep 28, 2014, 3:53:31 PM9/28/14
to sy...@googlegroups.com
thanks

Sergey B Kirpichev

unread,
Sep 28, 2014, 4:00:39 PM9/28/14
to sy...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages