Reference

Everything in the library

Every export of @ratmath/structures: groups first, then polynomials, ideals and rings of numbers. Group elements are given by value or by their printed label. Coefficients handed back to you are Core Rationals over Q, and the field's own elements otherwise. Wherever a polynomial is expected, text or a number is accepted too.

FunctionWhat it does
Named groups and products
cyclic(n), dihedral(n), dicyclic(n), quaternion(), kleinFour()Cₙ (elements are exponents k, printed aᵏ); Dₙ of order 2n, the symmetries of an n-gon (pairs [k, f] = rᵏsᶠ); the dicyclic group of order 4n; Q₈ printed ±1, ±i, ±j, ±k; C₂ × C₂.
symmetric(n), alternating(n), permutationGroup(gens, n), fromPermGroup(P)Permutation groups. Generators are arrays (p[i] the image of i, from 0) or cycle notation from 1 such as "(1 2 3)(4 5)". mul(a, b) is a∘b: first b, then a. G.toPermGroup() gives algebraic's PermGroup.
GL(n, p), SL(n, p), PSL(n, p), heisenberg(p), matrixGroup(gens, p)Matrix groups over F_p for a prime p: matrices of whole numbers 0 … p−1. PSL is SL modulo its centre; its elements are cosets.
directProduct(G, H, …), semidirectProduct(N, H, act), metacyclic(m, k, r)G × H on tuples; N ⋊ H with act(h) the automorphism of N that h gives (checked); Cₘ ⋊ Cₖ with the generator acting by x ↦ xʳ.
Group.generate({ generators, mul, identity, key, format, name }), Group.fromElements(list, mul), Group.fromTable(table, { labels })Any group: from generators and a multiplication (key tells elements apart, default JSON), from a list of all elements, or from a multiplication table (axioms checked).
G.naturalThe named groups' own action: polygon vertices, the points 1 … n, or the vectors of F_pⁿ.
PermGroup, cycleString, fromCycles, cycleTypeRe-exported from @ratmath/algebraic, where Galois groups are computed.
sign(p, n?), isEven, isOdd, inversionsThe sign of one permutation (an array of 0-based images, or cycle text such as "(1 2 3 4)" with n points): 1 even, −1 odd; inversions counts out-of-order pairs.
Elements
G.elements, G.order, G.identity, G.generators, G.nameAll elements (identity first), their number, the identity, a generating list, the name.
G.mul(a, b, …), G.inv(x), G.pow(x, k), G.conjugate(x, g), G.commutator(a, b)Products left to right; inverse; powers (negative too); gxg⁻¹; [a, b] = a⁻¹b⁻¹ab. Elements may be given by value or by printed label ("r²s", "r^2 s", "(1 2)", "-i").
G.element(x), G.has(x), G.indexOf(x), G.format(x), G.key(x)The element for a value or label; membership; its element number; how it prints; its key.
G.elementOrder(x), G.orderStatistics(), G.exponentThe order of x; a Map order → how many elements; the lcm of the orders.
G.cayleyTable({ order }){ labels, elements, table } with table[i][j] the position of the product; String(…) prints the grid.
G.isAbelian, G.isCyclic, G.isPGroup, G.isTrivialTests.
G.describe(), String(G)A one-line summary; the name, or ⟨generators⟩.
Classes, centre, commutators
G.conjugacyClasses()[{ representative, elements, indices, size, order }], identity first; size·|C(x)| = |G|.
G.classEquation(){ order, centre, terms } printing as "24 = 1 + 3 + 6 + 6 + 8".
G.centre(), G.centraliser(x or list or H), G.normaliser(H)Z(G); the elements commuting with x (or with all of a list or subgroup); the g with gHg⁻¹ = H. US spellings center, centralizer, normalizer work too.
G.derivedSubgroup(), G.commutatorOf(H, K), G.normalClosure(list)G′ = [G, G]; [H, K]; the smallest normal subgroup containing some elements.
G.derivedSeries(), G.lowerCentralSeries(), G.upperCentralSeries()Lists of subgroups, until they stop.
G.isSolvable, G.isNilpotent, G.nilpotencyClass, G.isSimple, G.isPerfectTests; the class is null for a group that is not nilpotent.
Subgroups and quotients
G.subgroup(gens), G.trivialSubgroup()The subgroup generated by some elements; {e}. A subgroup is a Group with G as its parent.
G.subgroups({ maxOrder }), G.subgroupClasses()Every subgroup, smallest first (groups up to order 1000 by default); the subgroups up to conjugacy: [{ group, order, index, conjugates, normal, members }].
G.normalSubgroups(), G.isNormal(H), G.conjugateSubgroup(H, g)All normal subgroups (built from classes, no need to list every subgroup); normality; gHg⁻¹.
G.isSubgroup(H), H.equals(K), G.contains(H), G.index(H)Subgroup test; same elements; containment; [G : H].
G.intersection(H, K), G.join(H, K, …), G.product(H, K)H ∩ K; the subgroup generated by both; the set HK as a list.
G.cosets(H, { side })Left (or right) cosets: [{ representative, elements, indices }].
G.quotient(N)G/N for normal N; elements are Cosets printed gN. Q.cosetOf(x), Q.over, Q.normal.
G.compositionSeries(){ series, factors } with factors the orders of the simple quotients.
Sylow subgroups
G.sylowSubgroup(p), G.sylowSubgroups(p), G.sylowCount(p)One Sylow p-subgroup (order the largest power of p dividing |G|); all of them, as conjugates; their number n_p = [G : N(P)].
Homomorphisms and isomorphism
homomorphism(G, H, f), tryHomomorphism(G, H, f)A homomorphism from a function on elements, a list of images of G.generators, or a Map from generating elements to images. Throws (or returns null) when the images do not respect G's relations.
f.apply(x), f.kernel(), f.image(), f.preimage(K), f.then(g), f.inverse()Images; ker f (normal in the source); im f; f⁻¹(K); first f then g; the inverse of an isomorphism.
f.isInjective, f.isSurjective, f.isIsomorphism, f.tableTests; the images of all element numbers.
identityMap(G), trivialMap(G, H), inclusion(H, G), projection(Q)Standard maps; projection(G.quotient(N)) is x ↦ xN.
firstIsomorphism(f), secondIsomorphism(G, H, N), thirdIsomorphism(G, N, K)The three isomorphism theorems on an example: the quotients involved and a checked isomorphism between them.
isomorphism(G, H), isIsomorphic(G, H)An isomorphism or null (invariants first, then a pruned search over images of generators); its existence.
automorphisms(G), automorphismGroup(G), innerAutomorphism(G, g)Every automorphism; Aut(G) as a group with .inner = Inn(G); x ↦ gxg⁻¹.
smallGroups(n), numberOfGroups(n), identify(G), SMALL_ORDER_LIMITOne group of each isomorphism type for n ≤ 20, named; how many; { name, group, iso } for a group of order ≤ 20 (null above).
Actions
action(G, points, act, { key, format, check })G acting on a list of points by act(g, x). Checked to be an action.
regularAction(G), conjugationAction(G), cosetAction(G, H)G on itself by left multiplication; by conjugation; on the left cosets of H.
A.orbit(x), A.orbits(), A.stabiliser(x), A.fixedPoints(g), A.apply(g, x), A.permutation(g)Orbits, stabilisers (subgroups of G), fixed points, images, and g as a permutation of point numbers.
A.kernel(), A.isTransitive, A.isFaithful, A.isFreeThe elements fixing every point; tests.
A.countOrbits(), burnside(A)The orbit-counting lemma: { count, total, order, byClass }, printing the sum class by class; checked against the orbits.
A.onColourings(k or colours), A.onSubsets(k)The induced actions on colourings of the points and on k-element subsets.
A.toPermGroup()The image of G as algebraic's PermGroup on point numbers, for @ratmath/discrete's cycleIndex, countColourings and patternInventory.
Presentations
presentation("a, b | a^4, b^2, (ab)^2"), presentation(names, relators)A presentation. Relators are words or relations u = v; words read a^2 b^-1, a²b⁻¹, (ab)^3, [a, b] = a⁻¹b⁻¹ab, and A for a⁻¹. Angle brackets are optional.
P.order(), P.index(H), P.enumerate(H, { maxCosets })Todd–Coxeter coset enumeration of the right cosets of the subgroup generated by the words H: { index, table, inverseTable, representatives, cosetOfWord }. Throws past maxCosets (500,000), as an infinite index does.
P.toGroup()The finite group as a Group, elements printed as shortest words; G.fromWord(w) gives the element of a word.
P.abelianInvariants(), abelianInvariants(G or P)G/G′ as an AbelianGroup; works for infinite presentations.
presentationOf(G)A presentation of a finite Group (Schreier's method: one relator per Cayley graph edge outside a spanning tree).
parseWord(text, names), formatWord(w, names), reduceWord(w), invertWord(w)Words as arrays: k for generator k (from 1), −k for its inverse.
Abelian groups
fromRelations(rows, n), integerModule(rows, n)Zⁿ modulo the rows: an AbelianGroup, with .generators saying how each cyclic factor is made from the original generators.
abelianGroup(invariants, rank), cyclicProduct(orders, rank)From invariant factors d₁ | d₂ | …; from any cyclic orders (0 for Z), put into standard form.
A.invariants, A.rank, A.order, A.elementaryDivisors, A.torsion, A.exponentThe structure: invariant factors (BigInts), number of copies of Z, order (null if infinite), prime-power factors.
A.isFinite, A.isCyclic, A.isTrivial, A.equals(B), A.times(B), A.toGroup(), String(A)Tests, comparison, products, the finite group as a Group, and "Z/2 × Z/12 × Z^2" (toString({ primary: true }) by elementary divisors).
abelianGroups(n)One of each abelian group of order n.
smithForm(A, domain), ZZ, polynomialDomain("x")Smith normal form { D, U, V, Vinv, diagonal, rank } with U·A·V = D over the integers or Q[x] (or any Euclidean domain object).
Chain complexes and homology
chainComplex([∂1, ∂2, …], { sizes })A ChainComplex from boundary matrices (∂k: a row per (k−1)-cell, a column per k-cell); checks ∂∂ = 0. sizes gives the cell counts where a map is empty.
C.homology(k, { coefficients }), C.homologyGroups(), C.reducedHomology(k)H_k as an AbelianGroup over Z (with torsion), or a vector space { dimension } over "Q" or "Z/p".
C.betti({ coefficients }), C.torsion, C.eulerCharacteristic, C.sizesBetti numbers, torsion of each H_k, χ = Σ(−1)^k n_k, cells per dimension.
C.invariantFactors(k), C.rank(k, p), C.boundary(k), String(C)Smith invariants and rank of ∂k (mod p when given), the matrix, and "H0 = Z, H1 = Z/2, H2 = 0".
Modules over Q[x]
matrixModule(A)Qⁿ as a Q[x]-module with x acting as A: { invariantFactors, elementaryDivisors, minimalPolynomial, characteristicPolynomial, rationalCanonical, blocks, isCyclic, smith }.
companionMatrix(f)The companion matrix of a monic polynomial.
Rings
ring(vars, { field, order })A polynomial ring. vars is text ("x, y, z") or a list of names; field is any RatMath field object (default: the rationals); order is "lex", "grlex", "grevlex" (default) or a comparison of exponent lists.
R.vars, R.n, R.gens, R.zero, R.oneThe variable names, their number, the variables as polynomials, and the constants 0 and 1.
R.poly(text)Read a polynomial: "x^2 y - 3/2 x z + 1". Juxtaposition multiplies, ^ or ** is a power, numbers are exact, exact division is allowed.
R.from(x)A polynomial of R from a polynomial of R, text, or a coefficient (number, BigInt, Core Rational, field element).
R.gen(v), R.constant(c), R.monomial(exps, c)One variable; a constant from a field element; c·x^exps with exps a list or { x: 2, y: 1 }.
R.fromTerms(list), R.fromUnivariate(coeffs, v)From [[coefficient, exponents], …]; from a constant-first coefficient list in one variable.
R.withOrder(order), R.equals(S), String(R)The same ring with another order; same variables, field and order; a name such as "Q[x, y]".
QQ, ORDERSThe field of rationals used by default; the three built-in orders by name.
primeField(p), galoisField(p, k), NumberFieldCoefficient fields from @ratmath/algebraic, re-exported.
A polynomial f
f.add(g), f.sub(g), f.mul(g), f.neg(), f.pow(n), f.scale(c)Ring arithmetic. g may be a polynomial, text or a number.
f.equals(g), f.isZero(), f.isConstant(), f.isMonomial(), f.isHomogeneous()Exact tests.
f.degree(), f.degree(v), f.degrees(), f.variables(), f.lengthTotal degree (−1 for 0); degree in one variable; all of them; the variables that occur; the number of terms.
f.terms()The terms, largest first: [{ coefficient, exponents, monomial }].
f.coefficient(exps), f.coefficients(v), f.constantTerm(), f.toConstant()One coefficient; f as a polynomial in v (constant first, entries polynomials); the constant term; the value of a constant polynomial.
f.leadingTerm(), f.leadingCoefficient(), f.leadingMonomial(), f.leadingExponents()The largest term in the ring's order and its parts.
f.monic()f divided by its leading coefficient.
f.diff(v, times), f.gradient()Partial derivatives.
f.subs({ x: … }), f.at(point), f.compose(values, target)Substitute for some variables (same ring); the exact value at a point; replace every variable by a polynomial of another ring.
f.homogenize(name), f.into(S), f.toUnivariate()Make homogeneous with a new variable; the same polynomial in another ring; a constant-first coefficient list when only one variable occurs.
String(f), f.toText(), f.toTeX(), f.toJSON()"x²y − (3/2)xz + 1"; "x^2*y - 3/2*x*z + 1" (reads back); LaTeX; { vars, terms }.
Division
f.divmod(g){ quotient, remainder } on division by one polynomial, in the ring's order.
f.divmod([g1, g2, …]){ quotients, remainder } with f = Σ qᵢgᵢ + r and no term of r divisible by a leading term of a divisor.
f.rem(g or list), f.div(g), f.isDivisibleBy(g)The remainder; the exact quotient (throws if there is a remainder); whether g divides f.
Greatest common divisors
gcd(f, g, …), lcm(f, g, …)Greatest common divisor and least common multiple, leading coefficient 1. A single list is accepted too.
content(f, v), primitivePart(f, v)The gcd of the coefficients of f as a polynomial in v, and f divided by it.
squareFree(f){ unit, factors: [{ factor, multiplicity }] } with square-free, pairwise coprime factors (characteristic 0).
squareFreePart(f)The product of the distinct irreducible factors.
Factoring
factor(f){ unit, factors: [{ factor, multiplicity }] }: the irreducible factors over Q, each with coprime integer coefficients; unit is a Rational.
isIrreducible(f)Whether a non-constant polynomial over Q is irreducible.
integerPrimitive(f){ content, primitive }: f as a rational number times a polynomial with coprime integer coefficients.
Determinants and elimination
det(matrix, R)The determinant of a square matrix of polynomials, by fraction-free (Bareiss) elimination. R is needed only when no entry is a polynomial.
sylvester(f, g, v)The Sylvester matrix of f and g as polynomials in v.
resultant(f, g, v)Its determinant: zero exactly where f and g have a common root in v.
discriminant(f, v)(−1)^(n(n−1)/2) Res(f, ∂f/∂v) / lc(f): zero exactly where f has a repeated root in v.
jacobian([f1, f2, …]), hessian(f)The matrix of gradients; the matrix of second partial derivatives.
Rational functions
fractions(R)The field of fractions K(x₁, …, xₙ) as a field object: zero, one, add, sub, mul, div, neg, inv, pow, sign, equals, format, gens, name.
F.parse(text), F.from(x), F.of(num, den)Read "(x^2 - 1)/(x y + 1)" (negative powers allowed); convert a polynomial, number or text; a fraction of two polynomials, reduced.
q.num, q.denNumerator and denominator in lowest terms (over Q: coprime integer coefficients, positive leading denominator).
q.add(r), q.sub(r), q.mul(r), q.div(r), q.neg(), q.inv(), q.pow(n)Field arithmetic; n may be negative.
q.equals(r), q.isZero(), q.isPolynomial(), q.toPolynomial()Exact tests; the polynomial when the denominator is constant.
q.diff(v), q.subs(values), q.at(point)Derivative; substitution; exact value (throws at a pole).
String(q), q.toText(), q.toTeX()"2x/(x² − y²)"; text that F.parse reads back; LaTeX.
Gröbner bases
groebner(polys, { order, certificates, maxPairs, timeLimit })The reduced Gröbner basis of the ideal the polynomials generate, by Buchberger's algorithm. order replaces the ring's monomial order; certificates: true tracks cofactors during the run (express works either way); maxPairs and timeLimit (ms) stop a run that is too large.
G.basis, G.length, G.leadingMonomials, G.leadingExponents, G.generators, G.statsThe basis (monic, each term reduced); its size; leading monomials; the original generators; { pairs, zero, skipped, added }.
G.reduce(f), G.divide(f), G.contains(f)The normal form of f; { quotients, remainder }; whether f is in the ideal.
G.express(f), G.cofactors{ cofactors, check } with f = Σ cofactors[i]·generators[i], multiplied out to confirm (throws when f is not in the ideal); each basis element in terms of the generators.
G.verify()Buchberger's criterion re-checked: { generatorsReduce, sPairsReduce, basisInIdeal, sPairsChecked, ok }.
G.isTrivial, G.isZero, G.dimension, G.isZeroDimensionalBasis {1} (no solutions); the zero ideal; the dimension of the solution set (−1 when empty); finitely many solutions.
G.standardMonomials({ limit }), G.quotientDimensionThe monomials no leading monomial divides; how many (Infinity unless zero-dimensional): the number of solutions with multiplicity.
sPolynomial(f, g), eliminationOrder(n, [i, …])The S-polynomial; an order for n variables ranking those with the listed indices above the rest.
Ideals
ideal(R, [f, …]), ideal([f, …]), new Ideal(R, list)The ideal generated by polynomials (text is read by R).
I.generators, I.groebner, I.basis, String(I)As given; the GroebnerBasis (computed once); its reduced basis; "(f, g)".
I.contains(f), I.reduce(f), I.express(f)Membership; normal form; f as a combination of the generators.
I.equals(J), I.isSubsetOf(J), I.isZero, I.isWhole, I.isProperComparisons and the two extreme ideals.
I.add(J), I.mul(J), I.pow(n), I.intersect(J)I + J, I·J, Iⁿ, I ∩ J. A polynomial may stand for the ideal it generates.
I.quotient(J), I.saturate(f)I : J = { f : fJ ⊆ I }; I : f^∞ (an ideal J is allowed too).
I.eliminate(vars)I ∩ K[the other variables], as an ideal of the same ring.
I.radicalContains(f, { certificate }), I.exponentOf(f)Whether some power of f is in I. With certificate: true, { holds, power, cofactors, check } with f^power = Σ cofactors[i]·generators[i]. The least such power, or null.
I.radical(), I.isRadical()The radical: for finitely many solutions, one generator, or monomial generators (throws otherwise); isRadical gives null where it cannot decide.
I.dimension, I.isZeroDimensional, I.degree, I.standardMonomials()Dimension of the solution set; finitely many solutions; their number with multiplicity; a basis of the quotient.
I.minimalPolynomial(f)The minimal polynomial of f modulo I, coefficients constant first (finitely many solutions).
I.isMaximal(), I.isPrime()Over Q. isPrime gives null where it cannot decide (positive dimension with several nonlinear generators).
chineseRemainder(I, J){ comaximal, a, b, intersection, productIsIntersection, lift(f, g) } with a ∈ I, b ∈ J, a + b = 1, and lift(f, g) ≡ f mod I, ≡ g mod J. { comaximal: false, sum } otherwise.
Solving systems
solve(R, [f, …], { complex }), solve([f, …]), I.solve()Over Q. { finite, dimension, count, multiplicity, radical, real, complex, components, parametrization }; { finite: false, dimension } for infinitely many solutions; count 0 for none.
solution.values, .approx, .coordinates, .field, .theta, String(solution)Exact algebraic numbers by variable; floats (real solutions); elements of Q(θ); the number field and its root θ; "(x = …, y = …)".
components[{ field, minimalPolynomial, degree, realCount, coordinates }]: one per irreducible factor, a set of conjugate solutions.
parametrization{ form, minimalPolynomial, coordinates }: the separating form u = Σ form[v]·v, its minimal polynomial, and each variable as a polynomial in u (Rationals, constant first).
Quotient rings
I.quotientRing(), new QuotientRing(I)The ring R/I.
A.of(x), A.gens, A.zero, A.one, A.ring, A.idealThe class of a polynomial or text; the classes of the variables.
A.dimension, A.isFinite, A.basisDimension over the field (Infinity when not finite); the standard monomials.
A.isField(), A.isIntegralDomain(), A.isReduced(), A.isZeroRingTests (null where undecided).
A.asField({ name })The quotient by a maximal ideal as a field object for ring(vars, { field }).
a.add(b), a.sub(b), a.neg(), a.mul(b), a.pow(n), a.equals(b), a.isZero(), a.repArithmetic of classes; the normal-form representative.
a.isUnit(), a.inverse(), a.div(b)Units and inverses (found through a Gröbner basis of I + (a) with cofactors).
a.isZeroDivisor(), a.isNilpotent(), a.minimalPolynomial(), a.matrix()Tests; minimal polynomial and the matrix of multiplication (finite quotients).
The integers mod n
Zn(n), new ZnRing(n)The ring Z/n; elements are BigInts 0 … n − 1.
Z.of(a), Z.add, Z.sub, Z.mul, Z.neg, Z.pow(a, e), Z.inverse(a), Z.div(a, b)Arithmetic; negative powers of units are allowed; inverse throws for a non-unit.
Z.isUnit(a), Z.isZeroDivisor(a), Z.isField, Z.isIntegralDomain, Z.isReduced, Z.characteristic, Z.sizeTests and sizes.
Z.elements(), Z.units(), Z.zeroDivisors(), Z.nilpotents(), Z.idempotents(), Z.unitCountLists (moduli up to a million) and φ(n).
Z.additiveOrder(a), Z.orderOf(a), Z.primitiveRoot(), Z.unitGroup()Orders; the smallest generator of the units or null; { order, invariants, cyclic, text }.
Z.ideals(), Z.decompose(), Z.table(op), Z.asField()[{ generator, size, quotient, isMaximal, isPrime }]; { moduli, to, from, idempotents }; addition or multiplication table; the field Z/p.
crt(residues, moduli){ value, modulus } solving all the congruences, or null when they conflict. Moduli need not be coprime.
Quadratic integer rings
quadraticRing(d), gaussianIntegers(), eisensteinIntegers()The integers of Q(√d) for square-free d; d = −1; d = −3.
K.of(a, b), K.sqrt(x, y), K.zero, K.one, K.omega, K.d, K.discriminant, K.isReala + bω; x + y√d; constants.
x.add, x.sub, x.neg, x.mul, x.pow(k), x.conj(), x.norm(), x.trace(), x.equals, x.isZero()Arithmetic; norm and trace are BigInts.
x.isUnit(), x.inverse(), x.divExact(y), x.isDivisibleBy(y), x.isAssociateOf(y), x.toNumber()Units and exact division (null when not exact).
K.units, K.fundamentalUnit{ finite, list, count } for d < 0; { finite: false, fundamental, norm, text } for d > 0.
K.divmod(a, b), K.gcd(a, b), K.isNormEuclidean{ quotient, remainder, euclidean } by rounding; { gcd, s, t, steps } by Euclid (throws when a step fails to shrink the norm).
K.elementsOfNorm(m, { bothSigns }), K.canonical(x)One element of each class of associates with that norm; the preferred associate.
K.isIrreducible(x), K.isPrimeElement(x), K.irreducibleDivisors(x)The two notions that differ when the class number is above 1.
K.factorizations(x), K.factor(x)Every factorisation into irreducibles [{ unit, factors }]; the factorisation { unit, factors: [{ prime, exponent }] } when the ring has unique factorisation (throws otherwise).
K.ideal(g1, g2, …), K.primesAbove(p), K.splitting(p)An ideal from generators; the prime ideals over p; { kind: split | inert | ramified, primes, principal }.
J.norm, J.generators, J.contains(x), J.equals, J.isSubsetOf, J.add, J.mul, J.pow, J.conj()Ideals, held in a normal form so equality is exact.
J.isPrincipal(), J.generator(), J.isPrime(), J.isEquivalentTo(L), J.factor()A generator or null; same ideal class; [{ prime, exponent }].
K.classGroup(), K.classNumber(), K.minkowskiBound, K.isPID, K.isUFD{ classNumber, representatives, orders, invariants, cyclic, text, minkowskiBound, primesChecked }.
Character tables
characterTable(G), new CharacterTable(G, { classLimit })The table of a finite group, by the Burnside–Dixon–Schneider method, verified and cached on the group.
T.classes, T.exponent, T.inverseClass, T.classOf(x), T.powerMap(k)Classes [{ name, representative, size, order, centralizerOrder }]; the class of an element; where k-th powers go.
T.irreducibles, T.degrees, T.trivial, T.linearCharacters, T.regularThe irreducible characters by degree, and some standard ones.
T.verify(){ rows, columns, degrees, ok }: the orthogonality relations and Σχ(1)² = |G| on the exact values.
T.normalSubgroups(), T.isSimple, T.isAbelian, T.abelianizationOrder, T.derivedSubgroupOrder, T.centreOrder, T.realClassesWhat the table says about the group; normal subgroups as [{ order, classes, kernelOf }].
T.classFunction(values | fn), T.permutationCharacter(action | subgroup), T.subgroupOfClasses(list)A class function from values or a function of a representative; fixed-point counts; the subgroup made of whole classes.
String(T), T.rows({ tex }), T.toTeX(), T.describe(), T.primeThe table as text, cells or TeX; a summary; the prime the computation used.
Cyclotomic.root(n, k), Cyclotomic.int(k), Cyclotomic.fromPowers(n, multiplicities)ζₙᵏ, a whole number, Σ mₖζₙᵏ.
z.add, z.sub, z.mul, z.neg(), z.over(p, q), z.conj(), z.galois(k), z.conjugates(), z.lift(m), z.equalsExact arithmetic in cyclotomic fields (operands in different fields meet in the smallest common one).
z.isZero, z.isRational, z.isInteger, z.isReal, z.toInteger(), z.toFraction(), z.approx(), z.conductor, String(z), z.toTeX()Tests; a number, [numerator, denominator] or { re, im }; the smallest m with z in Q(ζₘ).
Working with characters
chi.values, chi.degree, chi.value(x), chi.name, String(chi)A ClassFunction: one Cyclotomic per class.
chi.add, chi.sub, chi.mul / chi.tensor, chi.scale(k), chi.pow(k), chi.conj() / chi.dual(), chi.equalsSums, products (tensor products) and duals.
chi.inner(psi), chi.norm, chi.multiplicities(), chi.decompose(), chi.decomposition()⟨χ, ψ⟩ (a number when whole); multiplicities of the irreducibles; [{ character, multiplicity }]; "χ₁ + 2χ₃".
chi.isCharacter, chi.isVirtualCharacter, chi.isIrreducible, chi.isLinear, chi.isFaithfulTests.
chi.adams(k), chi.symmetricSquare(), chi.alternatingSquare(), chi.indicator(), chi.typeg ↦ χ(gᵏ); S² and Λ²; the Frobenius–Schur indicator and "real", "complex" or "quaternionic".
chi.kernel(), chi.kernelClasses(), chi.centreClasses()The kernel as a subgroup; classes where χ(g) = χ(1), and where |χ(g)| = χ(1).
chi.restrict(H), phi.induce(T)Restriction to a subgroup (or its table); induction from a subgroup's table to the table or group above.
Large permutation groups
schreierSims(generators, { names, name, base }), new PermChain(…)The group generated by permutations (arrays of images from 0), held by a base and strong generating set. Points are reported from 1.
G.order, G.degree, G.base, G.orbitLengths, G.basicOrbits, G.strongGenerators, G.generators, G.generatorNamesThe order (a BigInt, the product of the orbit lengths) and the stabiliser chain.
G.contains(g), G.sift(g), G.word(g), G.evaluate(word), G.random({ seed }), G.elements()Membership; the sifting record; { word, text, length, check } in the generators; a word multiplied out; a uniformly random element; an iterator over all elements.
G.orbit(point), G.orbits(), G.isTransitive, G.stabilizer(points), G.subgroup(generators)Orbits; point stabilisers and subgroups, as chains.
G.isSubgroup(H), G.equals(H), G.index(H), G.isNormal(H), G.normalClosure(generators)Comparisons of subgroups and the smallest normal subgroup containing some elements.
G.derivedSubgroup(), G.derivedSeries(), G.isAbelian, G.isSolvable, G.isPerfect, G.isSymmetric, G.isAlternatingCommutator subgroups and what they decide.
G.minimalBlocks(a, b), G.blockSystems(), G.isPrimitiveThe smallest block system joining two points; all minimal systems; primitivity (transitive groups).
G.toGroup({ maxOrder }), G.describe()The same group as a listed finite group; a one-line summary.
largeGroups.symmetric(n), .alternating(n), .mathieu(n), .rubik(), .pocketCube()Ready-made chains: Sₙ, Aₙ, M11, M12, M22, M23, M24, the cube groups with named face turns.
Field extensions and towers
extension({ a: "a^2 - 2", b: "b^3 - a" }), new Extension(…)The tower Q ⊂ Q(a) ⊂ Q(a, b); each polynomial must be irreducible over the field before it.
K.names, K.degrees, K.degree, K.generators, K.a, K.of(text), K.basis, K.zero, K.oneThe steps and their degrees, generators by name, an element from text, a polynomial or a number; the basis over Q.
K.degreeOver(k), K.towerLaw(), K.describe(), K.toNumberField()The degree over the k-th level; the tower law spelled out; the underlying number field of @ratmath/algebraic.
x.add, x.sub, x.mul, x.div, x.neg(), x.inverse(), x.pow(n), x.equals, x.isZero(), x.isRational, x.toRational()Exact arithmetic of elements.
x.coordinates(), x.toPoly(), x.toText(), x.toTeX(), x.value, x.approx()Coordinates in the basis; as a polynomial in the generators; the exact real algebraic number (when real) and a float.
x.minimalPolynomial(), x.minimalPolynomialText(), x.minimalPolynomialOver(k), x.degree, x.norm(), x.trace()Minimal polynomial over Q (Rationals, constant first) or over a level of the tower; norm and trace to Q.
K.primitiveElement(), K.subfield(x){ element, polynomial, text, expressions }; { degree, polynomial, text, isWhole } for Q(x).
K.roots(poly), K.factor(poly)Roots lying in K: [{ value, multiplicity }]; irreducible factors over K: [{ factor, multiplicity, degree, text }].
Automorphisms and the Galois correspondence
K.automorphisms()Every field automorphism, identity first: { index, images, apply(x) }, printing as "a ↦ −a, b ↦ b".
K.isGalois, K.automorphismGroup(), K.galoisGroup()Whether there are [K : Q] automorphisms; the group of them as a finite group (galoisGroup throws when K is not Galois).
K.fixedField(automorphisms){ degree, basis, generator, polynomial, text }: the elements fixed by all of them.
Solving by radicals
solveByRadicals(polynomial){ text, degree, solvable, reason, factors: [{ text, degree, multiplicity, group, order, solvable, chain, roots: [{ value, expression }] }] }. Text in x or integer coefficients, constant first; irreducible factors up to degree 7.
e.text, e.definitions, e.inline({ maxLength, tex }), e.toTeX(), e.rationalA RadicalExpression: in named steps, written out in one line (null when too long), for typesetting.
e.evaluate(digits), e.approx(), e.check(digits)Certified digits { re, im, real }; a float or { re, im }; { agrees, digits } from recomputing the formula and comparing with the root.
e.indices, e.usesOnlySquareRoots, e.sizeWhich roots are taken; whether square roots suffice; how many radicals.
rootOfUnityByRadicals(n)e^(2πi/n) as a RadicalExpression.
Ruler and compass
constructible(polynomial){ constructible: true | false | "some" | null, reason, factors: [{ text, degree, group, order, constructible, reason, roots }] }.
regularPolygon(n){ n, constructible, totient, reason, cos }: cos(2π/n) in square roots when φ(n) is a power of 2, else null.
constructiblePolygon(n)The same as regularPolygon(n) (Gauss–Wantzel). constructible also decides a proven minimal polynomial of cos(2π/n) of any degree.
classicalProblems.doublingTheCube(), .trisecting(cosine), .squaringTheCircle(){ problem, possible, polynomial, reason }.
Conway polynomials
conwayPolynomial(p, n, { limit })The Conway polynomial of GF(pⁿ) as BigInt coefficients, constant first, found by search.
conwayField(p, n)GF(pⁿ) on that polynomial: a field object with conway, text, gen (the standard generator) and embed(m) → { exponent, image, map } for m dividing n.
Symmetric polynomials
elementary(R, k), powerSum(R, k), completeHomogeneous(R, k)eₖ, pₖ and hₖ in the variables of R.
isSymmetric(f)Whether every permutation of the ring's variables fixes f.
toElementary(f, { prefix }){ polynomial, ring }: f written in e1, …, en (a polynomial of a new ring with those variables).

Errors

Bad input throws a RangeError or TypeError with a message that names the problem: a variable the ring does not have, an inexact division, a field that cannot decide whether a coefficient is zero, a factoring job too large for the method.

Try itEdit the code and run it with @ratmath/structures and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs