diff --git a/ModFrmHilD/CanonicalRing/CanonicalRing.m b/ModFrmHilD/CanonicalRing/CanonicalRing.m index 1a818016..f71f0c58 100644 --- a/ModFrmHilD/CanonicalRing/CanonicalRing.m +++ b/ModFrmHilD/CanonicalRing/CanonicalRing.m @@ -183,6 +183,7 @@ intrinsic ConstructGeneratorsAndRelations( IdealClassesSupport:=false, Symmetric:=false, ComputeNewGenerators:=true, + NumberOfTraceForms := 0, PrecomputedGens:=AssociativeArray() ) -> Any { @@ -216,6 +217,18 @@ intrinsic ConstructGeneratorsAndRelations( have_dim_formula := IdealClassesSupport eq NarrowClassGroupReps(M) and not Symmetric; KnownRelations := false; + // Computing Trace forms + F := BaseField(M); + bound := 500; + I := IdealsUpTo(bound, F); + while #I lt NumberOfTraceForms do + bound *:= 2; + I := IdealsUpTo(bound, F); + end while; + // Ideals + TraceFormIdeals := (NumberOfTraceForms eq 0) select [] else I[1..NumberOfTraceForms]; + PrecomputeTraceForms(M, TraceFormIdeals); + ///////////////////// // Generators of lowest weight. @@ -228,6 +241,15 @@ intrinsic ConstructGeneratorsAndRelations( if IsDefined(PrecomputedGens, minimalGenWeight) then basis := PrecomputedGens[minimalGenWeight]; + elif NumberOfTraceForms ne 0 then + Mk := HMFSpace(M, N, [minimalGenWeight : i in [1..n]]); + B := [ TraceForm(Mk,aa) : aa in TraceFormIdeals ]; + basis := EisensteinBasis(Mk) cat Basis(B); + if #basis lt CuspDimension(Mk) then + msg := "Not enough TraceForms"; + error msg; + end if; + elif ComputeNewGenerators then basis := Basis(HMFSpace(M, N, [minimalGenWeight : i in [1..n]]) : IdealClassesSupport := IdealClassesSupport, Symmetric:=Symmetric); assert not IsNull(basis); @@ -319,6 +341,7 @@ intrinsic ConstructGeneratorsAndRelations( Alg := Alg, KnownMkDimension := knownDim, IdealClassesSupport := IdealClassesSupport, + TraceFormIdeals := TraceFormIdeals, Symmetric := Symmetric); newGens := basisWeightk[#weightedSymBasis + 1 .. #basisWeightk]; @@ -349,6 +372,7 @@ intrinsic ExtendBasis(forms::SeqEnum[ModFrmHilDElt], Mk : Alg := "Standard", KnownMkDimension := false, IdealClassesSupport := false, + TraceFormIdeals := [], Symmetric := false) -> SeqEnum {Given a sequence Q of r linearly independent elements of a space M and a subspace V of M containing the elements of Q, extend the elements of Q to a basis for U; the basis is @@ -362,12 +386,16 @@ intrinsic ExtendBasis(forms::SeqEnum[ModFrmHilDElt], Mk : // First try our luck with just Eisenstein series. If that fails, use the fallback. eisensteinbasis := EisensteinBasis(Mk : IdealClassesSupport:=IdealClassesSupport, Symmetric:=Symmetric); - moreforms := Basis(forms cat eisensteinbasis); + traceforms := [ TraceForm(Mk,aa) : aa in TraceFormIdeals ]; + moreforms := Basis(forms cat eisensteinbasis cat traceforms ); coeffs_matrix := CoefficientsMatrix(moreforms : IdealClasses:=IdealClassesSupport); // TODO: This double complement call can surely be optimized away. if Rank(coeffs_matrix) eq KnownMkDimension then return forms cat ComplementBasis(forms, Basis(moreforms) : Alg := Alg); + elif (#TraceFormIdeals ne 0) then + msg := "Not enough TraceForms"; + error msg; end if; end if;