From 0e6be033d76088b74419677fb68a8c74c1858471 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Thu, 10 Oct 2024 19:06:36 +0200 Subject: [PATCH] d&i (Rational)DoubleShiftAlgebra*WithReverseOrder --- PackageInfo.g | 2 +- gap/LoopIntegrals.gd | 16 +++ gap/LoopIntegrals.gi | 240 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 213 insertions(+), 45 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index bd6db33..70b6349 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 := "2024.11-01", +Version := "2024.11-02", 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/gap/LoopIntegrals.gd b/gap/LoopIntegrals.gd index 5a67bd2..2c2169d 100644 --- a/gap/LoopIntegrals.gd +++ b/gap/LoopIntegrals.gd @@ -360,6 +360,14 @@ DeclareOperation( "DoubleShiftAlgebra", DeclareOperation( "DoubleShiftAlgebraWithDimensionShift", [ IsHomalgRing ] ); +#! @Arguments R +DeclareOperation( "DoubleShiftAlgebraWithReverseOrder", + [ IsHomalgRing ] ); + +#! @Arguments R +DeclareOperation( "DoubleShiftAlgebraWithDimensionShiftAndReverseOrder", + [ IsHomalgRing ] ); + #! @Arguments R DeclareOperation( "RationalDoubleShiftAlgebra", [ IsHomalgRing ] ); @@ -368,6 +376,14 @@ DeclareOperation( "RationalDoubleShiftAlgebra", DeclareOperation( "RationalDoubleShiftAlgebraWithDimensionShift", [ IsHomalgRing ] ); +#! @Arguments R +DeclareOperation( "RationalDoubleShiftAlgebraWithReverseOrder", + [ IsHomalgRing ] ); + +#! @Arguments R +DeclareOperation( "RationalDoubleShiftAlgebraWithDimensionShiftAndReverseOrder", + [ IsHomalgRing ] ); + #! @Arguments vec, LD DeclareOperation( "IBPRelation", [ IsHomalgMatrix, IsLoopDiagram ] ); diff --git a/gap/LoopIntegrals.gi b/gap/LoopIntegrals.gi index 9c467d6..909d01d 100644 --- a/gap/LoopIntegrals.gi +++ b/gap/LoopIntegrals.gi @@ -1090,10 +1090,18 @@ InstallMethod( DoubleShiftAlgebra, [ IsHomalgRing ], function( R ) - local Ds, D_s, c, exponents, B, A, shifts, pairs, Y; + local reverse, Ds, D_s, c, exponents, B, A, shifts, pairs, Y; - if IsBound( R!.DoubleShiftAlgebra ) then - return R!.DoubleShiftAlgebra; + reverse := ValueOption( "reverse" ); + + if not reverse = true then + if IsBound( R!.DoubleShiftAlgebra ) then + return R!.DoubleShiftAlgebra; + fi; + else + if IsBound( R!.DoubleShiftAlgebraWithReverseOrder ) then + return R!.DoubleShiftAlgebraWithReverseOrder; + fi; fi; Ds := RelativeIndeterminatesOfPolynomialRing( R ); @@ -1110,23 +1118,43 @@ InstallMethod( DoubleShiftAlgebra, A := B * JoinStringsWithSeparator( exponents ); - if IsIdenticalObj( ValueOption( "pairs" ), false ) then - shifts := Concatenation( Ds, D_s ); - pairs := false; + if not reverse = true then + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( Ds, D_s ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); + pairs := true; + fi; + + Y := DoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); + else - shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); - pairs := true; + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( D_s, Ds ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d_, d ] ) ); + pairs := true; + fi; + + Y := DoubleShiftAlgebra( A, shifts : steps := 1, pairs := pairs ); + fi; - Y := DoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); - Y!.Ds := Ds; Y!.D_s := D_s; AmbientRing( Y )!.Ds := Ds; AmbientRing( Y )!.D_s := D_s; - R!.DoubleShiftAlgebra := Y; + if not reverse = true then + R!.DoubleShiftAlgebra := Y; + else + R!.DoubleShiftAlgebraWithReverseOrder := Y; + fi; return Y; @@ -1137,10 +1165,18 @@ InstallMethod( DoubleShiftAlgebraWithDimensionShift, [ IsHomalgRing ], function( R ) - local Ds, c, D_s, exponents, B, A, shifts, pairs, Y; + local reverse, Ds, c, D_s, exponents, B, A, shifts, pairs, Y; + + reverse := ValueOption( "reverse" ); - if IsBound( R!.DoubleShiftAlgebraWithDimensionShift ) then - return R!.DoubleShiftAlgebraWithDimensionShift; + if not reverse = true then + if IsBound( R!.DoubleShiftAlgebraWithDimensionShift ) then + return R!.DoubleShiftAlgebraWithDimensionShift; + fi; + else + if IsBound( R!.DoubleShiftAlgebraWithDimensionShiftAndReverseOrder ) then + return R!.DoubleShiftAlgebraWithDimensionShiftAndReverseOrder; + fi; fi; Ds := RelativeIndeterminatesOfPolynomialRing( R ); @@ -1161,37 +1197,85 @@ InstallMethod( DoubleShiftAlgebraWithDimensionShift, A := B * JoinStringsWithSeparator( exponents ); - if IsIdenticalObj( ValueOption( "pairs" ), false ) then - shifts := Concatenation( Ds, D_s ); - pairs := false; + if not reverse = true then + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( Ds, D_s ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); + pairs := true; + fi; + + Y := DoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); + else - shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); - pairs := true; + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( D_s, Ds ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d_, d ] ) ); + pairs := true; + fi; + + Y := DoubleShiftAlgebra( A, shifts : steps := 1, pairs := pairs ); + fi; - Y := DoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); - Y!.Ds := Ds; Y!.D_s := D_s; AmbientRing( Y )!.Ds := Ds; AmbientRing( Y )!.D_s := D_s; - R!.DoubleShiftAlgebraWithDimensionShift := Y; + if not reverse = true then + R!.DoubleShiftAlgebraWithDimensionShift := Y; + else + R!.DoubleShiftAlgebraWithDimensionShiftAndReverseOrder := Y; + fi; return Y; end ); +## +InstallMethod( DoubleShiftAlgebraWithReverseOrder, + [ IsHomalgRing ], + + function( R ) + + return DoubleShiftAlgebra( R : reverse := true ); + +end ); + +## +InstallMethod( DoubleShiftAlgebraWithDimensionShiftAndReverseOrder, + [ IsHomalgRing ], + + function( R ) + + return DoubleShiftAlgebraWithDimensionShift( R : reverse := true ); + +end ); + ## InstallMethod( RationalDoubleShiftAlgebra, [ IsHomalgRing ], function( R ) - local Q, Ds, D_s, c, exponents, B, A, shifts, pairs, Y; + local Q, r, Ds, D_s, c, exponents, B, A, reverse, shifts, pairs, Y; - if IsBound( R!.RationalDoubleShiftAlgebra ) then - return R!.RationalDoubleShiftAlgebra; + reverse := ValueOption( "reverse" ); + + if not reverse = true then + if IsBound( R!.RationalDoubleShiftAlgebra ) then + return R!.RationalDoubleShiftAlgebra; + fi; + else + if IsBound( R!.RationalDoubleShiftAlgebraWithReverseOrder ) then + return R!.RationalDoubleShiftAlgebraWithReverseOrder; + fi; fi; Q := HomalgFieldOfRationalsInMaple(); @@ -1210,23 +1294,43 @@ InstallMethod( RationalDoubleShiftAlgebra, A := B * JoinStringsWithSeparator( exponents ); - if IsIdenticalObj( ValueOption( "pairs" ), false ) then - shifts := Concatenation( Ds, D_s ); - pairs := false; + if not reverse = true then + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( Ds, D_s ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); + pairs := true; + fi; + + Y := RationalDoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); + else - shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); - pairs := true; + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( D_s, Ds ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d_, d ] ) ); + pairs := true; + fi; + + Y := RationalDoubleShiftAlgebra( A, shifts : steps := 1, pairs := pairs ); + fi; - Y := RationalDoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); - Y!.Ds := Ds; Y!.D_s := D_s; AmbientRing( Y )!.Ds := Ds; AmbientRing( Y )!.D_s := D_s; - R!.RationalDoubleShiftAlgebra := Y; + if not reverse = true then + R!.RationalDoubleShiftAlgebra := Y; + else + R!.RationalDoubleShiftAlgebraWithReverseOrder := Y; + fi; return Y; @@ -1237,10 +1341,18 @@ InstallMethod( RationalDoubleShiftAlgebraWithDimensionShift, [ IsHomalgRing ], function( R ) - local Q, Ds, c, D_s, exponents, B, A, shifts, pairs, Y; + local reverse, Q, Ds, c, D_s, exponents, B, A, shifts, pairs, Y; + + reverse := ValueOption( "reverse" ); - if IsBound( R!.RationalDoubleShiftAlgebraWithDimensionShift ) then - return R!.RationalDoubleShiftAlgebraWithDimensionShift; + if not reverse = true then + if IsBound( R!.RationalDoubleShiftAlgebraWithDimensionShift ) then + return R!.RationalDoubleShiftAlgebraWithDimensionShift; + fi; + else + if IsBound( R!.RationalDoubleShiftAlgebraWithDimensionShiftAndReverseOrder ) then + return R!.RationalDoubleShiftAlgebraWithDimensionShiftAndReverseOrder; + fi; fi; Q := HomalgFieldOfRationalsInMaple(); @@ -1263,28 +1375,68 @@ InstallMethod( RationalDoubleShiftAlgebraWithDimensionShift, A := B * JoinStringsWithSeparator( exponents ); - if IsIdenticalObj( ValueOption( "pairs" ), false ) then - shifts := Concatenation( Ds, D_s ); - pairs := false; + if not reverse = true then + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( Ds, D_s ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); + pairs := true; + fi; + + Y := RationalDoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); + else - shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d, d_ ] ) ); - pairs := true; + + if IsIdenticalObj( ValueOption( "pairs" ), false ) then + shifts := Concatenation( D_s, Ds ); + pairs := false; + else + shifts := Concatenation( ListN( Ds, D_s, {d, d_} -> [ d_, d ] ) ); + pairs := true; + fi; + + Y := RationalDoubleShiftAlgebra( A, shifts : steps := 1, pairs := pairs ); + fi; - Y := RationalDoubleShiftAlgebra( A, shifts : steps := -1, pairs := pairs ); - Y!.Ds := Ds; Y!.D_s := D_s; AmbientRing( Y )!.Ds := Ds; AmbientRing( Y )!.D_s := D_s; - R!.RationalDoubleShiftAlgebraWithDimensionShift := Y; + if not reverse = true then + R!.RationalDoubleShiftAlgebraWithDimensionShift := Y; + else + R!.RationalDoubleShiftAlgebraWithDimensionShiftAndReverseOrder := Y; + fi; return Y; end ); +## +InstallMethod( RationalDoubleShiftAlgebraWithReverseOrder, + [ IsHomalgRing ], + + function( R ) + + return RationalDoubleShiftAlgebra( R : reverse := true ); + +end ); + +## +InstallMethod( RationalDoubleShiftAlgebraWithDimensionShiftAndReverseOrder, + [ IsHomalgRing ], + + function( R ) + + return RationalDoubleShiftAlgebraWithDimensionShift( R : reverse := true ); + +end ); + ## InstallMethod( AssociatedWeylAlgebra, [ IsLoopDiagram and HasRelationsOfExternalMomenta and HasPropagators and HasNumerators and HasExtraLorentzInvariants ],