evala
evaluate in an algebraic number (or function) field
Calling Sequence
Parameters
Description
Examples
evala(expr)
evala(expr, opts)
expr
-
expression or an unevaluated function call
opts
(optional) name or a set of names
If expr is an unevaluated function call, such as Gcd(u,v), the function is performed in the smallest algebraic number (or function) field possible. Otherwise, evala(Normal(expr)) is computed.
The following placeholders are accepted by evala and described in the documentation. For example, to find further help on the Gcd command see evala/Gcd.
AFactor
AFactors
AIrreduc
Algfield
Content
Divide
Expand
Factor
Factors
Frobenius
Gcd
Gcdex
Indep
Issimilar
Minpoly
Norm
Normal
Prem
Primfield
Primpart
Quo
Reduce
Rem
Resultant
Simplify
Sprem
Sqrfree
Subfields
Trace
The algebraic numbers and functions must be represented with the RootOf notation. For example, the algebraic number 2 is represented by RootOf⁡z2−2,z and the algebraic function x is represented by RootOf⁡z2−y,z.
If the function is Gcd or the underlying process involves gcd computations, a case discussion and combination is attempted in case of reducible RootOfs (see evala/Gcd).
The evala command supports a second argument opts, which is an option or a set of options to be passed to the appropriate function. The help pages for the placeholders describe the options that are currently accepted.
In some cases, evala checks that the RootOfs are independent. If relations are found, an error may occur. The relations are accessible through the variable lasterror. The independence checking is performed if the function is one of the following:
You can instruct evala to skip this independence checking by adding the option 'independent' to the option set opts. However, the result may be incorrect if the option 'independent' is used but the RootOfs are not actually independent.
Information about the execution of the function can be displayed by setting infolevel[evala] to a positive integer. Likewise, assigning a positive integer to infolevel[function], where function is one of the placeholders, causes Maple to print selected information about computations involving function.
Define aliases for the examples.
alias⁡sqrt2=RootOf⁡x2−2,sqrt3=RootOf⁡x2−3,sqrt6=RootOf⁡x2−6:
evala⁡sqrt22
2
Compute the quotient q and remainder r of a divided by b such that a=bq+r.
a≔x2−x+3;b≔x−sqrt2
a≔x2−x+3
b≔x−sqrt2
q≔evala⁡Quo⁡a,b,x
q≔sqrt2+x−1
r≔evala⁡Rem⁡a,b,x
r≔−sqrt2+5
evala⁡a−b⁢q−r
0
Polynomial multiplication and factorization over Q⁡2,3
f≔sqrt2⁢x+sqrt3⁢sqrt3⁢x+sqrt2
evala⁡Normal⁡f
sqrt2⁢sqrt2⁢sqrt3+2⁢x⁢sqrt3⁢sqrt2⁢sqrt3+3⁢x6
g≔evala⁡Expand⁡f
g≔sqrt3⁢sqrt2⁢x2+sqrt2⁢sqrt3+5⁢x
evala⁡Factor⁡g
sqrt2⁢sqrt3⁢x+sqrt2⁢sqrt32⁢sqrt2⁢sqrt33+x
An example of dependent algebraic functions
alias⁡sqrtu=RootOf⁡x2−u,x,sqrtv=RootOf⁡x2−v,x,sqrtuv=RootOf⁡x2−u⁢v,x:
a≔sqrtu⁢sqrtv⁢sqrtuv
evala⁡Normal⁡1a
sqrtu⁢sqrtv⁢sqrtuvu2⁢v2
Norms of algebraic numbers and algebraic functions
evala⁡Norm⁡sqrt2
−2
evala⁡Norm⁡sqrt2+sqrt3
1
n≔sqrt⁡2+sqrt⁡3⁢sqrt⁡2−sqrt⁡3⁢−sqrt⁡2+sqrt⁡3⁢−sqrt⁡2−sqrt⁡3
n≔2+3⁢2−3⁢−2+3⁢−2−3
expand⁡n
evala⁡Norm⁡u+sqrtu
u2−u
evala⁡Primfield⁡sqrt2,sqrt3
RootOf⁡_Z4−10⁢_Z2+1=sqrt2+sqrt3,sqrt2=RootOf⁡_Z4−10⁢_Z2+132−9⁢RootOf⁡_Z4−10⁢_Z2+12,sqrt3=11⁢RootOf⁡_Z4−10⁢_Z2+12−RootOf⁡_Z4−10⁢_Z2+132
z≔sqrt2+sqrt3
evala⁡z4−10⁢z2+1
The following examples demonstrate that the result by using the option 'independent' for actually dependent algebraic functions may not be correct.
b≔x2−RootOf⁡x2−x
b≔x2−RootOf⁡_Z2−_Z
c≔x2−2⁢x+1
evala⁡Gcd⁡b,c
Error, (in `evala/Gcd/preproc`) reducible RootOf detected. Substitutions are {RootOf(_Z^2-_Z) = 0, RootOf(_Z^2-_Z) = 1}
evala⁡Gcd⁡b,c,independent
b1≔x2−RootOf⁡x2−x,index=1
b1≔x2
evala⁡Gcd⁡b1,c
b2≔x2−RootOf⁡x2−x,index=2
b2≔x2−1
evala⁡Gcd⁡b2,c
x−1
d≔x2+x
evala⁡Gcd⁡b,d
x+RootOf⁡_Z2−_Z
evala⁡Gcd⁡b,d,independent
See Also
Algebraic
alias
convert/RootOf
RootOf
Download Help Document