On Sat, Aug 22, 2009 at 3:13 AM, Mani chandra <mchan...@iitk.ac.in> wrote:

>
> Mani chandra wrote:
> > Hi,
> >
> >     How does one define a variable in sage and make sure the it's
> > conjugate is the same as the variable itself?
> >
> > Thanks,
> > Mani chandra
> >
> > >
> >
> >
> Hi,
>
>    Perhaps I wasn't specific.
>
> sage: var('a')
> sage: a.conjugate()
> conjugate(a)
>
> What I want is for SAGE to return a, instead of conjugate(a). Does "var"
> take any arguments that forces a variable to be real?


Unfortunately, I don't think this is implemented yet.

 -- William

>
> This is implemented in the sympy package, which I tried to use inside
> sage, but..
>
> sage: from sympy import symbols
> sage: a, b = symbols('a, b', real=True)
> sage: a.conjugate()
> a
> sage: b.conjugate()
> b
> sage: x = symbols('x')
> sage: x = a + I*b
> sage: x.conjugate()
> conjugate(a) - I*conjugate(b)
>
> Shouldn't it return a - I*b, instead of conjugate(a) - I*conjugate(b) ?
> It does however give the correct answer when I overwrite SAGE's
> namespace with sympy's namespace:
>
> sage: from sympy import *
> sage: a, b = symbols('a, b', real=True)
> sage: x = symbols('x')
> sage: x = a + I*b
> sage: a.conjugate()
> a
> sage: b.conjugate()
> b
> sage: x.conjugate()
> a - I*b
>
>
>
> >
>


-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to