Skip to content

Commit

Permalink
get transversals example working
Browse files Browse the repository at this point in the history
  • Loading branch information
timduff35 committed May 31, 2024
1 parent f97da29 commit 1a56d85
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Brackets/Brackets.m2
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ matrix BracketRing := o -> B -> transpose genericMatrix(ring B,numcols B, numrow

-- class declaration for GCAlgebra
GCAlgebra = new Type of AbstractGCRing
gc = method(Options => {Strategy => GroebnerBasis,CoefficientRing => QQ})
gc = method(Options => {Strategy => GroebnerBasis,CoefficientRing => QQ,Variables=>{}})
-- constructor
gc (VisibleList, ZZ) := o -> (vectorSymbols, d) -> (
n := # vectorSymbols;
Expand All @@ -121,11 +121,11 @@ gc (VisibleList, ZZ) := o -> (vectorSymbols, d) -> (
else if all(vectorSymbols, s -> instance(s, ZZ)) and n == # unique vectorSymbols then (a := symbol a; (RingElement, apply(vectorSymbols, s -> a_s)))
else error "incorrect input"
);
Bnd := bracketRing(toList vectorSymbols, d, o);
Bnd := bracketRing(toList vectorSymbols, d, Strategy => o.Strategy, CoefficientRing => o.CoefficientRing);
n'Choose'd'plus1 := subsets(n,d+1);
R := (ring Bnd)[vectorVariables, SkewCommutative=>true];
R := (ring Bnd)[o.Variables][vectorVariables, SkewCommutative => true];
S := R/(ideal apply(n'Choose'd'plus1, S -> product(S, s -> (vectorVariables#s)_R)));
new GCAlgebra from {bracketRing => Bnd, ring => S}
new GCAlgebra from {bracketRing => Bnd, ring => S, "num_pts" => #vectorSymbols}
)

bracketRing GCAlgebra := o -> Gnd -> Gnd#bracketRing
Expand Down Expand Up @@ -165,6 +165,13 @@ Array _ AbstractGCRing := (A, R) -> (
new Bracket from {RingElement => (sgn A0) * B#table#rowSet, ring => R}
)

coefficients GCExpression := o -> a -> (
R1 := ring ring a;
R2 := coefficientRing R1;
R3 := coefficientRing R2;
if not isPolynomialRing R3 then error "expected GC ring with extra variables";
coefficients sub(a#RingElement, R3[gens R1, SkewCommutative=>true][gens R2])
)

bracketRing GCExpression := o -> b -> bracketRing ring b
commonRing (GCExpression, GCExpression) := (b1, b2) -> (
Expand Down Expand Up @@ -232,7 +239,8 @@ isBottomDegree GCExpression := A -> (
extensorSupportIndices = method()
extensorSupportIndices GCExpression := A -> (
assert(isExtensor A);
increment positions(first exponents A#RingElement, p -> p == 1)
vectorExponents := take(first exponents A#RingElement, {0, (ring A)#"num_pts" - 1});
increment positions(vectorExponents, p -> p == 1)
);
extensorToBracket = method()
extensorToBracket GCExpression := A -> (
Expand Down Expand Up @@ -270,7 +278,7 @@ shuffleProduct = (A, B) -> (

GCExpression _ BracketRing := (b, B) -> (
assert(B === bracketRing b);
bBracket := if (isTopDegree b) then lift(extensorToBracket b, ring B) else if (isBottomDegree b) then lift(b#RingElement, ring B) else error "must be an extensor of step 0 or d";
bBracket := if (isTopDegree b) then sum(terms b, bterm -> lift(extensorToBracket bterm, ring B)) else if (isBottomDegree b) then lift(b#RingElement, ring B) else error "must be an extensor of step 0 or d";
bBracket_B
)

Expand Down Expand Up @@ -372,7 +380,6 @@ entries GCMatrix := M -> (
L := entries M#matrix;
B := M#bracketRing;
T := applyTable(L, t->t_B))


undocumented {AbstractGCRing, (net, GCAlgebra)}

Expand Down
15 changes: 15 additions & 0 deletions Brackets/Tim/transversals.m2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
restart
needsPackage "Brackets"
check(1,"Brackets")
check "Brackets"

restart
needsPackage "Brackets"
debug Brackets
G = gc(toList(a..h),4,Variables=>{l,u})
pt = l*a + u * b--1 * a + 1 * b
(pt * c * d)_G ^ (e*f)
ell = ((pt * c * d)_G ^ (e*f)) * pt
formula = ell * (g * h)
coefficients formula
(m,c) = apply(coefficients bb_(bracketRing G)

0 comments on commit 1a56d85

Please sign in to comment.