basic.at
The foundational script loaded automatically at Atlas startup. Defines 796 functions spanning generic containers, arithmetic utilities, and wrapper functions for every Atlas type from integers through module parameters.
This file is loaded automatically when you start Atlas with the standard wrapper script. You do not need to type <basic.at manually. Everything here supplements the built-in functions.
Generic Type Constructors (11)
Generic container types (parametric types) defined at the top of basic.at. These include One_of<S,T> (a discriminated union representing success or failure), Maybe<T> (an optional value), and Iterator<T> (a lazy stream).
| Name | Signature | Description |
|---|---|---|
| succeeds | (One_of<S,T> v) = bool: case v | fail: false | succeed: true esac | |
| fails | (One_of<S,T> v) = bool: case v | fail: true | succeed: false esac | |
| as_list | (One_of<S,T> v) = [T]: case v | fail: [] | succeed(x): [x] esac | |
| requisition | (string message) = (One_of<S,T> v) T: | |
| requisition | = (One_of<S,T>->T): | |
| can | (Maybe<T> v) = bool: | |
| collect | ([Maybe<T>] L) = [T]: for x in L do x.as_list od.## | |
| take | (int n,Iterator<T> (get,incr) ) = [T]: | |
| ! | (Iterator<T> (get,incr)) = void: | |
| count | (Iterator<T> (get,incr)) = int: { run through iteration, counting } | run through iteration, counting |
| to_list | (Iterator<T> (get,incr)) = [T]: |
Timing, Diagnostics & Assertions (9)
Utilities for timing, printing, and asserting correctness during Atlas sessions.
| Name | Signature | Description |
|---|---|---|
| time | ((->T)f) = T: let t=elapsed_ms() in f() next print(elapsed_ms ()-t) | |
| where | = void: | |
| print_lines | ([T] a) = void: for x in a do print(x) od | |
| prints_lines | ([T] a) = void: for x in a do prints(x) od | |
| ! | = prints_lines@[T] { allow printing any list line-by-line as |list!| } | allow printing any list line-by-line as |list!| |
| seat_belt_on | = true { whether runtime tests are activated } | whether runtime tests are activated |
| assert | ((->bool,string)f) = void: { the fastest form when disabled } | the fastest form when disabled |
| assert | ((->bool)b,string message) = void: { for easier conversion } | for easier conversion |
| assert | ((->bool)b) = void: assert(@:(b(),"assertion failed")) |
Iteration & List Support (45)
Higher-order functions for working with arrays and lists: map, filter, fold, sort, and iteration helpers.
| Name | Signature | Description |
|---|---|---|
| # | (int n) = [int]: for i:n do i od { [0,1,...,n-1] } | [0,1,...,n-1] |
| indices | ([T]a) = [int]: # #a { faster than |for @i in a do i od| } | faster than |for @i in a do i od| |
| # | (bool b) = int: if b then 1 else 0 fi { Iverson symbol } | Iverson symbol |
| sign | (bool b) = int: { |(-1)^#b|, i.e.: } if b then -1 else 1 fi | |(-1)^#b|, i.e.: |
| range | (int a, int b) = [int]: for i : b-a from a do i od | |
| ^ | = !=@(bool,bool) { simple exclusive or } | simple exclusive or |
| count | (int limit,(int->bool) predicate) = int: | |
| all | ([bool] p) = bool: | |
| any | ([bool] p) = bool: | |
| none | ([bool] p) = bool: | |
| first | ([bool] p) = int: | |
| last | ([bool] p) = int: | |
| count | ([bool] p) = int: { count (sum) number of truths in list } | count (sum) number of truths in list |
| XOR | ([bool] p) = bool: { exclusive or (sum modulo 2) of all truths in list } | exclusive or (sum modulo 2) of all truths in list |
| all | ([(->bool)] p) = bool: | |
| any | ([(->bool)] p) = bool: | |
| none | ([(->bool)] p) = bool: | |
| first | ([(->bool)] p) = int: | |
| last | ([(->bool)] p) = int: { this is somewhat more efficient than first } | this is somewhat more efficient than first |
| all | (int limit,(int->bool) predicate) = bool: | |
| any | (int limit,(int->bool) predicate) = bool: | |
| none | (int limit,(int->bool) predicate) = bool: | |
| first | (int limit,(int->bool) predicate) = int: | |
| last | (int limit,(int->bool) predicate) = int: | |
| all | ([T] L,(T->bool) predicate) = bool: | |
| any | ([T] L,(T->bool) predicate) = bool: | |
| none | ([T] L,(T->bool) predicate) = bool: | |
| first | ([T] L,(T->bool) predicate) = int: | |
| last | ([T] L,(T->bool) predicate) = int: | |
| get_first | ([T] L,(T->bool) predicate) = Maybe<T>: | |
| get_last | ([T] L,(T->bool) predicate) = Maybe<T>: | |
| get_first | ((T->S) attr, (S,S->bool)eq) = ([T]a, S b) Maybe<T>: | |
| get_last | ((T->S) attr, (S,S->bool)eq) = ([T]a, S b) Maybe<T>: | |
| for_some | ((S,T->bool)rel, [T]a) = (S x) bool: | |
| for_none | ((S,T->bool)rel, [T]a) = (S x) bool: | |
| for_all | ((S,T->bool)rel, [T]a) = (S x) bool: | |
| min | ((T,T->bool)leq) = (T x, T y) T: if leq(x,y) then x else y fi | |
| max | ((T,T->bool)leq) = (T x, T y) T: if leq(x,y) then y else x fi | |
| min_list | ((T,T->bool)leq) = ([T] a) T: | |
| max_list | ((T,T->bool)leq) = ([T] a) T: | |
| min_init | ((T,T->bool)leq) = (T !seed) ([T]->T): | |
| max_init | ((T,T->bool)leq) = (T !seed) ([T]->T): | |
| mindex | ((T,T->bool)leq) = ([T] a) int: | |
| maxdex | ((T,T->bool)leq) = ([T] a) int: | |
| reverse | ([T] r) = [T]: r~[:] |
Membership Testing & Search (12)
Testing membership in lists and performing binary search.
| Name | Signature | Description |
|---|---|---|
| is_member | ((T,T->bool)eq) = ([T] a) (T->bool): for_some(eq,a) | |
| isnt_member | ((T,T->bool)eq) = ([T] a) (T->bool): for_none(eq,a) | |
| binary_search_first | ((int->bool)pred, int low, int high) = int: | |
| binary_search_in | ([T] a,(T,T->bool) leq) = (T->Maybe<int>): | |
| binary_search_in | ([S] a,(S->T)f,(T,T->bool) leq) = (T->Maybe<int>): | |
| binary_search_get | ([S] a,(S->T)f,(T,T->bool) leq) = (T->Maybe<S>): | |
| binary_lookup | ((T,T->bool) leq) = (T x,[T]a) Maybe<int>: | |
| binary_lookup_by | ((S->T)f,(T,T->bool) leq) = (T x,[S]a) Maybe<int>: | |
| binary_lookup | = (int,[int]->Maybe<int>): binary_lookup(<=@(int,int)) | |
| binary_lookup | = (string,[string]->Maybe<int>): | |
| locate_sorted | ([int] v,int lwb) = int: { first index of entry >= |lwb| } | first index of entry >= |lwb| |
| from_stops | ([int] stops) = (int->int): |
Integers (68)
Arithmetic and utility functions for integers beyond the built-ins: absolute value, sign, GCD, LCM, divisibility tests, bitset operations, and more.
| Name | Signature | Description |
|---|---|---|
| abs | (int k)= int: if k<0 then -k else k fi | |
| sign | (int k)= int: case k then -1 in 0 else 1 esac | |
| is_odd | (int n) = bool: !=n%2 | |
| is_even | (int n) = bool: =n%2 | |
| min | = min(<=@(int,int)) | |
| max | = max(<=@(int,int)) | |
| min | = min_list(<=@(int,int)) | |
| max | = max_list(<=@(int,int)) | |
| min | = min_init(<=@(int,int)) | |
| max | = max_init(<=@(int,int)) | |
| min_loc | = mindex(<=@(int,int)) | |
| max_loc | = maxdex(<=@(int,int)) | |
| gcd | = (int,int->int): { greatest common divisor; no size limit } | greatest common divisor; no size limit |
| gcd_big | v) = int: | |
| lcm | (int a,int b) = int: let d=gcd(a,b) in if d=1 then a*b else a\d*b fi.abs | |
| lcm | ([int] v) = int: let m=1 in for x in v do m:=lcm(m,x) od; m | |
| = | ((int,int)(x0,y0),(int,int)(x1,y1)) = bool: x0=x1 and y0=y1 | |
| ! | ((int,int)(x0,y0),(int,int)(x1,y1)) = bool: x0!=x1 or y0!=y1 | |
| * | (int c,[int] r) = [int]: for a in r do c*a od | |
| sum | ([int] r) = int: let s=0 in for a in r do s+:=a od; s | |
| product | ([int] r) = int: let p=1 in for a in r do p*:=a od; p | |
| half | (int n) = int: let (q,r)=n\%2 in assert(@:r=0,"Inexact halving"); q | |
| exact_divide | (int a, int b) = int: | |
| int_format | = to_string@int | |
| exp_2 | (int n) = int: [n].to_bitset { 2^n, but more efficient } | 2^n, but more efficient |
| full_bitset | (int n) = int: exp_2(n)-1 { to_bitset(#n), but more efficient } | to_bitset(#n), but more efficient |
| is_member_bitset | (int i,int B) = bool: bitwise_subset(exp_2(i),B) | |
| isnt_member_bitset | (int i,int B) = bool: bitwise_subset(exp_2(i),~B) | |
| is_member_fast | (vec L) = (int->bool): | |
| isnt_member_fast | (vec L) = (int->bool): | |
| list | (int limit, (int->bool) predicate) = [int]: | |
| complement | (int limit,(int->bool) predicate) = [int]: | |
| complement | (int n, vec list) = [int]: list(n, isnt_member_fast(list) ) | |
| sort_u_below | (int n) = ([int] L) [int]: list(n,is_member_fast(L)) | |
| is_subset | (vec S,vec L) = bool: bitwise_subset(S.to_bitset,L.to_bitset) | |
| is_disjoint | (vec S,vec L) = bool: bitwise_subset(S.to_bitset,~L.to_bitset) | |
| contains | (vec S) = (vec->bool): | |
| contains | (int s) = (vec->bool): contains(vec:[s]) | |
| is_subset_of | (vec L) = (vec->bool): | |
| is_disjoint_from | (vec L) = (vec->bool): | |
| first_set_bit | (int n) = int: bit_length(AND_NOT(n-1,n)) | |
| unset_first_set_bit | (int n) = int: AND(n,n-1) | |
| set_bit_positions | (int n) = vec: | |
| set_bit_positions | (int n,int limit) = vec: | |
| first_unset_bit | (int n) = int: bit_length(AND_NOT(n,n+1)) | |
| set_first_unset_bit | (int n) = int: OR(n,n+1) | |
| unset_bit_positions | (int n) = vec: | |
| unset_bit_positions | (int n,int limit) = vec: set_bit_positions(~n,limit) | |
| bitwise_intersection | ([int] ns) = int: | |
| bitwise_union | ([int] ns) = int: | |
| is_member | = ([int]->(int->bool)): is_member(=@(int,int)) | |
| isnt_member | = ([int]->(int->bool)): isnt_member(=@(int,int)) | |
| is_member_sorted | ([int] v) = (int->bool): | |
| isnt_member_sorted | ([int] v) = (int->bool): | |
| is_subset_of_sorted | ([int] sorted) = ([int]->bool): | |
| is_disjoint_from_sorted | ([int] sorted) = ([int]->bool): | |
| factorial | (int n) = int: let p=1 in for i:n-1 from 2 do p *:=i od; p | |
| ! | = factorial@int { allo conventional factorial notation } | allo conventional factorial notation |
| to_base_poly | (int b) = (int->vec): | |
| to_base_fixed_length | (int b, int l) = (int->vec{of length |l|}): | of length |l| |
| to_base | (int b, (int->string) digit) = (int->string): | |
| binary | = (int->string): | |
| digits36 | = (int->string): { map digits in base up to 36 to a letter } | map digits in base up to 36 to a letter |
| hexadecimal | = (int->string): | |
| cumulate_forward | ([int] seq) = [int]: | |
| cumulate_backward | ([int] seq) = [int]: | |
| forward_differences | ([int] seq) = [int]: { inverse of |cumulate_forward| } | inverse of |cumulate_forward| |
| backward_differences | ([int] seq) = [int]: { inverse of |cumulate_backward| } | inverse of |cumulate_backward| |
Rational Numbers (24)
Utilities for rational numbers: numerator/denominator access, integer tests, floor/ceiling/rounding.
| Name | Signature | Description |
|---|---|---|
| numer | (rat a) = let (n,)=%a in n | |
| denom | (rat a) = let (,d)=%a in d | |
| is_integer | (rat r) = bool: denom(r)=1 | |
| sign | (rat a) = int: sign(numer(a)) { denominator is always positive } | denominator is always positive |
| abs | (rat a) = rat: sign(a)*a | |
| \ | ((rat,rat)p) = int: floor(/p) | |
| \% | ((rat,int)p) = (int,rat): (\p,%p) { shouldn't these two be built-in? } | shouldn't these two be built-in? |
| \% | ((rat,rat)p) = (int,rat): (\p,%p) | |
| floor | ([rat] v) = vec: for a in v do floor(a) od | |
| ceil | ([rat] v) = vec: for a in v do ceil(a) od | |
| min | = min(<=@(rat,rat)) | |
| max | = max(<=@(rat,rat)) | |
| min | = min_list(<=@(rat,rat)) | |
| max | = max_list(<=@(rat,rat)) | |
| min | = min_init(<=@(rat,rat)) | |
| max | = max_init(<=@(rat,rat)) | |
| min_loc | = mindex(<=@(rat,rat)) | |
| max_loc | = maxdex(<=@(rat,rat)) | |
| sum | ([rat] r) = rat: let s=rat:0 in for a in r do s+:=a od; s | |
| product | ([rat] r) = rat: let p=rat:1 in for a in r do p*:=a od; p | |
| * | ([rat] v, [rat] w) = rat: | |
| * | ([int] v, [rat] w) = rat: | |
| rat_as_int | (rat r) = int: | |
| with_decimals | (int n) = (rat->string): (rat r) string: |
Strings (29)
String utilities: character indexing, formatting, repetition, and output helpers.
| Name | Signature | Description |
|---|---|---|
| char_index | (string c, string s) = int: first(#s,(int i)bool: c=s[i]) | |
| is_member | = ([string]->(string->bool)): is_member(=@(string,string)) | |
| isnt_member | = ([string]->(string->bool)): isnt_member(=@(string,string)) | |
| + | = ##@(string,string) { + aliases string concatenation "ax" ## "is" } | + aliases string concatenation "ax" ## "is" |
| * | = (string,int->string): { repeat string; use recursive doubling } | repeat string; use recursive doubling |
| * | (int n,string s) = string: s*n { allow factor to come first } | allow factor to come first |
| + | (string s, int i)= string: s + int_format(i) | |
| + | (int i, string s)= string: int_format(i) + s | |
| + | (string s, (int,int)(x,y)) = s + "(" + x + "," + y + ")" | |
| plural | (int n) = string: if n=1 then "" else "s" fi | |
| plural | (int n,string s) = string: n + if n=1 then s else s+"s" fi | |
| concat | = ##@[string] | |
| join | ([string] elts, string sep, string unit) = string: | |
| l_adjust | (int w, string s) = string: | |
| r_adjust | (int w, string s) = string: | |
| c_adjust | (int w, string s) = string: | |
| width | (int n) = int: #int_format(n) | |
| split | (string S) = [string]: for l in S do l od | |
| split_lines | (string text) = [string]: | |
| is_substring | (string key, string text) = bool: | |
| fgrep | (string s, string text) = [string]: | |
| compact_string | (ratvec v) = string: | |
| filter | ((T->bool) pred) = ([T]->[T]): | |
| map | ((S->T) f) = ([S] a) [T]: for x in a do f(x) od | |
| split | ([S,T] l) = ([S],[T]): ( for(s,)in l do s od, for(,t)in l do t od ) | |
| zip | ([S] a,[T] b) = [S,T]: | |
| unzip | ([S,T] list) = ([S],[T]): | |
| transpose | ([[T]] rr) = [[T]]: | |
| matrix_assign | a,int i, int j, T v) = [[T]]: |
Vectors (24)
Functions for constructing and manipulating integer vectors (vec): identity rows, reversal, slicing helpers, inner products, and conversions.
| Name | Signature | Description |
|---|---|---|
| vector | (int n,(int->int)f) = vec: for i:n do f(i) od | |
| identity_row | (int n,int i) = vec: for j:n do #(i=j) od | |
| ones | (int n) = vec: for i:n do 1 od | |
| is_member | = ([vec]->(vec->bool)): is_member(=@(vec,vec)) | |
| isnt_member | = ([vec]->(vec->bool)): isnt_member(=@(vec,vec)) | |
| ~ | (vec v)= vec: v~[:] | |
| lower | (int k,vec v)= vec: v[:k] | |
| upper | (int k,vec v)= vec: v[k~:] | |
| drop_lower | (int k,vec v)= vec: v[k:] | |
| drop_upper | (int k,vec v)= vec: v[:k~] | |
| <= | (vec v) = bool: >= -v { anti-dominance (in fundamental weight coords) } | anti-dominance (in fundamental weight coords) |
| < | (vec v) = bool: > -v { strict anti-dominance } | strict anti-dominance |
| sum | (int l,[vec] list) = vec: { sum of vecs of constant length l } | sum of vecs of constant length l |
| all_words | ([vec] alphabets) = mat: | |
| all_words | ([[T]] alphabets) = [[T]]: | |
| all_words | ([int] limits) = mat: | |
| all_0_1_vecs | (int n) = [vec]: all_words(for :n do 2 od) | |
| power_set | ([T] S) = [[T]]: | |
| choices_from | ([T] S, int k) = [[T]]: { all $k$-subsets of $S$ } | all $k$-subsets of $S$ |
| multiplicity | ((T,T->bool)eq) = (T,[T]->int): | |
| all_0_1_vecs_with_sum | (int n,int k) = [vec]: | |
| mixed_radix_nr | radix) = (vec->int): | |
| mixed_radix_word | radix) = (int->vec): | |
| pad | ([int] v,int N) = vec: v##null(N-#v) | number of times n occurs in [int] S |
Matrices (63)
Extensive matrix utilities: construction, block operations, row/column manipulation, Gram-Schmidt, and more.
| Name | Signature | Description |
|---|---|---|
| matrix | ((int,int)(r,c),(int,int->int) f) = mat: | |
| n_rows | (mat m) = int: let (r,) = shape(m) in r | |
| n_columns | = #@mat { this one is built in as a # operator overload } | this one is built in as a # operator overload |
| as_column | (vec v) = mat: [v] { interpret v as single column } | interpret v as single column |
| as_row | = ^@vec { interpret v as single row } | interpret v as single row |
| ~ | (mat A) = mat: { reverse rows and reverse columns } | reverse rows and reverse columns |
| block_matrix | (mat A,mat B) = mat: | |
| block_matrix | ([mat] list) = mat: | |
| main_diagonal | (mat A) = vec: for i:shape(A).min do A[i,i] od | |
| = | (mat m,int k) = bool: =(m-k) | |
| # | (mat m, vec v) = mat: n_rows(m) { require size match } # (columns(m)#v) | require size match |
| # | (vec v, mat m) = mat: n_rows(m) { require size match } # (v#columns(m)) | require size match |
| ^ | (mat m, vec v) = mat: n_columns(m) ^ (rows(m)#v) | |
| ^ | (vec v, mat m) = mat: n_columns(m) ^ (v#rows(m)) | |
| ## | (mat A, mat B) = mat: { concatenate horizontally, must have same depth } | concatenate horizontally, must have same depth |
| ^ | (mat A, mat B) = mat: { concatenate vertically, must have same width } | concatenate vertically, must have same width |
| ## | (int n,[mat] L) = mat: | |
| map_on | (mat m) = ((int->int)->mat): | |
| * | (int c,mat m) = mat: map_on(m)((int e) int: c*e) | |
| - | (mat m)= mat: { transform 36+128=164: 128 means negate entries } | transform 36+128=164: 128 means negate entries |
| sum | ((int,int) shape, [mat] L) = mat: | |
| sum | (int n,[mat] L) = mat: sum((n,n),L) | |
| product | (int n, [mat] L) = mat: | |
| gcd | M) = int: | |
| \ | (mat m,int d) = mat: map_on(m)((int e) int: e\d) | |
| % | (mat m,int d) = mat: map_on(m)((int e) int: e%d) | |
| Smith_basis | (mat M) = mat: let (basis,)=Smith(M) in basis | |
| inv_fact | (mat M) = vec: let (,invf)=Smith(M) in invf | |
| image | (mat M) = mat: let (im,,,)=echelon(M) in im | |
| ^ | = (mat,int->mat): | |
| inverse | (mat M) = mat: | |
| / | = inverse@mat { so |/M| is the same as |M^-1|, but more direct } | so |/M| is the same as |M^-1|, but more direct |
| rank | (mat A) = int: let (,,pivots,)=A.echelon in #pivots | |
| det | (mat A) = int: | |
| trace | (mat A) = int: | |
| char_poly | (mat A) = vec: { characteristic polynomial of integer matrix } | characteristic polynomial of integer matrix |
| cokernel | (mat M) = ^kernel(^M) { minimal matrix wose kernel is our image } | minimal matrix wose kernel is our image |
| saturated_span | (mat M) = bool: { whether columns span saturated sublattice } | whether columns span saturated sublattice |
| all | (mat m,(vec->bool) pred) = bool: all([vec]:m,pred) | |
| any | (mat m,(vec->bool) pred) = bool: any([vec]:m,pred) | |
| none | (mat m,(vec->bool) pred) = bool: none([vec]:m,pred) | |
| first | (mat m,(vec->bool) pred) = int: first([vec]:m,pred) | |
| last | (mat m,(vec->bool) pred) = int: last([vec]:m,pred) | |
| columns_with | ((int,vec->bool) p,mat m) = mat: | |
| columns_with | ((vec->bool) p,mat m) = mat: | |
| columns_with | ((int->bool) p,mat m) = mat: | |
| a_column_with | ((vec->bool) p,mat m) = Maybe<vec>: | |
| rows_with | ((int,vec->bool) p,mat m) = mat: | |
| rows_with | ((vec->bool) p,mat m) = mat: | |
| rows_with | ((int->bool) p,mat m) = mat: | |
| a_row_with | ((vec->bool) p,mat m) = Maybe<vec>: | |
| >= | m) = bool: { non-negative (dominant) columns only } all(m,>=@vec) | non-negative (dominant) columns only |
| > | m) = bool: { strictly positive (dominant) columns only } all(m,>@vec) | strictly positive (dominant) columns only |
| <= | m) = bool: all(m,<=@vec) | |
| < | m) = bool: all(m,<@vec) | |
| lookup_column | (vec v,mat m) = int: last(columns(m),(vec w)bool: w=v) | |
| lookup_row | (vec v,mat m) = int: last( rows(m),(vec w)bool: w=v) | |
| sum | (mat m)= vec: m*ones(n_columns(m)) | |
| solve | (mat A,vec b) = Maybe<vec>: | |
| solve | (mat A,mat B) = Maybe<mat>: { matrix |X| satisfying |A*X=B|, if any } | matrix |X| satisfying |A*X=B|, if any |
| required_solution | ((mat,vec) system) = vec: system.solve.requisition | |
| required_solution | ((mat,mat) system) = mat: system.solve.requisition | |
| order | (mat !M) = int: |
Rational Vectors (20)
Functions for rational vectors (ratvec): numerator/denominator access, arithmetic, and conversion.
| Name | Signature | Description |
|---|---|---|
| numer | (ratvec a) = vec: let (n,)=%a in n | |
| denom | (ratvec a) = int: let (,d)=%a in d | |
| * | (int i,ratvec v) = ratvec: v*i | |
| * | (rat r,ratvec v) = ratvec: v*r | |
| ## | (ratvec a,ratvec b) = ratvec: ##([rat]:a,[rat]:b) | |
| ## | ([ratvec] rs) = ratvec: ## for r in rs do [rat]:r od | |
| sum | (int l,[ratvec] list) = ratvec: { sum of ratvecs of constant length l } | sum of ratvecs of constant length l |
| * | ([ratvec] M,ratvec v) = ratvec: | |
| is_integer | (ratvec v) = bool: let (,d)=%v in d=1 { equivalently =(v%1) } | equivalently =(v%1) |
| \ | (ratvec v, int k) = vec: let (n,d)=%v in n\(k*d) | |
| ratvec_as_vec | (ratvec v) = vec: | |
| ~ | (ratvec v)= ratvec: v~[:] | |
| lower | (int k,ratvec v)= ratvec: v[:k] | |
| upper | (int k,ratvec v)= ratvec: v[k~:] | |
| drop_lower | (int k,ratvec v)= ratvec: v[k:] | |
| drop_upper | (int k,ratvec v)= ratvec: v[:k~] | |
| <= | (ratvec v) = bool: <=numer(v) | |
| < | (ratvec v) = bool: < numer(v) | |
| solve | (mat A, ratvec b) = Maybe<ratvec>: | |
| required_solution | ((mat,ratvec) system) = ratvec: system.solve.requisition |
Split Integers (17)
Functions for split integers a+b·s where s²=1: extracting parts, evaluating at s=±1, and arithmetic.
| Name | Signature | Description |
|---|---|---|
| int_part | (Split x) = int: let (r,)=%x in r | |
| s_part | (Split x) = int: let (,y)=%x in y | |
| s_to_1 | (Split x) = int: +%x { let (a,b)=%x in a+b } | let (a,b)=%x in a+b |
| s_to_minus_1 | (Split x) = int: -%x { let (a,b)=%x in a-b } | let (a,b)=%x in a-b |
| times_s | (Split x) = let (a,b)=%x in Split: (b,a) | |
| bar | x)=Split: let (a,b)=%x in Split: (a,-b) | |
| split_as_int | (Split x) = int: | |
| \% | (Split x, int n) = (Split,Split): | |
| half | (Split w) = Split: let (q,r)=w\%2 in assert(@: =r,"Inexact halving"); q | |
| / | (Split w,int n) = Split: | |
| % | (Split w,int n) = Split: let (a,b)=%w in (a%n,b%n) | |
| exp_s | n) = Split: if n.is_even then 1 else s fi | |
| is_pure | (Split w)=bool: =*%w { test if product of both components is zero } | test if product of both components is zero |
| split_format | (Split w) = string: | |
| split_factor_format | (Split w) = string: | |
| ^ | = (Split,int->Split): { exponentiation of split integers } | exponentiation of split integers |
| sum | ([Split] list) = Split: |
Lie Types (10)
Helpers for Lie types beyond the built-ins: constructing from a code and rank, counting simple vs torus factors.
| Name | Signature | Description |
|---|---|---|
| Lie_type | (string code, int rank) = LieType: extend(LieType:"",code,rank) | |
| semisimple_rank | (LieType t) = int: | |
| central_torus_rank | (LieType t) = int: t.rank-t.semisimple_rank | |
| factors | (LieType t) = [string,int]: | |
| semisimple | (LieType t) = LieType: | |
| derived_is_simple | (LieType t) = bool: #simple_factors(t)=1 | |
| is_simple | (LieType t) = bool: t.derived_is_simple and =t.central_torus_rank | |
| adjoint_2rho | (LieType t) = vec: { $2\rho$ on basis of simple roots } | $2\rho$ on basis of simple roots |
| simply_connected_2rho_check | (LieType t) = vec: | |
| str | (LieType t) = string: |
Root Data (120)
Extensive root datum utilities: constructing standard groups (GL, SL, Sp, SO, G2, F4, E6/7/8), working with roots, weights, and the root system.
| Name | Signature | Description |
|---|---|---|
| root_indices | (RootDatum rd) = [int]: { list of all legal root indices } | list of all legal root indices |
| central_torus_rank | (RootDatum rd) = int: rd.Lie_type.central_torus_rank | |
| dimension | (RootDatum rd) = int: 2*nr_of_posroots(rd)+rank(rd) | |
| derived_is_simple | rd) = bool: Lie_type(rd).derived_is_simple | |
| is_simple | rd) = bool: Lie_type(rd).is_simple | |
| root_datum | (mat simple_roots, mat simple_coroots) = RootDatum: | |
| torus_datum | (int rank) = RootDatum: | |
| root_datum | (LieType type, mat lattice) = RootDatum: | |
| simply_connected | (LieType type) = RootDatum: | |
| adjoint | (LieType type) = RootDatum: | |
| simply_connected | (RootDatum rd) = RootDatum: | |
| adjoint | (RootDatum rd) = RootDatum: { change weight basis to simple roots } | change weight basis to simple roots |
| sub_datum | (RootDatum rd, [int]S) = RootDatum: | |
| root_datum | ([vec] simple_roots, [vec] simple_coroots, int r) = RootDatum: | |
| root_datum | (LieType t, [ratvec] gens) = RootDatum: | |
| root_datum | (LieType t, ratvec gen) = RootDatum: root_datum(t,[gen]) | |
| all_simples | (RootDatum rd) = [int]: #semisimple_rank(rd) | |
| all_posroots | (RootDatum rd) = [int]: #nr_of_posroots(rd) | |
| all_roots | (RootDatum rd) = [int]: let npr = rd.nr_of_posroots in | |
| is_root | ((RootDatum,vec) (rd,):p) = bool: | |
| is_coroot | ((RootDatum,vec) (rd,):p) = bool: | |
| is_posroot | ((RootDatum,vec)(rd,):p) = bool: | |
| is_poscoroot | ((RootDatum,vec)(rd,):p) = bool: | |
| is_negroot | ((RootDatum,vec)(rd,):p) = bool: root_index(p)<0 | |
| is_negcoroot | ((RootDatum,vec)(rd,):p) = bool: coroot_index(p)<0 | |
| posroot_index | ((RootDatum,vec)p) = int: { fold roots to positive } | fold roots to positive |
| poscoroot_index | ((RootDatum,vec)p) = int: { fold coroots to positive } | fold coroots to positive |
| Cartan_matrix | (RootDatum rd,[int] simples) = mat: { NB strange convention } | NB strange convention |
| rho | (RootDatum rd) = ratvec: rd.two_rho/2 | |
| rho_check | (RootDatum rd) = ratvec: rd.two_rho_check/2 | |
| two_rho | (RootDatum rd,(int->bool) select) = vec: { sum of selected posroots } | sum of selected posroots |
| two_rho_check | (RootDatum rd,(int->bool) select) = vec: | |
| two_rho | (RootDatum rd,[int] simples) = vec: | |
| two_rho_check | (RootDatum rd,[int] simples) = vec: | |
| is_positive_root | (RootDatum rd) = (vec->bool): | |
| is_positive_coroot | (RootDatum rd) = (vec->bool): | |
| is_negative_root | (RootDatum rd) = (vec->bool): | |
| is_negative_coroot | (RootDatum rd) = (vec->bool): | |
| is_positive_root | (RootDatum rd,vec alpha) = bool: | |
| is_positive_coroot | (RootDatum rd,vec alphav) = bool: | |
| is_negative_root | (RootDatum rd,vec alpha) = bool: | |
| is_negative_coroot | (RootDatum rd,vec alphav) = bool: | |
| roots_all_positive | (RootDatum rd) = (mat->bool): { no negative roots } | no negative roots |
| coroots_all_positive | (RootDatum rd) = (mat->bool): { no negative coroots } | no negative coroots |
| among_posroots | (RootDatum rd) = (mat M)bool: { all columns M posroots? } | all columns M posroots? |
| among_poscoroots | (RootDatum rd) = (mat M)bool: { all columns M poscoroots? } | all columns M poscoroots? |
| negative_system | (mat posroots) = mat: { the missing half of the root system } | the missing half of the root system |
| roots | (RootDatum rd) = mat: | |
| coroots | (RootDatum rd) = mat: | |
| root | (RootDatum rd, vec alpha_v) = vec: root(rd,coroot_index(rd,alpha_v)) | |
| coroot | (RootDatum rd, vec alpha) = vec: coroot(rd,root_index(rd,alpha)) | |
| is_orthogonal | (RootDatum rd, int i, int j) = bool: =coroot(rd,i)*root(rd,j) | |
| is_orthogonal | (RootDatum rd, vec alpha, vec beta) = bool: | |
| is_orthogonal | (RootDatum rd, [int] S, int j) = bool: | |
| reflection | (RootDatum rd, int i) = mat: { i indexes a root/coroot pair } | i indexes a root/coroot pair |
| reflection | ((RootDatum,vec)(rd,):p) = mat: { specify root (not coroot) } | specify root (not coroot) |
| reflection_co | ((RootDatum,vec)(rd,):p) = mat: { specify coroot (not root) } | specify coroot (not root) |
| reflect | (RootDatum rd, int i, vec v) = vec: { apply reflection(rd,i)*v } | apply reflection(rd,i)*v |
| reflect | (RootDatum rd, vec alpha, vec v) = vec: { reflection(rd,alpha)*v } | reflection(rd,alpha)*v |
| coreflect | (RootDatum rd, vec v, int i) = vec: { apply v*reflection(rd,i) } | apply v*reflection(rd,i) |
| coreflect | (RootDatum rd, vec v, vec alpha) = vec: { v*reflection(rd,alpha) } | v*reflection(rd,alpha) |
| reflect | (RootDatum rd, int i, ratvec v) = ratvec: | |
| reflect | (RootDatum rd, vec alpha, ratvec v) = ratvec: | |
| coreflect | (RootDatum rd, ratvec v, int i) = ratvec: | |
| coreflect | (RootDatum rd, ratvec v, vec alpha) = ratvec: | |
| left_reflect | (RootDatum rd, int i, mat M) = mat: { reflection(rd,i)*M } | reflection(rd,i)*M |
| left_reflect | (RootDatum rd, vec alpha, mat M) = mat: | |
| right_reflect | (RootDatum rd, mat M, int i) = mat: { M*reflection(rd,i) } | M*reflection(rd,i) |
| right_reflect | (RootDatum rd, mat M, vec alpha) = mat: | |
| conjugate | (RootDatum rd, int i, mat M) = mat: { r*M*r where r=reflection } | r*M*r where r=reflection |
| conjugate | (RootDatum rd, vec alpha, mat M) = mat: | |
| root_span_projector | (RootDatum rd ,[int] S) = (mat,int): | |
| wall_projector | ((RootDatum,[int]) arg) = (mat,int): | |
| singular_simple_indices | (RootDatum rd,ratvec v) = [int]: | |
| is_imaginary | (mat theta) = (vec->bool): (vec alpha): theta*alpha=alpha | |
| is_real | (mat theta) = (vec->bool): (vec alpha): theta*alpha=-alpha | |
| is_complex | (mat theta) = (vec->bool): (vec alpha): | |
| imaginary_roots | (RootDatum rd, mat theta) = mat: | |
| real_roots | (RootDatum rd, mat theta) = mat: | |
| imaginary_coroots | (RootDatum rd, mat theta) = mat: | |
| real_coroots | (RootDatum rd, mat theta) = mat: | |
| imaginary_posroots | (RootDatum rd,mat theta) = mat: | |
| real_posroots | (RootDatum rd,mat theta) = mat: | |
| imaginary_poscoroots | (RootDatum rd,mat theta) = mat: | |
| real_poscoroots | (RootDatum rd,mat theta) = mat: | |
| imaginary_sys | ((RootDatum,mat)p) = (mat,mat): | |
| real_sys | ((RootDatum,mat)p) = (mat,mat): | |
| is_dominant | (RootDatum rd, ratvec v) = bool: | |
| is_strictly_dominant | (RootDatum rd, ratvec v) = bool: | |
| is_regular | (RootDatum rd,ratvec v)= bool: { tests all positive coroots } | tests all positive coroots |
| is_integral | (RootDatum rd, ratvec v) = bool: { integral on all coroots } | integral on all coroots |
| is_dominant | (ratvec v, RootDatum rd) = bool: | |
| is_strictly_dominant | (ratvec v,RootDatum rd) = bool: | |
| is_regular | (ratvec v, RootDatum rd)= bool: { tests all positive roots } | tests all positive roots |
| is_integral | (ratvec v, RootDatum rd) = bool: { integral on all roots } | integral on all roots |
| is_integrally_dominant | (ratvec v,RootDatum rd) = bool: | |
| radical_basis | (RootDatum rd) = mat: { columns are coweights } | columns are coweights |
| coradical_basis | (RootDatum rd) = mat: { columns are weights } | columns are weights |
| is_semisimple | (RootDatum rd) = bool: semisimple_rank(rd) = rank(rd) | |
| derived_is_simply_connected | (RootDatum rd) = bool: | |
| has_connected_center | (RootDatum rd) = bool: | |
| is_simply_connected | (RootDatum rd) = bool: | |
| is_adjoint | (RootDatum rd) = bool: | |
| derived | (RootDatum rd) = RootDatum: let (d,)=derived_info(rd) in d | |
| mod_central_torus | (RootDatum rd) = RootDatum: | |
| is_simple_for | (vec dual_two_rho) = (vec->bool): | |
| simple_system_from_positive | (mat posroots,mat poscoroots) = (mat,mat): | |
| sub_datum | rd, (int->bool) select {from posroot indices}) = | from posroot indices |
| test_simple_type | T, RootDatum rd) = [int]: | |
| fundamental_weights | (RootDatum rd) = [ratvec]: | |
| fundamental_coweights | (RootDatum rd) = [ratvec]: | |
| singular_root_datum | rd,ratvec gamma) = RootDatum: | |
| project_to_dominant_cone | (RootDatum rd, ratvec gamma) = | |
| highest_roots | (RootDatum rd) = [vec]: | |
| highest_coroots | (RootDatum rd) = [vec]: | |
| lowest_roots | (RootDatum rd) = [vec]: | |
| lowest_coroots | (RootDatum rd) = [vec]: | |
| simple_root_labels | (RootDatum rd) = vec: | |
| simple_coroot_labels | (RootDatum rd) = vec: | |
| highest_root | (RootDatum rd) = vec: |
Weyl Group (46)
Weyl group element construction, conjugation, length, and action on weights and root systems.
| Name | Signature | Description |
|---|---|---|
| is_member | = ([WeylElt]->(WeylElt->bool)): is_member(=@(WeylElt,WeylElt)) | |
| isnt_member | = ([WeylElt]->(WeylElt->bool)): isnt_member(=@(WeylElt,WeylElt)) | |
| id_W | (RootDatum rd) = WeylElt: W_elt(rd,[int]:[]) | |
| W_gen | (RootDatum rd, int s) = W_elt(rd,[s]) | |
| W_gens | (RootDatum rd) = [WeylElt]: | |
| * | (WeylElt w,mat theta) = mat: theta.n_rows # for col in theta do w*col od | |
| * | (mat theta,WeylElt w) = mat: | |
| for_dual_datum | w) = WeylElt: W_elt(dual(w.root_datum), word(w)) | |
| product | (RootDatum rd, [WeylElt] L) = WeylElt: | |
| order | (WeylElt !w) = int: let x=w in 1+(int:while !=x do x*:=w od) | |
| rho_diff | (WeylElt w) = vec: let rho2=w.root_datum.two_rho in (rho2-w*rho2)\2 | |
| rho_check_diff | (WeylElt w) = vec: | |
| positive_to_negative | (WeylElt w) = [int]: | |
| posroot_sum | (RootDatum rd,[int] select) = vec: | |
| poscoroot_sum | (RootDatum rd,[int] select) = vec: | |
| from_dominant | (RootDatum rd, [int] S, vec v) = (WeylElt,vec): | |
| from_dominant | (RootDatum rd, [int] S, ratvec rv) = (WeylElt,ratvec): | |
| from_dominant | (vec v, RootDatum rd, [int] S) = (vec,WeylElt): | |
| from_dominant | (ratvec rv, RootDatum rd, [int] S) = (ratvec,WeylElt): | |
| chamber | ((RootDatum,vec) rd_lambda) = WeylElt: | |
| dominant | ((RootDatum,vec) rd_lambda) = vec: | |
| chamber | ((RootDatum,[int],vec) triple) = WeylElt: | |
| dominant | ((RootDatum,[int],vec) triple) = vec: | |
| chamber | ((vec,RootDatum) lambda_rd) = WeylElt: | |
| dominant | ((vec,RootDatum) lambda_rd) = vec: | |
| chamber | ((vec,RootDatum,[int]) triple) = WeylElt: | |
| dominant | ((vec,RootDatum,[int]) triple) = vec: | |
| permuted_root | (WeylElt w, int alpha) = int: | |
| permuted_coroot | (int alpha,WeylElt w) = int: | |
| from_dominant_root | rd, [int]S, int alpha) = (WeylElt,int): | |
| w0 | (RootDatum rd) = chamber(rd,-rd.two_rho) | |
| * | (WeylElt w, ratvec gamma) = ratvec: let (n,d)=%gamma in (w*n)/d | |
| * | (ratvec gamma, WeylElt w) = ratvec: let (n,d)=%gamma in (n*w)/d | |
| from_dominant | (RootDatum rd, ratvec gamma) = (WeylElt,ratvec): | |
| chamber | (RootDatum rd, ratvec gamma) = WeylElt: chamber(rd,gamma.numer) | |
| dominant | ((RootDatum,ratvec) rd_gamma) = ratvec: | |
| from_dominant | (ratvec gamma,RootDatum rd) = (ratvec,WeylElt): | |
| chamber | (ratvec gamma,RootDatum rd) = WeylElt: chamber(gamma.numer,rd) | |
| dominant | ((ratvec,RootDatum) gamma_rd) = ratvec: | |
| inverse | (WeylElt w) = WeylElt: /w | |
| ^ | = (WeylElt,int->WeylElt): | |
| matrix | (WeylElt w) = mat: | |
| W_elt | (RootDatum rd, mat M) = WeylElt: | |
| W_elt_of_reflection | rd,int root) = WeylElt: | |
| W_elt_of_reflection | rd,vec alpha) = WeylElt: | |
| convert_to | (RootDatum rd, WeylElt w) = WeylElt: chamber(rd,w*two_rho(rd)) |
Inner Classes (6)
Constructing inner classes from Lie type + inner class string, twist computations.
| Name | Signature | Description |
|---|---|---|
| involution | (LieType lt, string ict) = mat: involution(lt,#lt.rank,ict) | |
| inner_class | (RootDatum rd, string ict) = InnerClass: | |
| inner_class | (LieType lt, [ratvec] gens, string ict) = InnerClass: | |
| twist | (InnerClass ic) = vec: { automorphism of Dynkin diagram, mapped } | automorphism of Dynkin diagram, mapped |
| dual_integral | (InnerClass ic, ratvec gamma) = InnerClass: | |
| big_block | (InnerClass ic) = Block: |
Cartan Classes (13)
Listing and querying Cartan classes for an inner class or real form.
| Name | Signature | Description |
|---|---|---|
| Cartan_classes | (InnerClass ic) = [CartanClass]: | |
| print_Cartan_info | (CartanClass cc) = void: | |
| fundamental_Cartan | (InnerClass ic) = CartanClass: Cartan_class(ic,0) | |
| most_split_Cartan | (InnerClass ic) = CartanClass: | |
| compact_rank | (CartanClass cc) = int: | |
| split_rank | (CartanClass cc) = int: | |
| compact_rank | (InnerClass ic) = int: compact_rank(fundamental_Cartan(ic)) | |
| split_rank | (RealForm G) = int: split_rank(most_split_Cartan(G)) | |
| is_equal_rank | (InnerClass ic) = bool: { whether distinguished_involution=1 } | whether distinguished_involution=1 |
| is_split | (RealForm G) = bool: { whether most split Cartan has theta = -1 } | whether most split Cartan has theta = -1 |
| is_split | (InnerClass ic) = bool: is_split(quasisplit_form(ic)) | |
| = | (CartanClass H,CartanClass J) = bool: | |
| number | H,RealForm G) = int: |
Real Forms (16)
Listing real forms, checking properties (quasisplit, quasicompact), and computing Rho.
| Name | Signature | Description |
|---|---|---|
| form_name | (RealForm f) = string: form_names(f)[form_number(f)] | |
| real_forms | (InnerClass ic)= [RealForm]: | |
| dual_real_forms | (InnerClass ic) = [RealForm]: | |
| dual_real_forms | (RealForm G) = [RealForm]: | |
| is_quasisplit | (RealForm G) = bool: form_number(G)=nr_of_real_forms(G)-1 | |
| is_quasicompact | (RealForm G) = bool: form_number(G)=0 | |
| split_form | (RootDatum r) = RealForm: | |
| split_form | (LieType t) = RealForm: split_form(simply_connected(t)) | |
| quasicompact_form | (InnerClass ic) = RealForm: real_form(ic,0) | |
| compact_form | (RootDatum r) = RealForm: | |
| compact_torus | (int rank) = RealForm: | |
| split_torus | (int rank) = RealForm: | |
| real_complex_torus | (int complex_rank) = RealForm: | |
| torus | C) = RealForm: | |
| is_compatible | (RealForm f, RealForm g) = bool: | |
| is_compact | (RealForm G) = bool: { real form 0 in equal rank inner class } | real form 0 in equal rank inner class |
KGB Elements (67)
Constructing and querying KGB elements: status checking, cross/Cayley actions, torus data, and computations on K\G/B.
| Name | Signature | Description |
|---|---|---|
| real_form | (KGBElt x) = let (rf,) = %x in rf | |
| # | (KGBElt x) = let (,n) = %x in n | |
| number | = #@KGBElt | |
| root_datum | (KGBElt x) = RootDatum: real_form(x) | |
| inner_class | (KGBElt x) = InnerClass: real_form(x) | |
| KGB | (RealForm rf) = [KGBElt]: for i:KGB_size(rf) do KGB(rf,i) od | |
| in_distinguished_fiber | (KGBElt x) = bool: length(x)=0 | |
| distinguished_fiber | (RealForm G) = [KGBElt]: | |
| KGB | (CartanClass H,RealForm G) = [KGBElt]: | |
| KGB_elt | ((InnerClass, mat, ratvec) (,theta,v):all) = KGBElt: | |
| KGB_elt | (RootDatum rd, mat theta, ratvec v) = KGBElt: | |
| KGB_elt | (InnerClass ic, KGBElt x) = KGBElt: | |
| Cartan_class | (InnerClass ic, mat theta) = CartanClass: | |
| Bruhat_order | (RealForm G) = (KGBElt,KGBElt->bool): | |
| cross | (WeylElt w,KGBElt x) = KGBElt: | |
| cross | (KGBElt x,WeylElt w) = KGBElt: | |
| status | (vec alpha,KGBElt x) = int: status(root_index(real_form(x),alpha),x) | |
| cross | (vec alpha,KGBElt x) = KGBElt: | |
| Cayley | (vec alpha,KGBElt x) = KGBElt: | |
| W_cross | (WeylElt w,KGBElt x) = KGBElt: | |
| KGB_status_text | (int i) = string: | |
| status_text | ((int,KGBElt)p) = string: KGB_status_text(status(p)) | |
| status_text | ((vec,KGBElt)p) = string: KGB_status_text(status(p)) | |
| status_texts | (KGBElt x) = [string]: | |
| is_complex | ((int,KGBElt)p) = status(p)%4=0 | |
| is_real | ((int,KGBElt)p) = status(p)=2 | |
| is_imaginary | ((int,KGBElt)p) = status(p)%2=1 | |
| is_noncompact | ((int,KGBElt)p) = status(p)=3 | |
| is_compact | ((int,KGBElt)p) = status(p)=1 | |
| is_descent | ((int,KGBElt)p) = status(p)<3 | |
| is_ascent | ((int,KGBElt)p) = status(p)>=3 | |
| is_strict_descent | ((int,KGBElt)p) = { is_descent(p) and not is_compact(p) } | is_descent(p) and not is_compact(p) |
| is_imaginary | (KGBElt x) = (vec->bool): is_imaginary(involution(x)) | |
| is_real | (KGBElt x) = (vec->bool): is_real(involution(x)) | |
| is_complex | (KGBElt x) = (vec->bool): is_complex(involution(x)) | |
| imaginary_posroots | (KGBElt x) = mat: | |
| real_posroots | (KGBElt x) = mat: | |
| imaginary_poscoroots | (KGBElt x) = mat: | |
| real_poscoroots | (KGBElt x) = mat: | |
| imaginary_sys | (KGBElt x) = (mat,mat): | |
| real_sys | (KGBElt x) = (mat,mat): | |
| rho_i | (KGBElt x) = ratvec: sum(imaginary_posroots(x))/2 | |
| rho_r | (KGBElt x) = ratvec: sum(real_posroots(x))/2 | |
| rho_check_i | (KGBElt x) = ratvec: sum(imaginary_poscoroots(x))/2 | |
| rho_check_r | (KGBElt x) = ratvec: sum(real_poscoroots(x))/2 | |
| rho_i | ((RootDatum,mat) rd_theta) = ratvec: | |
| rho_r | ((RootDatum,mat) rd_theta) = ratvec: | |
| rho_check_i | ((RootDatum,mat) rd_theta) = ratvec: | |
| rho_check_r | ((RootDatum,mat) rd_theta) = ratvec: | |
| is_compact | (KGBElt x) = (vec->bool): | |
| is_noncompact | (KGBElt x) = (vec->bool): | |
| is_compact_imaginary | (KGBElt x) = (vec->bool): | |
| is_noncompact_imaginary | (KGBElt x) = (vec->bool): | |
| compact_posroots | (KGBElt x) = mat: | |
| noncompact_posroots | (KGBElt x) = mat: | |
| dimension | (KGBElt x) = int: { dimension as $K$-orbit on $G/B$ } | dimension as $K$-orbit on $G/B$ |
| codimension | x) = int: nr_of_posroots(root_datum(x))-dimension(x) | |
| rho_ci | (KGBElt x) = ratvec: sum(compact_posroots(x))/2 | |
| rho_nci | (KGBElt x) = ratvec: sum(noncompact_posroots(x))/2 | |
| is_imaginary | (vec v,KGBElt x) = bool: v.(is_imaginary(x)) | |
| is_real | (vec v,KGBElt x) = bool: v.(is_real(x)) | |
| is_complex | (vec v,KGBElt x) = bool: v.(is_complex(x)) | |
| is_compact_imaginary | (vec v,KGBElt x) = bool: v.(is_compact_imaginary(x)) | |
| is_noncompact_imaginary | (vec v,KGBElt x) = bool: | |
| print_KGB | (KGBElt x) = void: | |
| no_Cminus_roots | (KGBElt x) = bool: | |
| no_Cplus_roots | (KGBElt x) = bool: |
Blocks (50)
Constructing blocks, computing KL polynomials, and printing block information.
| Name | Signature | Description |
|---|---|---|
| blocks | (RealForm rf) = [Block]: | |
| blocks | (InnerClass ic) = [Block]: | |
| raw_KL | ((RealForm,RealForm) p) = (mat,[vec],vec): raw_KL(block(p)) | |
| dual_KL | ((RealForm,RealForm) p) = (mat,[vec],vec): dual_KL(block(p)) | |
| print_block | ((RealForm,RealForm) p) = void: print_block (block(p)) | |
| print_blocku | ((RealForm,RealForm) p) = void: print_blocku(block(p)) | |
| print_blockd | ((RealForm,RealForm) p) = void: print_blockd(block(p)) | |
| print_KL_basis | ((RealForm,RealForm) p) = void: print_KL_basis(block(p)) | |
| print_prim_KL | ((RealForm,RealForm) p) = void: print_prim_KL(block(p)) | |
| print_KL_list | ((RealForm,RealForm) p) = void: print_KL_list(block(p)) | |
| print_W_cells | ((RealForm,RealForm) p) = void: print_W_cells(block(p)) | |
| print_W_graph | ((RealForm,RealForm) p) = void: print_W_cells(block(p)) | |
| root_datum | (KType t) = RootDatum: real_form(t) | |
| inner_class | (KType t) = InnerClass: real_form(t) | |
| x | (KType t) = KGBElt: let (x,)=%t in x | |
| lambda_minus_rho | (KType t) = vec: let (,lr)=%t in lr | |
| lambda_rho | = lambda_minus_rho@KType { shorter name allowed } | shorter name allowed |
| lambda | (KType t) = ratvec: let (x,lr)=%t in rho(x.real_form)+lr | |
| theta_plus_1_lambda | (KType t) = vec: | |
| K_type_lambda | (KGBElt x, ratvec lambda) = KType: | |
| Cartan_class | (KType t) = CartanClass: Cartan_class(x(t)) | |
| non_dominant_simples | (KType t) = [int]: | |
| is_noncompact_imaginary | (int i,KType t) = bool: | |
| is_compact_imaginary | (int i,KType t) = bool: | |
| involution | (KType t) = mat: involution(t.x) | |
| root_datum | (KTypePol P) = RootDatum: real_form(P) | |
| K_type_formula | (KType t) = KTypePol: K_type_formula(t,-1) { no cutoff } | no cutoff |
| null_module | (KType t) = KTypePol: | |
| null_module | (KTypePol P) = KTypePol: 0*P { built-in does this efficiently } | built-in does this efficiently |
| null_K_module | = null_module@KType { allow more explicit name } | allow more explicit name |
| null_K_module | = null_module@KTypePol { allow more explicit name } | allow more explicit name |
| - | P) = KTypePol: (-1)*P | |
| first_K_type | (KTypePol P) = KType: let (,p)=first_term(P) in p | |
| last_K_type | (KTypePol P) = KType: let (,p)=last_term(P) in p | |
| s_to_1 | (KTypePol P) = KTypePol: 0*P + for x@q in P do (+%x,q) od | |
| s_to_minus_1 | (KTypePol P) = KTypePol: 0*P + for x@q in P do (-%x,q) od | |
| - | (KTypePol a, (Split,KType) (c,p)) = KTypePol: a+(-c,p) | |
| + | (KTypePol P, [KType] ps) = KTypePol: P+for p in ps do (split_1,p) od | |
| - | (KTypePol P, [KType] ps) = KTypePol: P+for p in ps do (split_minus_1,p) od | |
| sum | = (RealForm,[KTypePol]->KTypePol): | |
| + | (KTypePol P,[KTypePol] Ps) = KTypePol: P+sum(P.real_form,Ps) | |
| - | (KTypePol P,[KTypePol] Ps) = KTypePol: P-sum(P.real_form,Ps) | |
| map | ((KType->KType)f, KTypePol P) = KTypePol: | |
| map | ((Param->KType)f, ParamPol P) = KTypePol: | |
| map | ((KType->KTypePol)f, KTypePol P) = KTypePol: | |
| map | ((Param->KTypePol)f, ParamPol P) = KTypePol: | |
| half | (KTypePol P) = KTypePol: 0*P+ for c@t in P do (half(c),t) od | |
| divide_by | (int n, KTypePol P) = KTypePol: 0*P+ for c@t in P do (c/n,t) od | |
| as_pol | (KType p) = KTypePol: p { for making implicit conversion explicit } | for making implicit conversion explicit |
| as_pol | (RealForm G, [KType] ps) = KTypePol: |
Module Parameters (60)
Component access for parameters (x, lambda, nu, infinitesimal character), dominance and integrality tests, standard module operations.
| Name | Signature | Description |
|---|---|---|
| root_datum | (Param p) = RootDatum: real_form(p) | |
| inner_class | (Param p) = InnerClass: real_form(p) | |
| null_module | (Param p) = ParamPol: | |
| x | (Param p) = KGBElt: let (x,,) =%p in x | |
| lambda_minus_rho | (Param p) = vec: let (,lambda_rho,) =%p in lambda_rho | |
| lambda | (Param p) = ratvec: lambda_minus_rho(p)+rho(real_form(p)) | |
| infinitesimal_character | (Param p) = ratvec: let (,,gamma) =%p in gamma | |
| theta_plus_1_lambda | (Param p) = vec: | |
| d_lambda | (Param p) = ratvec: let (x,,gamma) =%p in (1+involution(x))*gamma/2 | |
| nu | (Param p) = ratvec: let (x,,gamma) =%p in (1-involution(x))*gamma/2 | |
| Cartan_class | (Param p) = CartanClass: Cartan_class(x(p)) | |
| codimension | (Param p) = int: codimension(p.x) | |
| integrality_datum | (Param p)= RootDatum: | |
| integrality_rank | (Param p) = int: | |
| non_dominant_simples | (Param p) = [int]: | |
| non_integrally_dominant_simples | (Param p) = [vec]: | |
| is_integrally_dominant | (Param p) = bool: #p.non_integrally_dominant_simples=0 | |
| is_noncompact_imaginary | (int i,Param p) = bool: | |
| is_compact_imaginary | (int i,Param p) = bool: | |
| involution | (Param p) = mat: involution(x(p)) | |
| is_regular | (Param p) = bool: | |
| is_strongly_regular | (Param p)=bool: | Test whether (the infinitesimal character of) a parameter is strongly regular. |
| survives | = (Param->bool): is_final@Param { defined to mean exactly that } | defined to mean exactly that |
| x_open | (RealForm G) = KGBElt: KGB(G,G.KGB_size-1) | |
| trivial | (RealForm G) = Param: { parameter for the trivial representation } | parameter for the trivial representation |
| cross | (WeylElt w,Param p) = Param: | |
| cross | (Param p,WeylElt w) = Param: | |
| K_type_pol | (Param p) = KTypePol: K_type(p) { restrict, implicitly convert } | restrict, implicitly convert |
| param_pol | (KType t) = ParamPol: param(t) | |
| parameter | (RealForm G,int x,ratvec lambda,ratvec nu) = Param: | |
| parameter | (KGBElt x,ratvec lambda,ratvec nu) = Param: | |
| parameter_gamma | (KGBElt x, ratvec lambda, ratvec gamma) = Param: | |
| singular_block | (Param p) = ([Param],int): | |
| block_of | (Param p) = [Param]: let (params,)=block(p) in params | |
| singular_block_of | (Param p) = [Param]: | |
| imaginary_type | (int s, Param p) = int: if cross(s,p)=p then 2 else 1 fi | |
| real_type | (int s,Param p) = int: if cross(s,p)=p then 1 else 2 fi | |
| imaginary_type | (vec alpha, Param p) = int: | |
| real_type | (vec alpha, Param p) = int: | |
| is_nonparity | (int s,Param p)=bool: is_real(s,x(p)) and Cayley(s,p)=p | |
| is_parity | (int s,Param p)= bool: is_real(s,x(p)) and Cayley(s,p)!=p | |
| is_nonparity | (vec alpha,Param p)=bool: | |
| is_parity | (vec alpha,Param p)= bool: | |
| status | (vec alpha,Param p) = int: { enum: C-, ic, r1, r2, C+, rn, i1, i2 } | enum: C-, ic, r1, r2, C+, rn, i1, i2 |
| status | (int s,Param p) = int: { this is NOT related to status(s,x(p)) } | this is NOT related to status(s,x(p)) |
| block_status_text | (int i) = string: | |
| status_text | (int s,Param p) = string: block_status_text(status(s,p)) | |
| status_texts | (Param p) = [string]: | |
| status_text | ((vec,Param) ap) = string: block_status_text(status(ap)) | |
| parity_poscoroots | (Param p) = mat: { set of positive real parity coroots } | set of positive real parity coroots |
| nonparity_poscoroots | (Param p) = mat: { positive real nonparity coroots } | positive real nonparity coroots |
| is_descent | (int s,Param p) = bool: status(s,p)<4 | |
| tau_bitset | (Param p) = (int,(int->bool)): | |
| tau | (Param p) = [int]: list(tau_bitset(p)) | |
| tau_complement | (Param p) = [int]: complement(tau_bitset(p)) | |
| is_descent | ((vec,Param) ap) = bool: status(ap)<4 | |
| is_ascent | ((int,Param) ip) = bool: not is_descent(ip) | |
| is_ascent | ((vec,Param) ap) = bool: not is_descent(ap) | |
| lookup | (Param p, [Param] block) = int: | |
| orientation_nr_term | = (int,Param->Split): |
Extended Blocks (2)
Functions for working with parameters for extended groups.
| Name | Signature | Description |
|---|---|---|
| extended_status_texts | = [string]: | |
| print_extended_block | = (Param,mat->): |
Polynomials in Module Parameters (47)
Operations on formal sums of parameters (ParamPol): arithmetic, filtering, conversion to K-types.
| Name | Signature | Description |
|---|---|---|
| root_datum | (ParamPol P) = RootDatum: real_form(P) | |
| null_module | (ParamPol P) = ParamPol: 0*P { built-in does this efficiently } | built-in does this efficiently |
| - | P) = ParamPol: (-1)*P | |
| param_pol | (KTypePol P) = ParamPol: | |
| first_param | (ParamPol P) = Param: let (,p)=first_term(P) in p | |
| last_param | (ParamPol P) = Param: let (,p)=last_term(P) in p | |
| s_to_1 | (ParamPol P) = ParamPol: 0*P + for x@q in P do (+%x,q) od | |
| s_to_minus_1 | (ParamPol P) = ParamPol: 0*P + for x@q in P do (-%x,q) od | |
| - | (ParamPol a, (Split,Param) (c,p)) = ParamPol: a+(-c,p) | |
| + | (ParamPol P, [Param] ps) = ParamPol: P+for p in ps do (split_1,p) od | |
| - | (ParamPol P, [Param] ps) = ParamPol: P+for p in ps do (split_minus_1,p) od | |
| sum | = (RealForm,[ParamPol]->ParamPol): | |
| + | (ParamPol P,[ParamPol] Ps) = ParamPol: P+sum(P.real_form,Ps) | |
| - | (ParamPol P,[ParamPol] Ps) = ParamPol: P-sum(P.real_form,Ps) | |
| map | ((Param->Param)f, ParamPol P) = ParamPol: | |
| map | ((Param->ParamPol)f, ParamPol P) = ParamPol: | |
| half | (ParamPol P) = ParamPol: 0*P+ for c@t in P do (half(c),t) od | |
| divide_by | (int n, ParamPol P) = ParamPol: 0*P+ for c@t in P do (c/n,t) od | |
| as_pol | (Param p) = ParamPol: p { for making implicit conversion explicit } | for making implicit conversion explicit |
| as_pol | (RealForm G, [Param] ps) = ParamPol: | |
| branch | (KTypePol P, KType t) = Split: branch(P,height(t))[t] | |
| branch | (ParamPol P, KType t) = Split: branch(K_type_pol(P),t) | |
| full_deform | (ParamPol P) = KTypePol: | |
| deform_to_height | (ParamPol P, int height) = KTypePol: | |
| pol_format | (KTypePol P)= string: | |
| pol_format | (ParamPol P)= string: | |
| infinitesimal_character | P) = ratvec: | |
| height_split | ((KTypePol,int)(P,):pair) = (KTypePol,KTypePol): | |
| height_split | ((ParamPol,int)(P,):pair) = (ParamPol,ParamPol): | |
| separate_by_infinitesimal_character | (ParamPol P) = [(ratvec,ParamPol)]: | |
| is_pure_1 | ([Split] L) = bool: all(#L,(int i) bool: =L[i].s_part) | |
| is_pure_s | ([Split] L) = bool: all(#L,(int i) bool: =L[i].int_part) | |
| is_pure | ([Split] L) = bool: L.is_pure_1 or L.is_pure_s | |
| is_pure_1 | (KTypePol P) = bool: | |
| is_pure | (KTypePol P) = bool: for c in P do c od.is_pure | |
| is_pure_1 | (ParamPol P) = bool: | |
| is_pure | (ParamPol P) = bool: for c in P do c od.is_pure | |
| purity | (KTypePol P) = (int,int,int): | |
| monomials | (KTypePol P) = [KType]: for @t in P do t od | |
| monomials | (ParamPol P) = [Param]: for @p in P do p od | |
| monomial | (KTypePol P,int i) = KType: monomials(P)[i] | |
| monomial | (ParamPol P,int i) = Param: monomials(P)[i] | |
| no_reps | L) = [vec]: | |
| no_reps | L) = [ratvec]: | |
| index_in | = ([vec]->(vec->int)): | |
| index_in | ([ratvec] L) { equal size vectors } = (ratvec->int): | equal size vectors |
| index_in | ([Param] L) = (Param->int): { an efficiency hack: } | an efficiency hack: |
Miscellaneous (32)
Miscellaneous find, delete, and utility functions.
| Name | Signature | Description |
|---|---|---|
| present_in | ([T]a,(T,T->bool)eq) = is_member(eq)(a) | |
| find | ((T,T->bool)eq) = ([T] a, T y) int: first(a,(T x)bool:eq(x,y)) | |
| find_in | ([T] a, (T,T->bool)eq) = (T x) int: first(a,(T y)bool:eq(x,y)) | |
| delete | ([T] a, int i) = [T]: a[:i] ## a[i+1:] | |
| find | = find(=@(int,int)) | |
| find | = find(=@((int,int),(int,int))) | |
| find | = find(=@(vec,vec)) | |
| find | = find(=@(ratvec,ratvec)) | |
| find | = find(=@(KGBElt,KGBElt)) | |
| find | = find(=@(Param,Param)) | |
| delete | (vec v, int i) = vec: v[:i] ## v[i+1:] | |
| delete | (mat M, int j) = mat: M[:j] ## M[j+1:] | |
| in_string_list | (string s,[string] S) = bool: s.(is_member(S)) | |
| positive_imaginary_roots_and_coroots | = imaginary_sys@(RootDatum,mat) | |
| positive_imaginary_roots_and_coroots | = imaginary_sys@KGBElt | |
| imaginary_roots_and_coroots | ((RootDatum, mat)p) = (mat,mat): | |
| imaginary_roots_and_coroots | (KGBElt x) = (mat,mat): | |
| positive_real_roots_and_coroots | = real_sys@(RootDatum,mat) | |
| positive_real_roots_and_coroots | = real_sys@KGBElt | |
| real_roots_and_coroots | ((RootDatum, mat)p) = (mat,mat): | |
| real_roots_and_coroots | (KGBElt x) = (mat,mat): | |
| complex_posroots | (RootDatum rd,mat theta) = mat: | |
| complex_posroots | (KGBElt x) = mat: | |
| pad | (string s,int width) = string: l_adjust(width,s) | |
| height | (KTypePol P) = int: max(-1)(for @t in P do height(t) od) | |
| height | (ParamPol P) = int: max(-1)(for @p in P do height(p) od) | |
| monomials | list) = [KType]: | Convert a list of KTypePol into the list of distinct parameters occurring; careful: don't let terms cancel! |
| monomials | list) = [Param]: | |
| min_height | params) = [Param]: { keep only minimal height terms } | keep only minimal height terms |
| assert | (bool b,(->string) report) = void: if not b then error(report()) fi | |
| assert | (bool b) = void: assert(b,@:"assertion failed") { default message } | default message |
| assert | (bool b,string message) = void: if not b then error(message) fi |