> On 10/10/2011 20:13, Christian Burisch wrote:
> > Hi All,
> >
> > William Stein referred me into here.
> >
> > I am working on a project analysing a function that uses
> > multidimensional generalisations of complex numbers. A bit like
> > cyclotomic fields, but where the unity roots are not complex
> > numbers but actually different dimensions. There is one of these
> > unity roots r_n per order n such that r_n^n=1. r_4 = i of course,
> > traditionally defined as the sqrt(-1) rather than 4th root of 1.
> >
> > As an example let's call r_3 = j, so a 3-dimensional number
> > (analogous to complex numbers) has the form:
> > a + jb + j^2c
> >
> > The equations I am working on grow really huge very quickly and then
> > simplify right down again. They are extremely tedious and error
> > prone to work out by hand. I have been eyeing Mathematica, but its
> > expensive and I don't know if it would help. Looking for
> > alternatives I hit upon Sage.
> >
> > Can Sage do that sort of thing?
> > Here is an example of an expansion:
> > I'd like to say:
> >
> > V_2(p,e)=-V(p-e)-e
> > V_3(p,e)=j/3(V_2(p,e)+V_2(p,ej)+V_2(p,ej^2))
> >
> > Can I say something like expand V_3(p,1) whereupon Sage tells me
> > that
> >
> > V_3(p,1)=-j/3(V(p-1)+V(p-j)+V(p-j^2) - (1+j+j^2))


Do you need something like this?

sage: C.<j> = CyclotomicField(3)
sage: j = SR._force_pyobject(j) # force j to work well with symbolics
sage: SR(C.0)   # otherwise we get this
e^(2/3*I*pi)

sage: V = function('V')
sage: V2 = function('V2', nargs=2, eval_func=lambda _, p, e: -V(p-e)-e)

sage: V3 = function('V3', nargs=2,
....: eval_func=lambda _, p, e: j/3*(V2(p,e)+V2(p,e*j)+V2(p,e*j^2)))

sage: var('p,e')
sage: V3(p,e)
-1/3*j*V(-e + p) - 2/3*j*V((j + 1)*e + p)



> > p is the coordinate of a point. The value of function V at that
> > point is V(p). e is just a constant that is passed in to determine
> > the dimension we are looking at. For example:
> >
> > V_2(p,1)=-(V(p-1)+1)
> > V_2(p,j)=-(V(p-j)+j)
> > V_2(p,1+i)=-(V(p-i-i)+1+i)

With the above, I get:

sage: V2(p,1)
-V(p - 1) - 1
sage: V2(p,j)
-e^(2/3*I*pi) - V(p - e^(2/3*I*pi))
sage: var('i')
i
sage: V2(p,i-1)
-i - V(-i + p + 1) + 1

I don't know why we convert j to e^(2/3*I*pi) in the second line.


Cheers,
Burcin

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to