Skip to content

Commit dd9d4fd

Browse files
committed
Unnamed group, Coefficient()
1 parent 05845df commit dd9d4fd

10 files changed

+77
-10
lines changed

MuCoeffs/MuCoeffs.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ intrinsic _MuCoeffFromTable(table::Rec, w::GrpFPCoxElt) -> Assoc
6767

6868
intrinsic _LoadMuTable(W::GrpFPCox) -> BoolElt, Assoc
6969
{Load the mu-table for a Coxeter group, returning (true, table) if one exists, and (false, false) otherwise.}
70-
path := mucoeff_dir() cat "/" cat CartanName(W) cat ".mus";
70+
path := mucoeff_dir() cat "/" cat _IHkeCartanName(W) cat ".mus";
7171
ok, io := OpenTest(path, "r");
7272
if not ok then
7373
return false, false;

Package/Cells.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ intrinsic EnumerateCoxeterGroup(W::GrpFPCox: lengthBound := -1, quiet := false)
7575
intrinsic EnumerateCoxeterGroup(W::GrpFPCox, I::SeqEnum[RngIntElt]: lengthBound:=-1, quiet:=false) -> SetIndx[GrpFPCoxElt]
7676
{The same as EnumerateCoxeterGroup, but enumerating only the I-minimal elements.}
7777
warningLimit := 1000000;
78-
error if lengthBound lt 0 and not IsCoxeterFinite(CartanName(W)),
78+
error if lengthBound lt 0 and not IsCoxeterFinite(CoxeterMatrix(W)),
7979
"Cannot enumerate an infinite group.";
8080
lengthBound := lengthBound lt 0
8181
select #LongestElement(W)

Package/EltIHke.m

+10-1
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,23 @@ intrinsic FreeModule(elt::EltIHke) -> FModIHke
6666
end intrinsic;
6767

6868
intrinsic Coefficient(elt::EltIHke, w::GrpFPCoxElt) -> RngElt
69-
{Return the coefficient of w in the linear combination.}
69+
{Return the coefficient of B(w) in the linear combination, where B is the basis of elt.}
7070
if IsDefined(elt`Terms, w) then
7171
return elt`Terms[w];
7272
else
7373
return BaseRing(Parent(elt)) ! 0;
7474
end if;
7575
end intrinsic;
7676

77+
intrinsic Coefficient(elt::EltIHke, w::GrpFPCoxElt, d::RngIntElt) -> RngIntElt
78+
{Return the coefficient of B(w) v^d in the linear combination, where B is the basis of elt.}
79+
if IsDefined(elt`Terms, w) then
80+
return Coefficient(elt`Terms[w], d);
81+
else
82+
return 0;
83+
end if;
84+
end intrinsic;
85+
7786
intrinsic Support(elt::EltIHke) -> SetIndx[GrpFPCoxElt], SeqEnum[RngElt]
7887
{Return two parallel sequences giving the group elements and coefficients in the linear combination.
7988
The support (the group elements) are returned as an indexed set, which can be converted to a

Package/FModIHke.m

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ intrinsic IHeckeVersion() -> MonStgElt
55
return "IHecke version 2021-11-01";
66
end intrinsic;
77

8+
intrinsic _IHkeCartanName(W::GrpFPCox) -> MonStgElt
9+
{Return the Cartan name of W if it is finite or affine, and otherwise something like X9.}
10+
try
11+
return CartanName(W);
12+
catch e
13+
return Sprintf("X%o", Rank(W));
14+
end try;
15+
end intrinsic;
16+
817

918
///////////////////////////////
1019
// Free module (abstract class)

Package/IHkeAlg.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ intrinsic IHeckeAlgebra(W::GrpFPCox) -> IHkeAlg
88
// Magma has no Laurent polynomials, but we can use the polynomial part of the series ring.
99
LPolyRing<v> := LaurentSeriesRing(Integers());
1010
HAlg := New(IHkeAlg);
11-
name := Sprintf("Iwahori-Hecke algebra of type %o", CartanName(W));
11+
name := Sprintf("Iwahori-Hecke algebra of type %o", _IHkeCartanName(W));
1212
_FModIHkeInit(~HAlg, LPolyRing, name, W);
1313
return HAlg;
1414
end intrinsic;
@@ -34,7 +34,7 @@ intrinsic IHeckeASMod(W::GrpFPCox, I::SeqEnum[RngIntElt]) -> IHkeASMod
3434
LPolyRing<v> := LaurentSeriesRing(Integers());
3535

3636
asmod := New(IHkeASMod);
37-
name := Sprintf("Antispherical module of type %o, parabolic %o", CartanName(W), I);
37+
name := Sprintf("Antispherical module of type %o, parabolic %o", _IHkeCartanName(W), I);
3838
_FModIHkeInit(~asmod, LPolyRing, name, W);
3939
asmod`Para := I;
4040
return asmod;
@@ -66,7 +66,7 @@ intrinsic IHeckeSMod(W::GrpFPCox, I::SeqEnum[RngIntElt]) -> IHkeSMod
6666
LPolyRing<v> := LaurentSeriesRing(Integers());
6767

6868
smod := New(IHkeSMod);
69-
name := Sprintf("Spherical module of type %o, parabolic %o", CartanName(W), I);
69+
name := Sprintf("Spherical module of type %o, parabolic %o", _IHkeCartanName(W), I);
7070
_FModIHkeInit(~smod, LPolyRing, name, W);
7171
smod`Para := I;
7272
return smod;
@@ -80,4 +80,4 @@ intrinsic IHeckeSMod(W::GrpFPCox, I::SeqEnum[RngIntElt]) -> IHkeSMod
8080
intrinsic Parabolic(SMod::IHkeSMod) -> SeqEnum[RngIntElt]
8181
{The parabolic generators.}
8282
return SMod`Para;
83-
end intrinsic;
83+
end intrinsic;

Package/IHkeAlgCan.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ intrinsic CanonicalBasis(HAlg::IHkeAlg : UseTable := true) -> IHkeAlgCan
171171
ok, table := _LoadMuTable(CoxeterGroup(HAlg));
172172
if ok then
173173
basis`MuTable := table;
174-
vprintf IHecke: "IHecke: Mu coefficients for %o loaded from the database\n", CartanName(CoxeterGroup(HAlg));
174+
vprintf IHecke: "IHecke: Mu coefficients for %o loaded from the database\n", _IHkeCartanName(CoxeterGroup(HAlg));
175175
end if;
176176
end if;
177177
return basis;

README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ by checking the version:
169169
$ magma
170170
> AttachSpec("IHecke.spec");
171171
> IHeckeVersion();
172-
IHecke version 2021-09-10
172+
IHecke version 2021-11-01
173173

174174
Now, create a `GrpFPCox` of your favourite type:
175175

@@ -353,6 +353,17 @@ In order to extract a particular coefficient, use the `Coefficient` function.
353353
> Coefficient(H.[2,1] * H.1, W.1);
354354
0
355355

356+
The `Coefficient` function can be given an extra argument to extract the v^d coefficient from the Laurent polynomial.
357+
358+
> Coefficient(H.[2,1] * H.1, W![2,1]);
359+
v^-1 - v
360+
> Coefficient(H.[2,1] * H.1, W![2,1], 1);
361+
-1
362+
> Coefficient(H.[2,1] * H.1, W![2,1], 0);
363+
0
364+
> Coefficient(H.[2,1] * H.1, W![2,1], -1);
365+
1
366+
356367
The Kazhdan-Lusztig bar involution can be calculated using `Bar`.
357368

358369
> Bar(H.1);
@@ -762,6 +773,8 @@ We aim to keep these to a minimum once the package is in use.
762773
- Development version
763774
- Added a faster Standard x Canonical -> Canonical multiplication.
764775
- The cell order relations are precomputed, making cell order testing much faster.
776+
- Fixed a crash when creating a Hecke algebra for a group not of affine or finite type.
777+
- Added a third argument to `Coefficient()` for extracting the v^d term.
765778
- Version 2021-11-01
766779
- Added an experimental "literal" basis type (a basis specified by a partial table). I will wait
767780
to see how it plays out in other projects before making it a feature.
@@ -789,6 +802,9 @@ We aim to keep these to a minimum once the package is in use.
789802

790803
# TODO
791804

805+
- (High priority) Enhance the Literal basis
806+
- Allow it to be a partial basis (eg for affine groups).
807+
- Make some standard way to save and restore it, probably through MAGMA object files.
792808
- (High priority) Allow the multiplication `C(w) * C.s` to be driven by a table of mu-coefficients
793809
(in other words, a W-graph) so that this special case is extremely fast. By induction (and the
794810
standard multiplication formula), this means that multiplication within the canonical basis can

Tests/TestBase.m

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
assert Coefficient(H.0, W.0) eq 1;
3838
assert Coefficient(H.0, W.1) eq 0;
3939

40+
// Coefficient for B(w) v^d.
41+
assert Coefficient(H.0, W.0, 0) eq 1;
42+
assert Coefficient(H.0, W.0, 1) eq 0;
43+
assert Coefficient(H.0 -3 * v^2 * H.1, W.1, 2) eq -3;
44+
4045
// Standard basis coercion from scalars.
4146
assert IsZero(H ! 0);
4247
assert not IsZero(H ! 1);

Tests/TestUnnamedGroup.m

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Test creation of the Hecke algebra for a non-standard group.
2+
3+
SetQuitOnError(true);
4+
SetColumns(0);
5+
SetAssertions(3);
6+
AttachSpec("IHecke.spec");
7+
8+
// The Coxeter graph for a triangle with all sides labelled by 5.
9+
W := CoxeterGroup(GrpFPCox, Matrix(Integers(), [
10+
[1, 5, 5],
11+
[5, 1, 5],
12+
[5, 5, 1]
13+
]));
14+
HAlg := IHeckeAlgebra(W);
15+
assert Sprint(HAlg) eq "Iwahori-Hecke algebra of type X3";
16+
17+
H := StandardBasis(HAlg);
18+
C := CanonicalBasis(HAlg);
19+
x := H ! C.[1,2,3,2,1];
20+
21+
print "TestUnnamedGroup passed.";
22+
quit;

lint.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
]
1616

1717
def check_file(fname: str):
18-
for line_no, line in enumerate(open(fname), start=1):
18+
lines = list(open(fname))
19+
for i, line in enumerate(lines):
20+
line_no = i + 1
1921
line = line.rstrip('\n')
2022

2123
if '\t' in line:
@@ -30,6 +32,10 @@ def check_file(fname: str):
3032
if 'todo' in line.lower():
3133
print(f"{fname}:{line_no} TODO found: {line}")
3234

35+
# Look for CartanName() being called, not preceded by a try statement.
36+
if re.search(r'(?<!_IHke)CartanName\(', line) and not (i > 0 and 'try' in lines[i-1]):
37+
print(f"{fname}:{line_no} calls CartanName(), it should call _IHkeCartanName()")
38+
3339

3440
for fname in SOURCE_FILES:
3541
check_file(fname)

0 commit comments

Comments
 (0)