Skip to content

Commit

Permalink
d&i TangentSpaceByEquationsAtPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-barakat committed Mar 26, 2019
1 parent 99bb9ba commit baf1d83
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MatricesForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Subtitle := "Matrices for the homalg project",
Version := Maximum( [
"2011.12.06", ## Markus' version
## this line prevents merge conflicts
"2018.12.09", ## Mohamed's version
"2018.12.10", ## Mohamed's version
## this line prevents merge conflicts
"2018.04.04", ## Sebas' version
## this line prevents merge conflicts
Expand Down
6 changes: 6 additions & 0 deletions MatricesForHomalg/gap/Tools.gd
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,9 @@ DeclareOperation( "Diff",

DeclareOperation( "Diff",
[ IsHomalgRingElement ] );

DeclareOperation( "TangentSpaceByEquationsAtPoint",
[ IsHomalgMatrix, IsHomalgMatrix ] );

DeclareOperation( "TangentSpaceByEquationsAtPoint",
[ IsHomalgMatrix, IsList ] );
76 changes: 76 additions & 0 deletions MatricesForHomalg/gap/Tools.gi
Original file line number Diff line number Diff line change
Expand Up @@ -4529,6 +4529,82 @@ InstallMethod( Diff,

end );

##
InstallMethod( TangentSpaceByEquationsAtPoint,
"for two homalg matrices",
[ IsHomalgMatrix, IsHomalgMatrix ],

function( M, x )
local R, var, n, k, Tx, map, i, xi, Ri, m;

if not NrColumns( M ) = 1 then
Error( "the number of columns of the first argument M is not 1\n" );
elif not NrColumns( M ) = 1 then
Error( "the number of columns of the second argument x is not 1\n" );
fi;

R := HomalgRing( M );

var := IndeterminatesOfPolynomialRing( R );

n := Length( var );

if not n = NrRows( x ) then
Error( "the number of rows of the second argument x is not the number of indeterminates ", n, "\n" );
fi;

k := CoefficientsRing( R );

if not IsIdenticalObj( HomalgRing( x ), k ) then
Error( "the second argument is not a matrix over the coefficients ring ", k );
fi;

Tx := HomalgZeroMatrix( NrRows( M ), 0, k );

for i in [ 1 .. n ] do

xi := String( var[i] );

Ri := k * xi;

xi := HomalgMatrix( [ xi / Ri ], 1, 1, Ri );

map := UnionOfRows( Ri * CertainRows( x, [ 1 .. i - 1 ] ), xi, Ri * CertainRows( x, [ i + 1 .. n ] ) );

map := RingMap( map, R, Ri );

m := Diff( xi, Pullback( map, M ) );

map := CertainRows( x, [ i ] );

map := RingMap( map, Ri, k );

Tx := UnionOfColumns( Tx, Pullback( map, m ) );

od;

return BasisOfRows( Tx );

end );

##
InstallMethod( TangentSpaceByEquationsAtPoint,
"for a homalg matrix and a list",
[ IsHomalgMatrix, IsList ],

function( M, x )
local R, k;

R := HomalgRing( M );

k := CoefficientsRing( R );

x := HomalgMatrix( x, Length( x ), 1, k );

return TangentSpaceByEquationsAtPoint( M, x );

end );

##
InstallMethod( NoetherNormalization,
"for a homalg matrix",
Expand Down

0 comments on commit baf1d83

Please sign in to comment.