Example
--RNG ==> Complex Expression Integer
RNG ==> Expression Complex Integer
Type: Void
fricas
z:RNG
Type: Void
fricas
r:=rootsOf(z^5-1)
Type: List(Expression(Complex(Integer)))
fricas
R==>RootOfUnity(5,RNG)
Type: Void
fricas
q:=[convert(t)$R for t in r]
Type: List(RootOfUnity
?(5,
Expression(Complex(Integer))))
fricas
primitive?(1$R)
Type: Boolean
fricas
pb:=[primitive?(t) for t in q]
Type: List(Boolean)
fricas
test(q.1=q.2)
Type: Boolean
fricas
q.1^5
Type: RootOfUnity
?(5,
Expression(Complex(Integer)))
fricas
q.1^6
Type: RootOfUnity
?(5,
Expression(Complex(Integer)))
fricas
q.1^15
Type: RootOfUnity
?(5,
Expression(Complex(Integer)))
fricas
sample()$R
Type: RootOfUnity
?(5,
Expression(Complex(Integer)))
fricas
one? sample()$R
Type: Boolean
fricas
inv(q.1)
Type: RootOfUnity
?(5,
Expression(Complex(Integer)))
fricas
q12:=inv(q.1*q.2)
Type: RootOfUnity
?(5,
Expression(Complex(Integer)))
fricas
q12^5
Type: RootOfUnity
?(5,
Expression(Complex(Integer)))
fricas
principal?(q.1)
Type: Boolean
fricas
principal?(q.3*q.1)
Type: Boolean
fricas
-- using solve instead of rootsOf
rs5:=solve(z::RNG^5=1$RNG,'z)
Type: List(Equation(Expression(Complex(Integer))))
fricas
qrs5:=[convert(rhs t)$R for t in rs5]
Type: List(RootOfUnity
?(5,
Expression(Complex(Integer))))
fricas
p5:=[primitive?(t) for t in qrs5]
Type: List(Boolean)
fricas
l5:=[principal?(t) for t in qrs5]
Type: List(Boolean)
fricas
test (qrs5.2=q.2/q.1)
Type: Boolean
fricas
-- using zerosOf
rz5:=zerosOf(z::RNG^5-1$RNG)
Type: List(Expression(Complex(Integer)))
fricas
qrz5:=[convert(t)$R for t in rz5]
Type: List(RootOfUnity
?(5,
Expression(Complex(Integer))))
fricas
pz5:=[primitive?(t) for t in qrz5]
Type: List(Boolean)
fricas
lz5:=[principal?(t) for t in qrz5]
Type: List(Boolean)