atlas Library · Script File
ratmat.at
implement type |ratmat| that makes doing linear algebra over $\Q$ possible This is firmly based on built-in limited integer |mat| support, and aims at providing an interface that resemble what basic.at does for |mat| By loading this file, you declare BEING AWARE that the chosen representation for rational matrices is susceptible to overflow problems for large matrices or those with complicated rational entries, and ACCEPTING the consequences. For safer rational linear algebra, use the Gaussian_elim.at script. Conversion functions |to_ratmat| and |to_rowrowrat| between |ratmat| and the [[rat]] type used there are defined below.
Definitions in source order
ratmat type
set_type [ ratmat = (mat,string,int) ] { matrix, slash, common denominator }the void component avoids unary/binary conflicts, as for -@(mat,int)L19
save_s
save_s : sa trick to locally rebind |s| (defined in basic.at) to constant string "/"
s
!s = "/"simplify
simplify(ratmat(M,,d)) = ratmat/
/ (mat M,int d) = ratmatalso in this file at line 33, line 89, line 91; also defined in basic.at, cyclotomic.at, polynomial.at, lazy_lists.at
*
* (rat f,mat M) = ratmatalso in this file at line 80, line 81, line 83, line 84, line 85, line 87, line 88, line 112, line 113, line 123; also defined in basic.at, extParamPol.at, complex.at, modules.at, hodge_tensor.at, tits_centralizer.at, stable.at, synthetic.at, Weylgroup.at, group_operations.at, tits.at, twisted_root_datum.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, sparse.at, lazy_lists.at
/
/ (mat M,rat f) = ratmatalso in this file at line 28, line 89, line 91; also defined in basic.at, cyclotomic.at, polynomial.at, lazy_lists.at
entry
entry (ratmat(M,,d),int i,int j) = ratmatrix
matrix ((int,int)(r,c),(int,int->rat) f) = ratmatmatrix defined by its dimension and expression for general entry
also defined in basic.at
n_rows
n_rows (ratmat(M,,)) = intalso defined in basic.at, cyclotomicMat.at
n_columns
n_columns (ratmat(M,,)) = intalso defined in basic.at, cyclotomicMat.at
columns
columns (ratmat(M,,d)) = [ratvec]rows
rows (ratmat(M,,d)) = [ratvec]column
column (ratmat(M,,d),int j) = ratvecalso defined in hodge_K_type_formula.at, stable.at
row
row (ratmat(M,,d),int i) = ratveccolumns_with 3 overloads
columns_with ((int,ratvec->bool) p,ratmat(M,,d)) = ratmatcolumns_with ((ratvec->bool) p,ratmat T) = ratmatcolumns_with ((int->bool) p,ratmat(M,,d)) = ratmatalso defined in basic.at
rows_with 3 overloads
rows_with ((int,ratvec->bool) p,ratmat(M,,d)) = ratmatrows_with ((ratvec->bool) p,ratmat T) = ratmatrows_with ((int->bool) p,ratmat(M,,d)) = ratmatalso defined in basic.at
kernel
kernel (ratmat(M,,)) = matalso defined in cyclotomic_Gaussian_elim.at
det
det (ratmat(M,,d)) = ratthis very easily overflows
also defined in basic.at, Gaussian_elim.at, cyclotomic_Gaussian_elim.at
^
^ (ratmat(M,,d)) = ratmattranspose
also in this file at line 95, line 111; also defined in basic.at, tits.at, cyclotomic.at, polynomial.at, sparse.at, lazy_lists.at
+ 2 overloads
+ (ratmat(M,s,d),int k) = ratmat+ (int k,ratmat(M,s,d)) = ratmatalso in this file at line 76, line 114, line 115, line 125; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, lazy_lists.at
- 2 overloads
- (ratmat(M,s,d),int k) = ratmat- (int k,ratmat(M,s,d)) = ratmatalso in this file at line 77, line 78, line 116, line 117, line 127; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomicMat.at, hodge_functions.at, lazy_lists.at
+
+ (ratmat(M,,d),ratmat(MM,,dd)) = ratmatalso in this file at line 72, line 73, line 114, line 115, line 125; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, lazy_lists.at
- 2 overloads
- (ratmat(M,,d),ratmat(MM,,dd)) = ratmat- (ratmat(M,s,d)) = ratmatalso in this file at line 74, line 75, line 116, line 117, line 127; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomicMat.at, hodge_functions.at, lazy_lists.at
* 7 overloads
* (ratvec v,ratmat(M,,d)) = ratvec* (ratmat(M,,d),ratvec v) = ratvec* (ratmat(M,,d),mat MM) = ratmat* (mat M,ratmat(MM,,d)) = ratmat* (ratmat(M,,d),ratmat(MM,,dd)) = ratmat* (rat a, ratmat(M,,d)) = ratmat* (ratmat(M,,d), rat a) = ratmatalso in this file at line 32, line 112, line 113, line 123; also defined in basic.at, extParamPol.at, complex.at, modules.at, hodge_tensor.at, tits_centralizer.at, stable.at, synthetic.at, Weylgroup.at, group_operations.at, tits.at, twisted_root_datum.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, sparse.at, lazy_lists.at
/ 2 overloads
/ (ratmat(M,,d), rat a) = ratmat/ (ratmat(M,,d)) = ratmatalso in this file at line 28, line 33; also defined in basic.at, cyclotomic.at, polynomial.at, lazy_lists.at
^
^ (ratmat(M,,d):Md,int e) = ratmatalso in this file at line 70, line 111; also defined in basic.at, tits.at, cyclotomic.at, polynomial.at, sparse.at, lazy_lists.at
ratmat_as_mat
ratmat_as_mat (ratmat(M,,d)) = matmat_as_ratmat
mat_as_ratmat (mat M) = ratmatdiagonal
diagonal(ratvec v) = ratmatratvecs_as_ratmat
ratvecs_as_ratmat ([ratvec] A) = ratmatconvert [ratvec] to ratmat, and define resulting operations involving a ratmat
to_ratmat
to_ratmat ([[rat]] A) = ratmatto_rowrowrat
to_rowrowrat (ratmat A) = [[rat]]^
^([ratvec] M) = ratmattranspose
also in this file at line 70, line 95; also defined in basic.at, tits.at, cyclotomic.at, polynomial.at, sparse.at, lazy_lists.at
* 2 overloads
* ([ratvec] M,ratmat MM) = ratmat* (ratmat M,[ratvec] MM) = ratmatalso in this file at line 32, line 80, line 81, line 83, line 84, line 85, line 87, line 88, line 123; also defined in basic.at, extParamPol.at, complex.at, modules.at, hodge_tensor.at, tits_centralizer.at, stable.at, synthetic.at, Weylgroup.at, group_operations.at, tits.at, twisted_root_datum.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, sparse.at, lazy_lists.at
+ 2 overloads
+ ([ratvec] M,ratmat MM) = ratmat+ (ratmat M,[ratvec] MM) = ratmatalso in this file at line 72, line 73, line 76, line 125; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, lazy_lists.at
- 2 overloads
- ([ratvec] M,ratmat MM) = ratmat- (ratmat M,[ratvec] MM) = ratmatalso in this file at line 74, line 75, line 77, line 78, line 127; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomicMat.at, hodge_functions.at, lazy_lists.at
inverse
inverse (ratmat(M,,d)) = ratmatalso defined in basic.at, combinatorics.at, parameters.at, tits.at, affine.at, cyclotomic.at, Gaussian_elim.at, cyclotomic_Gaussian_elim.at, lazy_lists.at
solve
solve (ratmat(M,,d), ratvec v) = Maybe<ratvec>also defined in basic.at
*
* ([ratvec] M,[ratvec] MM) = ratmatalso define resulting operations involving a mat
also in this file at line 32, line 80, line 81, line 83, line 84, line 85, line 87, line 88, line 112, line 113; also defined in basic.at, extParamPol.at, complex.at, modules.at, hodge_tensor.at, tits_centralizer.at, stable.at, synthetic.at, Weylgroup.at, group_operations.at, tits.at, twisted_root_datum.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, sparse.at, lazy_lists.at
+
+ ([ratvec] M,[ratvec] MM) = ratmatalso in this file at line 72, line 73, line 76, line 114, line 115; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, hodge_functions.at, lazy_lists.at
-
- ([ratvec] M,[ratvec] MM) = ratmatalso in this file at line 74, line 75, line 77, line 78, line 116, line 117; also defined in basic.at, extParamPol.at, modules.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomicMat.at, hodge_functions.at, lazy_lists.at
rational_inverse
rational_inverse(mat M) = ratmatdefine inverse of mat as ratmat
orth_reflection
orth_reflection (vec v) = ratmatorthogonal reflection with respect to standard scalar product
left_inverse
left_inverse(ratmat(A,,d)) = ratmatleft inverse of injective (full column rank) rational matrix adapted from |weak_left_inverse| in matrix.at
also defined in matrix.at
right_inverse
right_inverse(ratmat(A,,d)) = ratmatright inverse of a rational matrix.
formal dual of left_inverse
also defined in matrix.at
ratvec_to_string
ratvec_to_string(ratvec v) = stringshow ratvec as [rat], simplified
ratmat_to_bigmat
ratmat_to_bigmat (ratmat(A,,d)) = [[rat]]convert ratmat, i.e. (mat,string,int), to [[rat]]
## 3 overloads
## (ratmat A, ratmat B) = ratmatconcatenate horizontally, must have same depth
## (ratmat A, mat B) = ratmatconcatenate horizontally, must have same depth
## (mat A, ratmat B) = ratmatconcatenate horizontally, must have same depth
also defined in basic.at
show
show (ratmat(M,,d)) = voidalso defined in modules.at, K_Nilpotent.at, good_W_representatives.at, arthur_parameters.at, sub_cells.at, associated_variety_annihilator.at, geck_generic.at, L_packet.at, Levi_subgroups.at, nilpotent_orbits.at, subgroups.at, poset.at, cyclotomic.at, polynomial.at, character_tables.at, springer_tables.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, weak_packets.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at, exceptional.at, nilpotent_posets.at, lazy_lists.at
s
s : save_sfinally restore |s| from basic.at, and free the identifier |save_s|
Generated from atlas-scripts at commit 648506c (2026-10-13).