Question: How can I get "allvalues" of a list of "rootof" ?

Hi, 

I have a list of integers (>1) and for all of them I define an alias (in the attached file I've tried two different names for them : a[n] or a||n) wich represents the nth roots of the unity.
When I apply the procedure allvalues to a specific alias it returns the algebraic values of the corresponding roots of the unity.
But when aplied to the list of aliases it gives me back only the name of the alias, not the algebraic values.

How can I fix this ?

TIA

restart:

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

for n from 2 to 3 do
  alias(a[n]=RootOf(z^n-1)):
end do:

alias();

a[2], a[3]

(2)

allvalues(a[2]);
allvalues(a[3]);

seq(allvalues(a[n]), n=2..3)

1, -1

 

1, -1/2+((1/2)*I)*3^(1/2), -1/2-((1/2)*I)*3^(1/2)

 

a[2], a[3]

(3)

for n from 2 to 3 do
  alias(a||n=RootOf(z^n-1)):
end do:

alias();

allvalues(a2);
allvalues(a3);

seq(allvalues(a||n), n=2..3)

a[2], a[3], a2, a3

 

1, -1

 

1, -1/2+((1/2)*I)*3^(1/2), -1/2-((1/2)*I)*3^(1/2)

 

a2, a3

(4)

A := [alias()]:
map(allvalues, A);

[a[2], a[3], a2, a3]

(5)

 


 

Download allvalues.mw

 

Please Wait...