# Jacobian matrix rank

Consider the following code :

R.<x,y,z> = QQ[];

p=(x-y)(y-z)(x-z);

J = matrix(R,[[x-y],[y]]);

J.rank();

The answer displayed is 1. This is the rank over the polynomia ring I suppose. I would like to compute rank over the field of rationals. That is if there are rational numbers a,b and c such that a diff(p,x) + b diff(p,y) + c diff(p,z) =0 but a,b,c non zero then rank should be 3.

What is the way to do it ?

edit retag close merge delete

The matrix is defined over a "bigger" ring, $R$. So it is computed over the ring of definition....

sage: R.<x,y,z> = QQ[]
sage: # p = (x-y)*(y-z)*(x-z)    # (?!)
sage: J = matrix( R, 2,1, [ x-y, y ] )
sage: J.rank()
1
sage: J.parent()
Full MatrixSpace of 2 by 1 dense matrices over Multivariate Polynomial Ring in x, y, z over Rational Field

Using J.rank? or J.rank?? gives more info. In our case, the work is delegated to J.pivots(). (The length of this list of pivots is the rank.)

( 2017-04-20 14:54:48 -0500 )edit

Sort by » oldest newest most voted

Yes it is the rank over the polynomial ring. Houw could it be the rank over the rationals ? Note that x and y do not belong to the rational field, but the rank depends on the rational values you associate to them (the zero vector has rank 0, the other have rank one):

sage: J.substitute({x:0,y:0}).rank()
0
sage: J.substitute({x:0,y:1}).rank()
1
more

I would like to compute rank over the field of rationals. That is if there are rational numbers a,b and c such that a diff(p,x) + b diff(p,y) + c diff(p,z) =0 but a,b,c non zero then rank should be 3. What is the way to code this ?

( 2017-04-20 22:36:18 -0500 )edit

This makes no sense. The Jacobian matrix can be computed easily (in sage):

sage: var( 'x,y,z' );
sage: J = jacobian( p, [x,y,z] )
sage: J
[ (x - y)*(y - z) + (x - z)*(y - z)  (x - y)*(x - z) - (x - z)*(y - z) -(x - y)*(x - z) - (x - y)*(y - z)]

and this is a 3x1 matrix. Its rank is at most one! The rank is one, if $x,y,z$ are seen as (transcendental) independent variables. If we want to see for which numbers $x,y,z$ the rank is not one (which is generically the case), but zero (not three, this makes no sense), and this is a different question starting from a different question, then the following finds the point $(x,y,z)$:

sage: solve( [ component==0 for component in J[0] ], [x,y,z] )
[[x == r1, y == r1, z == r1]]

$p'(x,y,z)$ is zero iff $x=y=z$.

( 2017-04-25 13:42:35 -0500 )edit