From 5260f3478664e0e8605d53eeff1488f94b2f2896 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Wed, 8 Nov 2023 11:39:21 +0100 Subject: [PATCH 1/3] relocated code --- gap/LoopIntegrals.gi | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gap/LoopIntegrals.gi b/gap/LoopIntegrals.gi index a115b6a..bc96090 100644 --- a/gap/LoopIntegrals.gi +++ b/gap/LoopIntegrals.gi @@ -1651,7 +1651,7 @@ InstallMethod( MatrixOfCoefficientsOfParametricIBPs, [ IsLoopDiagram and HasPropagators, IsInt, IsHomalgRing ], function( LD, degree, Qa ) - local sibps, coeffs_monoms, coeffs, monoms, homalg_io_mode, m, trafo, pure_monoms, mixed_monoms, range; + local sibps, coeffs_monoms, coeffs, monoms, homalg_io_mode, m, pure_monoms, mixed_monoms, trafo, range; sibps := MatrixOfSpecialIBPRelations( LD ); @@ -1685,6 +1685,15 @@ InstallMethod( MatrixOfCoefficientsOfParametricIBPs, m := Qa * coeffs; + ## example: monoms[1] = [ D1*D2_^2, D1_^2*D2, D1*D2_, D1_*D2 ] + mixed_monoms := Length( monoms[1] ); + + ## example: + ## monoms[2] = [ D2, D1, 1 ], ## pure monomials in D: only Di + ## monoms[3] = [ D2_, D1_, D2_^2, D1_*D2_, D1_^2 ] ## pure monomials in D_: only Dj_ + ## pure_monom = [ D2, D1, 1; D2_, D1_, D2_^2, D1_*D2_, D1_^2 ] + pure_monoms := Concatenation( monoms[2], monoms[3] ); + trafo := ValueOption( "trafo" ); if not trafo = true then @@ -1696,18 +1705,11 @@ InstallMethod( MatrixOfCoefficientsOfParametricIBPs, m := CertainColumns( m, [ 1 .. NrColumns( m ) - NrRows( m ) ] ); fi; - ## example: [ D2, D1, 1; D2_, D1_, D2_^2, D1_*D2_, D1_^2 ], where - ## monoms[2] = [ D2, D1, 1 ], ## pure monomials in D: only Di - ## monoms[3] = [ D2_, D1_, D2_^2, D1_*D2_, D1_^2 ] ## pure monomials in D_: only Dj_ - pure_monoms := Concatenation( monoms[2], monoms[3] ); - ## extract the lower right corner which gives relations among the pure_monoms, ## and trim the trafo matrix accordingly: ## ( * | * | * ) ## ( 0 | x | 0 ) -> ( x | 0 ) ## ( 0 | y | z ) -> ( y | z ) - mixed_monoms := Length( monoms[1] ); - range := ZeroRows( CertainColumns( m, [ 1 .. mixed_monoms ] ) ); m := CertainRows( CertainColumns( m, [ mixed_monoms + 1 .. NrColumns( m ) ] ), range ); From 73e4f0c775e69fe21d70b651f549737feed38c4b Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Wed, 8 Nov 2023 11:40:14 +0100 Subject: [PATCH 2/3] improved code documentation --- gap/LoopIntegrals.gi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gap/LoopIntegrals.gi b/gap/LoopIntegrals.gi index bc96090..247ccb6 100644 --- a/gap/LoopIntegrals.gi +++ b/gap/LoopIntegrals.gi @@ -1708,8 +1708,10 @@ InstallMethod( MatrixOfCoefficientsOfParametricIBPs, ## extract the lower right corner which gives relations among the pure_monoms, ## and trim the trafo matrix accordingly: ## ( * | * | * ) - ## ( 0 | x | 0 ) -> ( x | 0 ) - ## ( 0 | y | z ) -> ( y | z ) + ## ( 0 | u | v ) -> ( u | v ) + ## ( 0 | x | 0 ) -> ( x | 0 ) + ## ( 0 | y | z ) -> ( y | z ) + range := ZeroRows( CertainColumns( m, [ 1 .. mixed_monoms ] ) ); m := CertainRows( CertainColumns( m, [ mixed_monoms + 1 .. NrColumns( m ) ] ), range ); @@ -1720,8 +1722,9 @@ InstallMethod( MatrixOfCoefficientsOfParametricIBPs, ## exclude the rows which give relations (here x) exclusively among the D's, ## and trim the trafo matrix accordingly: - ## ( x | 0 ) - ## ( y | z ) -> ( y | z ) + ## ( 0 | u | v ) + ## ( 0 | x | 0 ) -> ( u | v ) + ## ( 0 | y | z ) -> ( y | z ) range := NonZeroRows( CertainColumns( m, [ Length( monoms[2] ) + 1 .. NrColumns( m ) ] ) ); m := CertainRows( m, range ); From a467f6512c523feaba164491ed0037a58aac9c75 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Wed, 8 Nov 2023 11:41:15 +0100 Subject: [PATCH 3/3] added support for options (reduced_)basis_of_relative_syzygies in MatrixOfSpecialIBPRelations with the default being false and turned MatrixOfSpecialIBPRelations and BasisOfSpecialIBPRelations into operations --- PackageInfo.g | 2 +- examples/1LoopBox.g | 3 +++ gap/LoopIntegrals.gd | 8 +++---- gap/LoopIntegrals.gi | 52 ++++++++++++++++++++++++++++++++++++++------ 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index 16a2e70..3919c0a 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "LoopIntegrals", Subtitle := "Compute master integrals using commutative and noncommutative methods from computational algebraic geometry", -Version := "2023.11-03", +Version := "2023.11-04", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), diff --git a/examples/1LoopBox.g b/examples/1LoopBox.g index 1aa7dcc..3bcc69d 100644 --- a/examples/1LoopBox.g +++ b/examples/1LoopBox.g @@ -120,4 +120,7 @@ gen2 := GeneratorsOfScalelessSectors( LD, [ 2, 2, 2, 2 ] ); #! Display( gen2 ); #! D1*D2*D3^2*D4^2,D1^2*D2*D3*D4^2,D1*D2^2*D3^2*D4,D1^2*D2^2*D3*D4 +prel2 := ColumnReversedMatrixOfCoefficientsOfParametricIBPs( LD, 2 ); +#! [ , +#! [ D1_*D3_, D1_*D4_, D2_*D4_, D3_*D4_, D1_, D2_, D3_, D4_, 1, D1, D2 ] ] #! @EndExample diff --git a/gap/LoopIntegrals.gd b/gap/LoopIntegrals.gd index 0066d21..621f2a5 100644 --- a/gap/LoopIntegrals.gd +++ b/gap/LoopIntegrals.gd @@ -206,12 +206,12 @@ DeclareAttribute( "BasisOfIBPRelations", IsLoopDiagram ); #! @Arguments LD -DeclareAttribute( "MatrixOfSpecialIBPRelations", - IsLoopDiagram ); +DeclareOperation( "MatrixOfSpecialIBPRelations", + [ IsLoopDiagram ] ); #! @Arguments LD -DeclareAttribute( "BasisOfSpecialIBPRelations", - IsLoopDiagram ); +DeclareOperation( "BasisOfSpecialIBPRelations", + [ IsLoopDiagram ] ); #! @Arguments LD DeclareAttribute( "MatrixOfIBPRelationsInWeylAlgebra", diff --git a/gap/LoopIntegrals.gi b/gap/LoopIntegrals.gi index 247ccb6..f9f7afe 100644 --- a/gap/LoopIntegrals.gi +++ b/gap/LoopIntegrals.gi @@ -1310,10 +1310,19 @@ InstallMethod( MatrixOfSpecialIBPRelations, ## Q[m,s,D][D1,...,Ds] syz := SyzygiesOfColumns( PairOfMatricesOfLoopDiagramInPropagators( LD ) ); - #syz := ReducedBasisOfColumnModule( syz ); - ## this line speeds up the linear algebra in the rational double shift algebra - syz := BasisOfColumnModule( syz ); + if ValueOption( "basis_of_relative_syzygies" ) = true then + + ## this line might sometimes speed up the linear algebra in the rational double shift algebra + syz := BasisOfColumnModule( syz ); + + fi; + + if ValueOption( "reduced_basis_of_relative_syzygies" ) = true then + + syz := ReducedBasisOfColumnModule( syz ); + + fi; return MatrixOfIBPRelations( syz, LD ); @@ -1328,8 +1337,18 @@ InstallMethod( MatrixOfSpecialIBPRelations, syz := SyzygiesOfColumns( PairOfMatricesOfLoopDiagramInPropagators( LD ) ); - ## this line speeds up the linear algebra in the rational double shift algebra - syz := BasisOfColumnModule( syz ); + if ValueOption( "basis_of_relative_syzygies" ) = true then + + ## this line might sometimes speed up the linear algebra in the rational double shift algebra + syz := BasisOfColumnModule( syz ); + + fi; + + if ValueOption( "reduced_basis_of_relative_syzygies" ) = true then + + syz := ReducedBasisOfColumnModule( syz ); + + fi; return MatrixOfIBPRelations( syz, LD, exponents ); @@ -1411,8 +1430,18 @@ InstallMethod( MatrixOfSpecialIBPRelationsInWeylAlgebra, syz := SyzygiesOfColumns( PairOfMatricesOfLoopDiagramInPropagators( LD ) ); - ## this line speeds up the linear algebra in the rational double shift algebra - syz := BasisOfColumnModule( syz ); + if ValueOption( "basis_of_relative_syzygies" ) = true then + + ## this line might sometimes speed up the linear algebra in the rational double shift algebra + syz := BasisOfColumnModule( syz ); + + fi; + + if ValueOption( "reduced_basis_of_relative_syzygies" ) = true then + + syz := ReducedBasisOfColumnModule( syz ); + + fi; ibps := List( [ 1 .. NrColumns( syz ) ], j -> IBPRelationInWeylAlgebra( CertainColumns( syz, [ j ] ), LD ) ); @@ -1480,6 +1509,9 @@ InstallMethod( MatrixOfCoefficientsOfIBPs, function( IBPS ) local Y, weights_a, weights_D, weights, powers, coeffs, orig, monoms, deg, A; + ## example: 1LoopBubble.g + ## called by MatrixOfCoefficientsOfParametricIBPs( LD, 2 : basis_of_relative_syzygies := false ); + ## example: Q[d,s][a1,a2]/( D2*D2_-1, D1*D1_-1 ) Y := HomalgRing( IBPS ); @@ -1601,6 +1633,9 @@ InstallMethod( MatrixOfCoefficientsOfIBPs, function( IBPS, degree ) local Y, weights_a, weights_D, weights, powers, subset; + ## example: 1LoopBubble.g + ## called by MatrixOfCoefficientsOfParametricIBPs( LD, 2 : basis_of_relative_syzygies := false ); + ## example: Q[d,s][a1,a2]/( D2*D2_-1, D1*D1_-1 ) Y := HomalgRing( IBPS ); @@ -1653,6 +1688,9 @@ InstallMethod( MatrixOfCoefficientsOfParametricIBPs, function( LD, degree, Qa ) local sibps, coeffs_monoms, coeffs, monoms, homalg_io_mode, m, pure_monoms, mixed_monoms, trafo, range; + ## example: 1LoopBubble.g + ## MatrixOfCoefficientsOfParametricIBPs( LD, 2 : basis_of_relative_syzygies := false ); + sibps := MatrixOfSpecialIBPRelations( LD ); ## example: Q[d,s][a1,a2]