Built-in Functions

All built-in operators and functions provided by the Atlas software, grouped by type. Functions from the standard script files (loaded via <all.at) are documented in the Script Reference.

Arithmetic

Integer

+, -, * (int, int → int)

Standard integer arithmetic.

- (int → int)

Unary minus.

~ (int → int)

Subtraction from \(-1\): ~n = \(-1-n\). Also bitwise complementation.

^ (int, int → int)

Integer exponentiation (when the result is integral).

\ (int, int → int)

Integer (floor) quotient of Euclidean division.

% (int, int → int)

Integer remainder of Euclidean division. Result has the same sign as the divisor.

\% (int, int → int, int)

Returns both the quotient and remainder as a pair (q, r).

Rational

+, -, *, / (rat, rat → rat)

Standard rational arithmetic. Also available as (rat, int → rat).

% (rat → int, int)

Decompose a rational into its (numerator, denominator) pair.

floor (rat → int)

Largest integer \(\leq r\). Same as r\1.

ceil (rat → int)

Smallest integer \(\geq r\).

frac (rat → int)

Fractional part of a rational: r - floor(r).

Vector

+, - (vec, vec → vec)

Componentwise addition/subtraction of equal-length vectors.

* (vec, int → vec)

Scalar multiplication. The scalar comes second.

* (vec, vec → int)

Dot (scalar) product.

/ (vec, int → ratvec)

Scalar division, producing a rational vector.

flex_add, flex_sub (vec, vec → vec)

Variants of + and - that add/remove trailing zeros to match lengths.

convolve (vec, vec → vec)

Convolution product, removing trailing zeros.

Rational vector

+, - (ratvec, ratvec → ratvec)

Componentwise addition/subtraction.

*, / (ratvec, int → ratvec)    (ratvec, rat → ratvec)

Scalar multiplication/division.

% (ratvec → vec, int)

Decompose into (numerator vector, common denominator).

* (mat, ratvec → ratvec)    (ratvec, mat → ratvec)

Left and right multiplication of a rational vector by an integer matrix.

Matrix

+, - (mat, mat → mat)

Componentwise matrix addition/subtraction.

+, - (mat, int → mat)    (int, mat → mat)

Add/subtract a multiple of the identity matrix.

* (mat, vec → vec)    (mat, mat → mat)    (vec, mat → mat)

Matrix-vector, matrix-matrix, and vector-matrix products.

^ (mat → mat)    (vec → mat)

Unary ^: matrix transpose, or convert a vector to a single-row matrix.

Comparison

Axis provides unary comparison operators that test against 0. Note that >=n means n ≥ 0 — the operator is on the “wrong” side.
=, != (int → bool)

Test integer for (in)equality with 0.

>=, > (int → bool)

Test integer for non-negativity / strict positivity.

>, >=, <, <=, =, != (int, int → bool)

Standard relational operators.

=, != (vec → bool)

Test vector for being/not being the zero vector.

>=, > (vec → bool)

Test whether all entries are non-negative / positive (dominance conditions).

=, != (mat → bool)

Test matrix for being the zero matrix.

=, != (rat → bool)

Test rational for being zero.

Bitwise Operations and Integer Utilities

Integers encode sets of natural numbers as bitsets: a non-negative integer \(n\) encodes the positions of its set bits. A negative integer \(n\) encodes the complement of the set for \(-1-n\).
AND, OR, XOR (int, int → int)

Bitwise AND, OR, XOR.

AND_NOT (int, int → int)

AND_NOT(n,m) = AND of n with the complement of m.

bitwise_subset (int, int → bool)

Fast test whether the bitset of a is a subset of the bitset of b.

nth_set_bit (int, int → int)

nth_set_bit(n,k): position of the \(n\)-th set bit of k. Returns \(-1\) if there is no such bit.

bit_length (int → int)

For \(n \ge 0\): least \(k \ge 0\) with \(n < 2^k\).

to_bitset (vec → int)

Bitset with bit \(i\) set iff \(i\) appears in the vector.

gcd (vec → int)

Greatest common divisor of all entries of a vector.

Bezout (vec → int, mat)

GCD and an invertible matrix recording the column operations transforming the vector to \((d,0,0,\ldots)\). The first column gives the Bézout coefficients.

Strings and I/O

## (string, string → string)

String concatenation. Also ([string] → string) to concatenate a list.

# (string → int)

Length of a string.

to_string (*,... → string)

String representation of arguments, concatenated.

print (T → T)

Print value followed by newline; return the same value unchanged.

prints (*,... → void)

Print values without quotes or commas, followed by newline.

error (*,... → *)

Print values and abort with a runtime error.

ascii (string → int)    (int → string)

ASCII code of the first character, or a one-character string for a given code.

elapsed_ms (→ int)

Milliseconds elapsed since program startup.

query (string → string)

Display a prompt and return the user's response.

system (string → (void | (int,string)))

Execute a shell command; return exit code and stdout, or void on severe failure.

Vector and Matrix Construction

null (int → vec)    (int,int → mat)

Zero vector of given length, or zero matrix of given dimensions.

id_mat (int → mat)

Identity matrix of given size.

diagonal (vec → mat)

Square diagonal matrix with given diagonal entries.

shape (mat → int,int)

Dimensions (rows, columns) of a matrix.

rows, columns (mat → [vec])

List of rows or columns of a matrix.

row, column (mat, int → vec)

Select the i-th row or column.

stack_rows ([vec] → mat)

Assemble vectors into a matrix, zero-extending short rows.

# (int, [vec] → mat)

Combine column vectors of specified height into a matrix. Height must be provided explicitly in case the list is empty.

^ (int, [vec] → mat)

Combine row vectors of specified width into a matrix.

swiss_matrix_knife (int, mat, int, int, int, int → mat)

General matrix slicing and transformation. The first integer encodes 8 option bits: row/column reversal, tilde-indexing for each bound, transposition, and entry negation. The basic call swiss_matrix_knife(0,A,i,k,j,l) returns A[i:k,j:l].

Linear Algebra

These functions operate over \(\mathbb{Z}\).
echelon (mat → mat, mat, [int], int)

Column echelon form. Returns (M,C,s,eps): echelon form, unimodular column-operation matrix with \(A \cdot C = M\) extended by zero columns (whose last columns are a kernel basis), pivot row list, and sign of \(\det(C)\).

linear_solve (mat, vec → (void | vec, int, mat))

Complete rational solution to \(Ax = b\). Returns empty_set or (v,n,M) where \(v/n\) is a particular solution and columns of \(M\) span the kernel.

diagonalize (mat → vec, mat, mat)

Partial Smith reduction to diagonal form. Returns nonzero diagonal entries and the two unimodular matrices applied left and right.

adapted_basis (mat → mat, vec)

Returns an invertible matrix \(B\) and positive integer list \(c\) such that \(c_j B_j\) span the image lattice.

kernel (mat → mat)

Columns spanning the kernel (null space).

eigen_lattice (mat, int → mat)

Kernel of \(M - \lambda I\) for integer eigenvalue \(\lambda\).

row_saturate (mat → mat)

Transform the row system to have the same kernel but with the row-span forming a saturated sublattice.

Smith (mat → mat, vec)

Smith normal form. Returns invertible basis matrix and invariant factors; each factor divides the next.

invert (mat → mat, int)

Matrix inverse over \(\mathbb{Q}\): returns integer numerator matrix and minimal denominator \(d\) with \(M \cdot \text{inv} = d \cdot I\).

mod2_section (mat → mat)

Find a section of a binary matrix over \(\mathbb{Z}/2\mathbb{Z}\).

subspace_normal (mat → mat, mat, mat, [int])

Given binary column vectors, find a reduced echelon basis for their span, the combination matrix, a basis for the relations, and the pivot positions.

Lie Types

Lie_type (string → LieType)

Parse a string like "A4.T1.D4" as a Lie type. Factors are one of A,B,C,D,E,F,G,T followed by a rank. Total rank ≤ 32.

Lie_type (RootDatum → LieType)

Lie type of a root datum.

extend (LieType, string, int → LieType)

Add a single (type, rank) factor to a Lie type.

simple_factors (LieType → [string,int])

List of simple factors as (letter, rank) pairs. Central torus factors are ignored.

rank (LieType → int)

Total rank including both simple factors and any central torus.

Cartan_matrix (LieType → mat)

Cartan matrix of the semisimple part in standard Bourbaki diagram ordering.

Cartan_matrix_type (mat → LieType, [int])

Determine the Lie type whose Cartan matrix matches (up to a permutation). Returns the type and the permutation.

Smith_Cartan (LieType → mat, vec)

Smith basis for the weight lattice modulo the root sublattice, with invariant factors.

involution (LieType, [int], string → mat)

Involution matrix for a simply-connected datum of the given type, described symbolically by the inner class string ('e'/'c' = compact, 's' = split, 'u' = unequal rank, 'C' = complex).

quotient_basis (LieType, [ratvec] → mat)

Interpret rational vectors as kernel generators (Fokko convention) and return the sublattice basis. Used in constructing root data.

Root Data

root_datum (mat, mat, bool → RootDatum)

Construct a root datum from simple roots and simple coroots as columns. The boolean flag indicates whether coroots should be used for the generating order.

root_datum (LieType, mat, bool → RootDatum)

Root datum from a Lie type and sublattice basis. The columns give a basis for a sublattice of the character lattice of the simply-connected group, which must contain the root lattice.

simply_connected (LieType, bool → RootDatum)

Simply-connected root datum for a Lie type.

adjoint (LieType, bool → RootDatum)

Adjoint root datum: sublattice for the semisimple factor is the root lattice. Dual to simply_connected.

dual (RootDatum → RootDatum)

Dual root datum, swapping roots and coroots.

rank, semisimple_rank (RootDatum → int)

Rank of the weight lattice; rank of the root lattice.

nr_of_posroots (RootDatum → int)

Number of positive roots.

two_rho, two_rho_check (RootDatum → vec)

\(2\rho\) = sum of positive roots; \(2\check\rho\) = sum of positive coroots.

simple_roots, simple_coroots (RootDatum → mat)

Simple roots / coroots as columns.

posroots, poscoroots (RootDatum → mat)

All positive roots / coroots as columns.

root, coroot (RootDatum, int → vec)

Root or coroot at given index. Indices run from -nr_of_posroots to nr_of_posroots-1; simple roots are at 0, 1, …

root_index, coroot_index (RootDatum, vec → int)

Index of a given root or coroot. Returns nr_of_posroots if the vector is not a root.

Cartan_matrix (RootDatum → mat)

Cartan matrix with entries \(\langle \alpha_i, \alpha_j^\vee \rangle\). Square, of size the semisimple rank.

fundamental_weight, fundamental_coweight (RootDatum, int → ratvec)

\(i\)-th fundamental weight \(\omega_i\) (dual to simple coroots) or coweight.

integrality_datum (RootDatum, ratvec → RootDatum)

Sub-root-datum whose coroots take integral values on \(\gamma\) (the integrality subsystem).

integrality_rank (RootDatum, ratvec → int)

Semisimple rank of the integrality datum.

is_integrally_dominant (RootDatum, ratvec → bool)

Whether \(\gamma\) is dominant for all integral coroots.

Weyl_orbit (RootDatum, vec → mat)

Weyl group orbit of a weight as columns; first column is the dominant weight.

derived_info (RootDatum → RootDatum, mat)

Root datum of the derived group and the matrix mapping weights from original to derived.

integrality_points (RootDatum, ratvec → [rat])

Increasing list of positive fractions \(f \le 1\) for which \(f \cdot \lambda\) has more integrality than generically.

Weyl Group

W_elt (RootDatum, [int] → WeylElt)

Weyl group element from a word in the simple reflections (0-indexed).

W_refl (RootDatum, int → WeylElt)

Simple reflection at a root index.

word (WeylElt → [int])

A reduced word as a list of simple reflection indices.

length (WeylElt → int)

Length of a Weyl group element.

* (WeylElt, WeylElt → WeylElt)

Composition of Weyl group elements.

/ (WeylElt → WeylElt)

Inverse of a Weyl group element.

* (WeylElt, vec → vec)    (vec, WeylElt → vec)

Left action on a weight; right action on a coweight.

root_permutation (WeylElt → vec)

The permutation of the full root system induced by the Weyl group element.

from_dominant (RootDatum, vec → WeylElt, vec)

Find the dominant weight \(v\) in the orbit of \(\lambda\), and the minimal \(w\) with \(\lambda = w \cdot v\). Returns \((w,v)\).

Inner Classes

An InnerClass is a root datum together with an involution \(\theta\) of \(X^*\), classifying a family of real forms.
inner_class (RootDatum, mat → InnerClass)

Construct from a root datum and involution matrix. If the matrix is not a based root datum involution, it is replaced by \(w \cdot \theta\) for suitable \(w \in W\).

distinguished_involution (InnerClass → mat)

The distinguished involution defining the inner class.

dual (InnerClass → InnerClass)

Dual inner class for the dual complex group.

nr_of_real_forms, nr_of_dual_real_forms (InnerClass → int)

Number of real forms / dual real forms.

nr_of_Cartan_classes (InnerClass → int)

Total number of Cartan classes.

block_sizes (InnerClass → mat)

Matrix of block sizes (rows = real forms, columns = dual real forms).

form_names, dual_form_names (InnerClass → [string])

Names of real forms / dual real forms.

occurrence_matrix (InnerClass → mat)

Real form × Cartan class incidence matrix (1 if the Cartan class occurs for that real form).

Real Forms

real_form (InnerClass, int → RealForm)

Select a real form by index.

quasisplit_form, dual_quasisplit_form (InnerClass → RealForm)

The quasisplit real form / dual real form.

inner_class (RealForm → InnerClass)

The inner class containing the real form.

form_number (RealForm → int)

Index of this real form in its inner class.

KGB_size (RealForm → int)

Size of \(K \backslash G/B\).

KGB_Hasse (RealForm → mat)

Hasse diagram of the Bruhat order on \(K \backslash G/B\).

Cartan_order (RealForm → mat)

Partial order on Cartan classes as a matrix.

components_rank (RealForm → int)

Rank of \(\pi_0(G(\mathbb{R}))\). Number of connected components is \(2^{\text{components\_rank}}\).

base_grading_vector (RealForm → ratvec)

Dominant rational coweight \(c\) for which \(\exp(\pi i c)\) equals the special torus element \(t_0\) used for torus_bits.

Cartan Classes

Cartan_class (InnerClass, int → CartanClass)    (RealForm, int → CartanClass)

Select a Cartan class by index from an inner class or a real form.

most_split_Cartan (RealForm → CartanClass)

Most split Cartan class for a real form.

Cartan_info (CartanClass → (int,int,int), vec, (int,int), (LieType,LieType,LieType))

Detailed information: (compact, complex, split) torus ranks; canonical twisted involution; (orbit size, fiber size); types of (imaginary, real, complex) root subsystems.

involution (CartanClass → mat)

Weight lattice involution \(\theta\) for this Cartan class.

real_forms (CartanClass → [RealForm])

Real forms for which this Cartan class occurs.

fiber_partition (CartanClass, RealForm → [int])

Identifying part of the fiber group for the real form at this Cartan class.

print_gradings (CartanClass, RealForm →)

Print gradings of imaginary roots, equivalent to the gradings command in Fokko.

KGB Elements

Elements of \(K \backslash G/B\) parametrize the fibers of representation parameters over Cartan classes.
KGB (RealForm, int → KGBElt)

Select a KGB element by index.

% (KGBElt → RealForm, int)

Recover real form and index. Inverse of KGB.

involution (KGBElt → mat)

The involution \(\theta\) of \(X^*\).

length (KGBElt → int)

Length within the KGB set (dimension of the \(K\)-orbit).

status (int, KGBElt → int)

Status of a simple root at a KGB element. Encoding: 0 = C− (complex descent), 1 = ic (imaginary compact), 2 = r (real), 3 = nc (imaginary noncompact), 4 = C+ (complex ascent).

cross (int, KGBElt → KGBElt)

Cross action of a simple reflection on a KGB element.

Cayley (int, KGBElt → KGBElt)

Cayley or inverse Cayley transform through a root, whichever is defined.

torus_factor (KGBElt → ratvec)

The \(\theta^t\)-stable rational coweight \(v\). For imaginary \(\alpha\), parity of \(\langle v + \check\rho_i, \alpha \rangle\) determines compactness.

torus_bits (KGBElt → vec)

Binary vector distinguishing KGB elements at the same involution.

twist (KGBElt → KGBElt)    (KGBElt, mat → KGBElt)

Twist by the distinguished involution \(\delta\), or by a given external involution.

Blocks

block (RealForm, RealForm → Block)

Construct a block for a compatible pair of real form and dual real form.

% (Block → RealForm, RealForm)

Recover real form and dual real form. Inverse of block.

# (Block → int)

Number of elements in the block.

element (Block, int → KGBElt, KGBElt)

KGB and dual KGB elements for a block element at given index.

status (int, Block, int → int)

Status of simple reflection s at block element i. Codes: 0=C−, 1=ic, 2=r1, 3=r2, 4=C+, 5=rn, 6=i1, 7=i2.

raw_KL (Block → mat, [vec], vec)

Raw KL data: polynomial-index matrix, list of KL polynomials as coefficient vectors, and length-boundary vector stops.

dual_KL (Block → mat, [vec], vec)

Dual KL polynomials (\(Q\)-polynomials) in the same format.

W_graph (Block → [[int],[int,int]])

W-graph data: for each block element its \(\tau\)-invariant and list of outgoing edges as (destination, μ) pairs.

W_cells (Block → [[int],[[int],[int,int]]])

W-cell decomposition: for each cell, the list of block element numbers and the restricted W-graph.

Split Integers

A split integer is an element \(a + b \cdot s\) of \(\mathbb{Z}[s]/(s^2-1)\), where \(s^2 = 1\). Split integers serve as coefficients in virtual module polynomials.
+, -, * (Split, Split → Split)

Arithmetic in \(\mathbb{Z}[s]/(s^2-1)\).

% (Split → int, int)

Decompose into (a,b) components: the value is \(a + b \cdot s\).

K-types

A KType represents a standard \(K\)-representation or its irreducible quotient, parametrized by a pair \((x, \lambda - \rho)\).
K_type (KGBElt, vec → KType)

Form a K-type from \((x, \lambda - \rho)\).

% (KType → KGBElt, vec)

Recover \((x, \lambda - \rho)\).

height (KType → int)

Height: sum of \(|\langle (1+\theta)\lambda, \alpha^\vee \rangle|\) over positive coroots.

is_standard (KType → bool)

\(\lambda\) is dominant for all imaginary roots.

is_zero (KType → bool)

\(\lambda\) is singular on a compact imaginary root.

is_final (KType → bool)

Standard, nonzero, and semifinal. Required for terms in a KTypePol.

K_type_formula (KType, int → KTypePol)

Irreducible \(K\)-representation as a combination of standards, with height limit (-1 = no limit).

null_K_module (RealForm → KTypePol)

The zero K-module for a real form.

branch (KTypePol, int → KTypePol)

Decompose standard K-representations into irreducibles, up to given height.

full_deform (Param → KTypePol)

Deform all the way to \(\nu = 0\), yielding the K-type decomposition.

Module Parameters

A Param represents a standard module or irreducible, parametrized by \((x, \lambda-\rho, \nu)\).
param (KGBElt, vec, ratvec → Param)

Form a parameter from \((x, \lambda-\rho, \nu)\).

% (Param → KGBElt, vec, ratvec)

Recover \((x, \lambda-\rho, \gamma)\) where \(\gamma\) is the infinitesimal character.

infinitesimal_character (Param → ratvec)

The infinitesimal character \(\gamma\).

is_standard, is_zero, is_final (Param → bool)

Standard: \(\gamma\) dominant for imaginary roots. Zero: \(\gamma\) singular on a compact imaginary root. Final: standard, nonzero, semifinal, with dominant \(\gamma\) — required for terms in ParamPol.

dominant (Param → Param)

Make the infinitesimal character dominant.

cross (int, Param → Param)    (vec, Param → Param)

Cross action of a simple reflection (by index in the integrality datum, or by root vector).

Cayley (int, Param → Param)    (vec, Param → Param)

Cayley or inverse Cayley transform through a reflection.

orientation_nr (Param → int)

Orientation number, used in computing Hermitian forms.

reducibility_points (Param → [rat])

Fractions \(0 < t \le 1\) for which \(I(x,\lambda,t\nu)\) is reducible.

* (Param, rat → Param)

Scale the \(\nu\) component by a rational factor.

block (Param → [Param], int)

Block as a list of final parameters and index of the original.

KL_block (Param → [Param], int, mat, [vec])

Block plus KL table: parameters, index of original, polynomial-index matrix, polynomial list.

length (Param → int)

Length within its block.

integrality_datum (Param → RootDatum)

Root datum whose coroots are integral on the infinitesimal character.

Virtual Modules

A ParamPol is a formal \(\mathbb{Z}[s]\)-linear combination of final parameters.
null_module (RealForm → ParamPol)

The zero virtual module.

+, - (ParamPol, Param → ParamPol)

Add or subtract a parameter with coefficient 1.

+ (ParamPol, (Split,Param) → ParamPol)

Add a parameter with a split integer coefficient.

* (Split, ParamPol → ParamPol)

Scale a virtual module by a split integer.

first_term, last_term (ParamPol → Split, Param)

Lowest and highest terms by height.

truncate_above_height (ParamPol, int → ParamPol)

Drop terms with height above the given limit.

* (ParamPol, rat → ParamPol)

Scale \(\nu\) in each term and renormalize.

Deformation and Kazhdan-Lusztig

deform (Param → ParamPol)

Deformation terms when \(\nu\) decreases, using KL polynomials.

full_deform (Param → KTypePol)

Deform recursively to \(\nu = 0\), producing the K-type decomposition.

full_deform (Param, int → (void | KTypePol))

Time-limited version: returns void if time limit (in ms) is exceeded.

twisted_full_deform (Param → KTypePol)

Like full_deform but uses twisted KL polynomials. Parameter must be fixed under the twist.

KL_sum_at_s (Param → ParamPol)

The signed sum \(\sum_{x \le y} (-1)^{\ell(y)-\ell(x)} P_{x,y}[q:=s] \cdot x\).

KL_column (Param → [int, Param, vec])

Nonzero KL polynomials \(P(x,y)\) with the given parameter as \(y\): list of (n, x, P(x,y)).

extended_block (Param, mat → [Param], mat, mat, mat)

Extended block for a parameter and external involution \(\delta\). Returns \(\delta\)-fixed parameters and matrices encoding types and neighbor relations for extended generators.

raw_ext_KL (Param, mat → mat, [vec], vec)

Extended KL data in raw format. Negative matrix entries indicate the polynomial should be negated.

block_deform (Param, ParamPol, int → ParamPol, ParamPol)

Deform all terms of a virtual module block-by-block, with height cutoff.

Printing Functions

print_KGB (RealForm →)

Print the KGB set.

print_block (Block →)    (Param →)

Print a block in Fokko format.

print_KL_basis, print_prim_KL, print_KL_list (Block →)

Print Kazhdan-Lusztig data in various formats.

print_W_cells, print_W_graph (Block →)

Print W-cell and W-graph data.

print_strong_real (CartanClass →)

Print strong real form data for a Cartan class.

readline_completions (string → [string])

All identifier completions of a given prefix. Useful for interactive exploration.