Documentation contents

atlas Library · Script File

cyclotomicMat.at

Source
atlas-scripts/cyclotomicMat.at (301 lines)
Definitions
46
Loads
Loaded by
tits_centralizer.at cyclotomic_Gaussian_elim.at cyclotomic_Lie_algebra.at

Definitions in source order

CyclotomicVec type

L5
set_type CyclotomicVec = [CyclotomicFieldElement] { sublists are matrix rows, not columns! }

CyclotomicMat type

L6
set_type CyclotomicMat = [[CyclotomicFieldElement]] { sublists are matrix rows, not columns! }

n_rows

L8n_rows(CyclotomicMat M) = int

also defined in basic.at, ratmat.at

n_columns

L9n_columns(CyclotomicMat M) = int

also defined in basic.at, ratmat.at

F

L11F(CyclotomicMat M) = CyclotomicField

also in this file at line 36; also defined in good_W_representatives.at, cyclotomic_Lie_algebra.at

embed

L13embed(ratvec v,CyclotomicField F) = CyclotomicVec

also defined in cyclotomic.at, character_table_reps.at, cyclotomic_Lie_algebra.at, bracket.at

is_rational

L15is_rational(CyclotomicVec v) = bool

also defined in cyclotomic.at

to_rational

L16to_rational(CyclotomicVec v) = ratvec

also defined in cyclotomic.at

format

L20format (CyclotomicFieldElement z) = string
redefine show more concisely

also defined in cyclotomic.at, polynomial.at, extended_misc.at, bracket.at

show 2 overloads

L25show (CyclotomicFieldElement z) = void
display cyclotomic field element as polynomial in x.
L27show(CyclotomicVec v) = void

also in this file at line 84; also 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, ratmat.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, bracket.at, exceptional.at, nilpotent_posets.at, lazy_lists.at

Cyclotomic vectors
L31

=

L33=(CyclotomicVec v,CyclotomicVec w) = bool

also in this file at line 38; also defined in basic.at, combinatorics.at, modules.at, parabolics.at, synthetic.at, hash.at, tits.at, K_highest_weights.at, nilpotent_orbits.at, cyclotomic.at, polynomial.at, W_reps_type_BC.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, extended.at, disconnected.at, cyclotomic_Lie_algebra.at, bracket.at

F

L36F(CyclotomicVec v) = CyclotomicField

also in this file at line 11; also defined in good_W_representatives.at, cyclotomic_Lie_algebra.at

=

L38=(CyclotomicVec v) = bool

also in this file at line 33; also defined in basic.at, combinatorics.at, modules.at, parabolics.at, synthetic.at, hash.at, tits.at, K_highest_weights.at, nilpotent_orbits.at, cyclotomic.at, polynomial.at, W_reps_type_BC.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, extended.at, disconnected.at, cyclotomic_Lie_algebra.at, bracket.at

!=

L39!=(CyclotomicVec v) = bool

also defined in basic.at, combinatorics.at, synthetic.at, hash.at, tits.at, cyclotomic.at, polynomial.at

+

L41+(CyclotomicVec v,CyclotomicVec w) = CyclotomicVec

also in this file at line 77, line 118; also defined in basic.at, extParamPol.at, modules.at, ratmat.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, bracket.at, hodge_functions.at, lazy_lists.at

*

L45*(CyclotomicFieldElement z,CyclotomicVec v) = CyclotomicVec

also in this file at line 91, line 96, line 99, line 102, line 131, line 134; 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, ratmat.at, tits.at, twisted_root_datum.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, bracket.at, hodge_functions.at, sparse.at, lazy_lists.at

- 2 overloads

L48-(CyclotomicVec v) = CyclotomicVec
L49-(CyclotomicVec v,CyclotomicVec w) = CyclotomicVec

also in this file at line 81, line 82, line 122; also defined in basic.at, extParamPol.at, modules.at, ratmat.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, hodge_functions.at, lazy_lists.at

dot_product 2 overloads

L52dot_product(CyclotomicVec v,CyclotomicVec w,CyclotomicField F) = CyclotomicFieldElement
include F in case of vectors of length 0
L56dot_product(CyclotomicVec v,CyclotomicVec w) = CyclotomicFieldElement
will fail if vector has length 0

also in this file at line 64; also defined in polynomial.at

null

L59null(int n,CyclotomicField F) = CyclotomicVec

also in this file at line 67, line 137; also defined in all_finite_order.at, cyclotomic_Lie_algebra.at, bracket.at

cyclotomic_vector

L61cyclotomic_vector(ratvec v,CyclotomicField F) = CyclotomicVec

dot_product

L64dot_product(ratvec v,CyclotomicVec w) = CyclotomicFieldElement

also in this file at line 52, line 56; also defined in polynomial.at

null

L67null(int n,CyclotomicField F) = CyclotomicVec

also in this file at line 59, line 137; also defined in all_finite_order.at, cyclotomic_Lie_algebra.at, bracket.at

bar

L69bar(CyclotomicVec v) = CyclotomicVec

also defined in cyclotomic.at

is_real

L70is_real(CyclotomicVec v) = bool

also defined in basic.at, cyclotomic.at

Cyclotomic matrices
L73

shape

L75shape (CyclotomicMat M) = (int,int)

also defined in polynomial.at

+

L77+ (CyclotomicMat M,CyclotomicMat N) = CyclotomicMat

also in this file at line 41, line 118; also defined in basic.at, extParamPol.at, modules.at, ratmat.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, bracket.at, hodge_functions.at, lazy_lists.at

- 2 overloads

L81-(CyclotomicMat M) = CyclotomicMat
L82- (CyclotomicMat M,CyclotomicMat N) = CyclotomicMat

also in this file at line 48, line 49, line 122; also defined in basic.at, extParamPol.at, modules.at, ratmat.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, hodge_functions.at, lazy_lists.at

show

L84show(CyclotomicMat M)

also in this file at line 25, line 27; also 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, ratmat.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, bracket.at, exceptional.at, nilpotent_posets.at, lazy_lists.at

* 4 overloads

L91*(CyclotomicMat A,CyclotomicMat B) = CyclotomicMat
L96*(CyclotomicFieldElement z,CyclotomicMat M) = CyclotomicMat
L99*(CyclotomicMat M,CyclotomicVec v) = CyclotomicVec
L102*(CyclotomicMat M,CyclotomicVec v) = CyclotomicVec

also in this file at line 45, line 131, line 134; 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, ratmat.at, tits.at, twisted_root_datum.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, bracket.at, hodge_functions.at, sparse.at, lazy_lists.at

cyclotomic_matrix

L105cyclotomic_matrix([[rat]] M,CyclotomicField F) = CyclotomicMat

diagonal_mat

L108diagonal_mat(CyclotomicVec v) = CyclotomicMat

scalar_mat

L115scalar_mat(CyclotomicFieldElement z,int n) = CyclotomicMat

also in this file at line 125

+

L118+(CyclotomicMat M,CyclotomicFieldElement z) = CyclotomicMat

also in this file at line 41, line 77; also defined in basic.at, extParamPol.at, modules.at, ratmat.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, bracket.at, hodge_functions.at, lazy_lists.at

-

L122-(CyclotomicMat M,CyclotomicFieldElement z) = CyclotomicMat

also in this file at line 48, line 49, line 81, line 82; also defined in basic.at, extParamPol.at, modules.at, ratmat.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, hodge_functions.at, lazy_lists.at

scalar_mat

L125scalar_mat(rat r,int n,CyclotomicField F) = CyclotomicMat

also in this file at line 115

id_mat

L128id_mat(int n,CyclotomicField F) = CyclotomicMat

* 2 overloads

L131*(CyclotomicFieldElement z,CyclotomicMat M) = CyclotomicMat
L134*(rat r,CyclotomicMat M) = CyclotomicMat

also in this file at line 45, line 91, line 96, line 99, line 102; 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, ratmat.at, tits.at, twisted_root_datum.at, cyclotomic.at, polynomial.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, cyclotomic_Lie_algebra.at, bracket.at, hodge_functions.at, sparse.at, lazy_lists.at

null

L137null(int m,int n,CyclotomicField F) = CyclotomicMat

also in this file at line 59, line 67; also defined in all_finite_order.at, cyclotomic_Lie_algebra.at, bracket.at

Commented-out code, lines 140–301 (159 lines)
{ update one entry in a list of polynomials, for instance in a row of a matrix }
set update_row ([i_poly] R, int j,i_poly v) = [i_poly]: R[j]:=v; R
{ update one row of a matrix (replacing it by a given new row) }
set update_matrix_row (CyclotomicMat M, int i, [i_poly] row)= CyclotomicMat:
   M[i]:=row; M
{ update one entry in a matrix }
set update_matrix_entry(CyclotomicMat M, int i, int j, i_poly v)= CyclotomicMat:
  let row=M[i] in row[j]:=v; M[i]:=row; M

set zero_poly_row (int n) = [i_poly]: for :n do poly_0 od
set zero_poly_matrix (int rows, int columns) = CyclotomicMat:
  let !row=zero_poly_row(columns) in for :rows do row od
set zero_poly_matrix(int n) = CyclotomicMat:zero_poly_matrix(n,n)
set scalar_poly_matrix (int n, int c) = CyclotomicMat:
  let !row=zero_poly_row(n) { model row, almost equal to each wanted row } in
  for i:n do update_row(row,i,constant_poly(c)) od
set identity_poly_matrix (int n) = CyclotomicMat: scalar_poly_matrix(n,1)
set mat_as_poly_mat (mat M) = CyclotomicMat:
 let (r,c)=shape(M) in for i:r do for j:c do [M[i,j]] od od

set + (CyclotomicMat M, i_poly p) = CyclotomicMat: { add polynomial scalar matrix }
  for row@i in M  do for e@j in row do if i=j then e+p else e fi od od
set - (CyclotomicMat M, i_poly p) = CyclotomicMat: M+-p

set ^ = (i_poly,int->i_poly): { power of a polynomial }
  let one=i_poly:[1] { use local constant for efficiency } in
  (i_poly p,int n) i_poly: { the actual powering function }
    if n=0 then [1]
    else { no point in trying to do this by repeated squaring: is not faster }
      let f=p in while (n-:=1)>0 do f *:= p od; f
    fi

{ equality of polynomial matrices }
set = (CyclotomicMat A,CyclotomicMat B) = bool:
  all(#A, (int i): let r=A[i],s=B[i] in #r=#s and all(#r, (int j): r[j]=s[j] ))

{ polynomial matrix is 0 if all its entries are zero-length polynomials }
set is_zero (CyclotomicMat M) = bool:
  all(#M, (int i): let r=M[i] in all(#r, (int j): =#r[j]) )

set upper_unitriangular_inverse (CyclotomicMat P) = CyclotomicMat:
  let n=#P { number of rows in matrix }, dummy_row=zero_poly_row(0)
  then Q= for :n do dummy_row od { prepare |n| rows, but leave them empty now }
  in { solve equation $P*Q=I$ for $Q$, proceeding from bottom to top }
  for i:n { reverse traversal loop with reverse accumulation -> straight value }
  ~do let Pi=P[i] { we use only this part of P during this iteration } in
    Q[i] := { computed row is stored as |Q[i]|, and contributed to result }
    (zero_poly_row(i) # poly_1) { beginning of row |Q[i]| is somewhat boring }
    ## { concatenate with more interesting newly computed part of |Q[i]| }
      for j: n-i-1 from i+1 { left to right, but computations are independent }
      do let sum=poly_0 in for k: j-i from i+1 do sum -:= Pi[k] * Q[k][j] od
      ; sum    { contribute $Q_{i,j} = - \sum_{k=i+1}^j P_{i,k}Q_{k,j}$ }
      od
  ~od

set lower_unitriangular_inverse(CyclotomicMat M)=transpose(upper_unitriangular_inverse(transpose(M)))

{ compute PMP^{-1} where P is a permutation of [1,,,n]
  and M is a polynomial matrix
}
set poly_permute_basis([int] P, CyclotomicMat A) = CyclotomicMat: { P is permutation }
  for i:#A do let row=A[P[i]] in for j:#row do row[P[j]] od od

{ some printing functions }

{ make a printable string out of a polynomial and name of indeterminate,
  for use in other print functions }
set poly_format (i_poly v, string q)= string:
   if =v then "0"
   else
    ##for c@k in v
      do
         if =c then ""
         else
            let coef = if c<0 then "-" else "+" fi +
                if abs(c)=1 and k>0 then "" else int_format(abs(c)) fi
	    ,  term = if k>1 then q+"^"+int_format(k) elif k=0 then "" else q fi
	    in string: coef+term
         fi
      od
   fi

{ for |int_poly| and |rat_poly| that value names the indeterminate; use it }
set to_string (int_poly(X,cs,)) = string:
   if =#cs then "0"
   else
      let pow(int k) = string: { print X^k, possibly shortened }
          if k>1 then X+"^"+k.to_string elif k=1 then X else "" fi
      in
    ##for c@k in cs
      do case c
         then "-" + if c!=minus_1 or =k then (-c).to_string else "" fi + pow(k)
         in "" { nothing for terms with a zero coefficient }
         else "+" + if c>1 or =k then c.to_string else "" fi + pow(k)
         esac
      od
   fi

set to_string (rat_poly(X,cs,)) = string:
   if =#cs then "0"
   else
      let pow(int k) = string: { print X^k, possibly shortened }
          if k>1 then X+"^"+k.to_string elif k=1 then X else "" fi
      in
    ##for c@k in cs
      do if c.= then ""
         else let (n,d)=%c in
         ##[if n.< then "-" next n:=-n else "+" fi
           ,if d>1 then c.to_string elif n>1 or k=0 then n.to_string else "" fi
           ,if k>1 then X+"^"+k.to_string elif k=1 then X else "" fi
           ]
         fi
      od
   fi


{ nice printing of a polynomial }
set printPoly (i_poly v) = void: prints(poly_format(v,"q"))

{ M=poly_mat is a polynomial matrix; e.g.
  expr> set M= poly_mat: [[ [0,1], [0,0,1]], [[0], [1]]]
  expr> printPolyMatrix (M)
   +q +q^2
   0 +1
}

set printPolyMatrix(CyclotomicMat M,int space_size,string char)= void:
  let space= " "*space_size, wd = max(for v in ##M do #poly_format(v,char) od)
  in
    for row in M
    do prints(##for v in row do space+l_adjust(wd,poly_format(v,char)) od)
    od
set printPolyMatrix(CyclotomicMat M,int space_size)= void:printPolyMatrix(M,space_size,"q")
set printPolyMatrix (CyclotomicMat M,string char) = void: printPolyMatrix(M,3,char)
set printPolyMatrix (CyclotomicMat M) = void: printPolyMatrix(M,3)

{ this provides maybe more meaningful names for |flex_add| and friends }
set poly_plus    = +@(i_poly,i_poly) { this binding will remain exported }
set poly_minus   = -@(i_poly,i_poly) { this binding will remain exported }
set poly_product = *@(i_poly,i_poly) { this binding will remain exported }

{ restore normal vector arithmetic }
forget +@(vec,vec)
forget -@(vec,vec)
forget *@(vec,vec)
set + = fix_add@(vec,vec)
set - = fix_sub@(vec,vec)
set * = dot_product@(vec,vec)

set sgn_poly (int k) = i_poly:
  assert(!=k,"taking sign of 0"); [if k.< then -1 else 1 fi]

set divide_by (int k,i_poly v) = i_poly: ratvec_as_vec(v/k)

{i_polynomial has only non-negative coefficients}
set is_non_negative = (i_poly->bool): >=@vec { same condition as "dominance" }

set top_left_square_block (CyclotomicMat M,int size) = CyclotomicMat:
  for row in M[:size] do row[:size] od

Generated from atlas-scripts at commit 648506c (2026-10-13).