AlgebraicNumber[θ,{c0,c1,…,cn}]
represents the algebraic number in the field
given by
.
AlgebraicNumber
AlgebraicNumber[θ,{c0,c1,…,cn}]
represents the algebraic number in the field
given by
.
Details
- AlgebraicNumber objects in the same field are automatically combined by arithmetic operations.
- The generator θ can be any algebraic number, represented in terms of radicals or Root objects. The coefficients ci must be integers or rational numbers.
- AlgebraicNumber is automatically reduced so that θ is an algebraic integer, and the list of ci is of length equal to the degree of the minimal polynomial of θ.
- AlgebraicNumber objects are always treated as numeric quantities.
- N finds the approximate numerical value of an AlgebraicNumber object.
- Operations such as Abs, Re, Round, and Less can be used on AlgebraicNumber objects.
- RootReduce can be used to transform AlgebraicNumber objects into Root objects.
- A particular algebraic number can have many different representations as an AlgebraicNumber object. Each representation is characterized by the generator θ specified for the field.
- AlgebraicNumber objects representing integers or rational numbers are automatically reduced to explicit integer or rational form.
Examples
open all close allBasic Examples (1)
Scope (7)
AlgebraicNumber objects can be evaluated to any precision:
N[AlgebraicNumber[Sqrt[2] I, {1, -1}], 50]Objects representing integers or rational numbers are automatically simplified:
AlgebraicNumber[3, {1, 2}]AlgebraicNumber[5 / 2, {3, 2}]The generator θ in AlgebraicNumber[θ,{c0,…,cn}] will automatically reduce to an algebraic integer:
AlgebraicNumber[(1 + I) / 2, {1, 3}]AlgebraicNumber[Sqrt[Sqrt[2] + 1], {1, 2, 1, 2}]Root objects:
AlgebraicNumber[Root[5# ^ 5 + 11# + 1&, 1], {1, 1, 2}]AlgebraicNumber objects:
AlgebraicNumber[AlgebraicNumber[Root[-3 + #1^3&, 1], {1, 2, 1}], {1, 1, 2}]Coefficients of AlgebraicNumber objects are integers or rational numbers:
AlgebraicNumber[Sqrt[2] + Sqrt[5], {1, 1 / 2}]The number of coefficients is adjusted to match the degree of the algebraic number:
AlgebraicNumber[3 ^ (1 / 5), {1, 2, 1}]AlgebraicNumber[3 ^ (1 / 5), {1, 2, 1, 3, 3, 1}]AlgebraicNumber[Sqrt[2], {1, 1 / 2}] + AlgebraicNumber[Sqrt[2], {1, 2}]AlgebraicNumber[Sqrt[2], {1, 1 / 2}] * AlgebraicNumber[Sqrt[2], {1, 2}]1 / AlgebraicNumber[Sqrt[2], {1, 1 / 2}]AlgebraicNumber[Sqrt[2], {1, 1 / 2}] ^ 3Operations on AlgebraicNumber objects:
a = AlgebraicNumber[Root[-1 + #1 + #1^3&, 1], {0, -1, 4}]Re[a]Abs[a]Round[a]1 < aApplications (2)
Computations with AlgebraicNumber objects in the same number field are fast:
{a, b, c} = {I, Sqrt[2], Root[#1^3 - 2 #1 + 3&, 1]};Make them part of the same number field:
{x, y, z} = ToNumberField[{a, b, c}];RootReduce[(-2 y z (7 + x - y + z^2) + (6 + x^2 + 2 y) (-11 + x y + z^2)/2 y z (-4 - x + 3 y z) - (6 + x^2 + 2 y) (2 - 2 x + z^3))]//TimingIn this example RootReduce automatically uses AlgebraicNumber object computations:
{x, y, z} = {a, b, c};RootReduce[(-2 y z (7 + x - y + z^2) + (6 + x^2 + 2 y) (-11 + x y + z^2)/2 y z (-4 - x + 3 y z) - (6 + x^2 + 2 y) (2 - 2 x + z^3))]//TimingCompare to direct computations with Root objects:
RootReduce[(-2 y z (7 + x - y + z^2) + (6 + x^2 + 2 y) (-11 + x y + z^2)/2 y z (-4 - x + 3 y z) - (6 + x^2 + 2 y) (2 - 2 x + z^3)), Method -> "Recursive"]//TimingTwo solutions of the Pell equation
:
{x1, y1} = {9, 1};{x2, y2} = {163, 18};More solutions can be deduced easily:
a = Last /@ (AlgebraicNumber[Sqrt[82], {x1, y1}] ^ Range[1, 5])b = Last /@ (AlgebraicNumber[Sqrt[82], {x2, y2}] ^ Range[1, 5])Apply[#1 ^ 2 - 82#2 ^ 2 &, a, 1]Apply[#1 ^ 2 - 82#2 ^ 2 &, b, 1]Properties & Relations (5)
Use RootReduce to transform an algebraic number to a Root object:
RootReduce[AlgebraicNumber[Root[# ^ 3 + # + 1&, 3], {1, 2, 1}]]Use ToNumberField to get representations of Root objects as AlgebraicNumber objects:
ToNumberField[Root[1 + 2#1 + 2#1 ^ 2 + 2#1 ^ 3 + 2#1 ^ 4&, 1]]a = AlgebraicNumber[Root[# ^ 3 + # + 1&, 3], {1, 2, 1}];AlgebraicNumberPolynomial[a, x]Algebraic number theory operations:
a = AlgebraicNumber[Root[# ^ 3 + # + 1&, 3], {1, 1, 1}];AlgebraicNumberNorm[a]AlgebraicNumberTrace[a]a = AlgebraicNumber[Root[# ^ 3 + # + 1&, 3], {1, 1, 1}];MinimalPolynomial[a, x]% /. x -> aPossible Issues (1)
Operations such as Sqrt, Re, and Im do not automatically reduce:
a = AlgebraicNumber[Root[# ^ 3 + # + 1&, 3], {1, 2, 1}];Re[a]Sqrt[a]Convert to AlgebraicNumber using RootReduce:
ToNumberField[RootReduce[Re[a]]]ToNumberField[RootReduce[Sqrt[a]]]Tech Notes
Related Guides
History
Text
Wolfram Research (2007), AlgebraicNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/AlgebraicNumber.html.
CMS
Wolfram Language. 2007. "AlgebraicNumber." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AlgebraicNumber.html.
APA
Wolfram Language. (2007). AlgebraicNumber. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AlgebraicNumber.html
BibTeX
@misc{reference.wolfram_2026_algebraicnumber, author="Wolfram Research", title="{AlgebraicNumber}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/AlgebraicNumber.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_algebraicnumber, organization={Wolfram Research}, title={AlgebraicNumber}, year={2007}, url={https://reference.wolfram.com/language/ref/AlgebraicNumber.html}, note=[Accessed: 12-June-2026]}