Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1XA [33X[0;0YOverview of the [5XLocalizeRingForHomalg[105X[101X[1X Package Source Code[133X[101X23[33X[0;0YThis appendix is included in the documentation to shine some light on the4mathematical backgrounds of this Package. Neither is it needed to work with5this package nor should the methods presented here be called directly. The6functions documented here are entries of the so called ring table and not to7be called directly. There are higher level methods in declared and installed8in [5XMatricesForHomalg[105X, which call this functions (--> [10X?MatricesForHomalg:The9Basic Matrix Operations[110X).[133X1011[33X[0;0YWe only present the simpler procedures, where no transformation matrices are12computed, since the computation of transformation matrices carries no13further mathematical ideas.[133X141516[1XA.1 [33X[0;0YThe generic Methods[133X[101X1718[33X[0;0YThere are some methods in localized rings, where homalg is able to fall back19on procedures of the corresponding global ring. Furthermore these methods20work quite good together with Mora's algorithm as implemented in Singular,21since we can treat it like a global ring. We will present some methods as an22example, to show the idea:[133X2324[1XA.1-1 BasisOfRowModule[101X2526[29X[2XBasisOfRowModule[102X( [3XM[103X ) [32X function27[6XReturns:[106X [33X[0;10Ya "basis" of the module generated by M[133X2829[33X[0;0YThis procedure computes a basis by using the Funcod of the underlying30computation ring. If the computation ring is given by Mora's Algorithm, we31will indeed compute a local basis. If we just use the global ring for32computations, this will be a global basis and is just computed for some33simplifications and not for the use of reducing by it. Of course we can just34forget about the denominator of [3XM[103X.[133X3536[4X[32X Code [32X[104X37[4XBasisOfRowModule :=[104X38[4X function( M )[104X39[4X[104X40[4X Info([104X41[4X InfoLocalizeRingForHomalg,[104X42[4X 2,[104X43[4X "Start BasisOfRowModule with ",[104X44[4X NrRows( M ), "x", NrColumns( M )[104X45[4X );[104X46[4X[104X47[4X return HomalgLocalMatrix( BasisOfRowModule( Numerator( M ) ), HomalgRing( M ) );[104X48[4X [104X49[4Xend,[104X50[4X[32X[104X5152[1XA.1-2 DecideZeroRows[101X5354[29X[2XDecideZeroRows[102X( [3XA[103X, [3XB[103X ) [32X function55[6XReturns:[106X [33X[0;10Ya "reduced" form of [3XA[103X with respect to [3XB[103X[133X5657[33X[0;0YThis procedure just calls the DecideZeroRows of the computation ring for the58numerator of [3XA[103X.[133X5960[33X[0;0YIf we use Mora's algorithm this procedure will just call it. The result is61divided by the denominator of [3XA[103X afterwards. Again we do not need to care62about the denominator of B.[133X6364[33X[0;0YIf we use the reduction implemented in this package, this Funcod is65overwritten and will not be called.[133X6667[4X[32X Code [32X[104X68[4XDecideZeroRows :=[104X69[4X function( A, B )[104X70[4X local R, ComputationRing, hook, result;[104X71[4X [104X72[4X Info([104X73[4X InfoLocalizeRingForHomalg,[104X74[4X 2,[104X75[4X "Start DecideZeroRows with ",[104X76[4X NrRows( A ), "x", NrColumns( A ),[104X77[4X " and ",[104X78[4X NrRows( B ), "x", NrColumns( B )[104X79[4X );[104X80[4X [104X81[4X R := HomalgRing( A );[104X82[4X ComputationRing := AssociatedComputationRing( R );[104X83[4X [104X84[4X result := DecideZeroRows( Numerator( A ) , Numerator( B ) );[104X85[4X result := HomalgLocalMatrix( result, Denominator( A ) , R );[104X86[4X Info( InfoLocalizeRingForHomalgShowUnits, 1, "DecideZeroRows: produces denominator: ", Name( Denominator( result ) ) );[104X87[4X return result;[104X88[4X[104X89[4X end,[104X90[4X[32X[104X9192[1XA.1-3 SyzygiesGeneratorsOfRows[101X9394[29X[2XSyzygiesGeneratorsOfRows[102X( [3XM[103X ) [32X function95[6XReturns:[106X [33X[0;10Ya "basis" of the syzygies of the arguments (for details consult96the homalg help)[133X9798[33X[0;0YIt is easy to see, that a global syzygy is also a local syzygy and vice99versa when clearing the local Syzygy of its denominators. So this procedure100just calls the syzygy Funcod of the underlying computation ring.[133X101102[4X[32X Code [32X[104X103[4XSyzygiesGeneratorsOfRows :=[104X104[4X function( M )[104X105[4X [104X106[4X Info([104X107[4X InfoLocalizeRingForHomalg,[104X108[4X 2,[104X109[4X "Start SyzygiesGeneratorsOfRows with ",[104X110[4X NrRows( M ), "x", NrColumns( M )[104X111[4X );[104X112[4X[104X113[4X return HomalgLocalMatrix(\[104X114[4X SyzygiesGeneratorsOfRows( Numerator( M ) ), HomalgRing( M )\[104X115[4X );[104X116[4X [104X117[4X end,[104X118[4X[32X[104X119120121[1XA.2 [33X[0;0YThe Local Decide Zero trick[133X[101X122123[1XA.2-1 DecideZeroRows[101X124125[29X[2XDecideZeroRows[102X( [3XB[103X, [3XA[103X ) [32X function126[6XReturns:[106X [33X[0;10Ya "reduced" form of [3XB[103X with respect to [3XA[103X[133X127128[33X[0;0YThis procedure is the mathematical core procedure of this package. We use a129trick to decide locally, whether [3XB[103X can be reduced to zero by [3XA[103X with a global130computation. First a heuristic is used by just checking, whether the element131lies inside the global module, generated by the generators of the local132module. This of course implies this for the local module having the133advantage of a short computation time and leaving a normal form free of134denominators. If this check fails, we use our trick to check for each row of135[3XB[103X independently, whether it lies in the module generated by [3XB[103X.[133X136137[4X[32X Code [32X[104X138[4XDecideZeroRows :=[104X139[4X function( B, A )[104X140[4X local R, T, m, gens, n, GlobalR, one, N, b, numB, denB, i, B1, A1, B2, A2, B3;[104X141[4X [104X142[4X Info( [104X143[4X InfoLocalizeRingForHomalg,[104X144[4X 2,[104X145[4X "Start DecideZeroRows with ",[104X146[4X NrRows( B ), "x", NrColumns( B ),[104X147[4X " and ",[104X148[4X NrRows( A ), "x", NrColumns( A ) [104X149[4X );[104X150[4X [104X151[4X R := HomalgRing( B );[104X152[4X GlobalR := AssociatedComputationRing( R );[104X153[4X T := HomalgVoidMatrix( R );[104X154[4X gens := GeneratorsOfMaximalLeftIdeal( R );[104X155[4X n := NrRows( gens );[104X156[4X one := One( GlobalR );[104X157[4X [104X158[4X m := NrRows( A );[104X159[4X A1 := Numerator( A );[104X160[4X [104X161[4X N := HomalgZeroMatrix( 0, NrColumns( B ), R );[104X162[4X b := Eval( B );[104X163[4X numB := b[1];[104X164[4X denB := b[2];[104X165[4X [104X166[4X for i in [ 1 .. NrRows( B ) ] do[104X167[4X [104X168[4X #use global reduction as heuristic[104X169[4X B1 := CertainRows( numB, [ i ] );[104X170[4X B2 := HomalgLocalMatrix( DecideZeroRows( B1, A1 ), R );[104X171[4X [104X172[4X #if it is nonzero, check whether local reduction makes it zero[104X173[4X if not IsZero( B2 ) then[104X174[4X A2 := UnionOfRows( A1, gens * B1 );[104X175[4X A2 := BasisOfRows( A2 );[104X176[4X B3 := HomalgLocalMatrix( DecideZeroRows( B1, A2 ), R );[104X177[4X if IsZero( B3 ) then[104X178[4X B2 := B3;[104X179[4X fi;[104X180[4X fi;[104X181[4X [104X182[4X N := UnionOfRows( N, B2 );[104X183[4X [104X184[4X od;[104X185[4X [104X186[4X N := HomalgRingElement( one, denB, R ) * N;[104X187[4X [104X188[4X Info( InfoLocalizeRingForHomalgShowUnits, 1, "DecideZeroRows: produces denominator: ", Name( Denominator( N ) ) );[104X189[4X [104X190[4X return N;[104X191[4X [104X192[4X end,[104X193[4X[32X[104X194195196[1XA.3 [33X[0;0YTools[133X[101X197198[33X[0;0YThe package [5XLocalizeRingForHomalg[105X also implements tool functions. These are199referred to from [5XMatricesForHomalg[105X automatically. We list the implemented200methods here are and refer to the [5XMatricesForHomalg[105X documentation (-->201[10X?MatricesForHomalg: The Matrix Tool Operations[110X and202[10X?MatricesForHomalg:RingElement[110X) for details. All tools functions from203[5XMatricesForHomalg[105X not listed here are also supported by fallback tools.[133X204205[30X [33X[0;6YIsZero[133X206207[30X [33X[0;6YIsOne[133X208209[30X [33X[0;6YMinus[133X210211[30X [33X[0;6YDivideByUnit[133X212213[30X [33X[0;6YIsUnit[133X214215[30X [33X[0;6YSum[133X216217[30X [33X[0;6YProduct[133X218219[30X [33X[0;6YShallowCopy[133X220221[30X [33X[0;6YZeroMatrix[133X222223[30X [33X[0;6YIdentityMatrix[133X224225[30X [33X[0;6YAreEqualMatrices[133X226227[30X [33X[0;6YInvolution[133X228229[30X [33X[0;6YCertainRows[133X230231[30X [33X[0;6YCertainColumns[133X232233[30X [33X[0;6YUnionOfRows[133X234235[30X [33X[0;6YUnionOfColumns[133X236237[30X [33X[0;6YDiagMat[133X238239[30X [33X[0;6YKroneckerMat[133X240241[30X [33X[0;6YMulMat[133X242243[30X [33X[0;6YAddMat[133X244245[30X [33X[0;6YSubMat[133X246247[30X [33X[0;6YCompose[133X248249[30X [33X[0;6YNrRows[133X250251[30X [33X[0;6YNrColumns[133X252253[30X [33X[0;6YIsZeroMatrix[133X254255[30X [33X[0;6YIsDiagonalMatrix[133X256257[30X [33X[0;6YZeroRows[133X258259[30X [33X[0;6YZeroColumns[133X260261262263