diff

diff(m,n) -- differentiate the matrix n by the matrix m
diff P -- compute the difference polynomial for a projective Hilbert polynomial, see ProjectiveHilbertPolynomial.
diff(P,i) -- compute the i-th difference polynomial for a projective Hilbert polynomial, see ProjectiveHilbertPolynomial.

Given matrices m : F0 <--- F1, and n : G0 <--- G1, produce a matrix with the shape diff(m,n) : F0' ** G0 <--- F1' ** G1, whose entry in the slot ((i,j),(k,l)) is the result of differentiating n_(j,l) by the differential operator corresponding to m_(i,k).

If m or n is a ring element, then it is interpreted as a one-by-one matrix. If m is a vector, it is interpreted as a matrix with one column, and if n is a vector, it is interpreted as a matrix with one row. If both m and n are ring elements, then the result will be a ring element rather than a one-by-one matrix. If m is a vector and n is a ring element, then the result will be a vector rather than a matrix with one column.

i1 : R = ZZ/101[a..d]

o1 = R

o1 : PolynomialRing
i2 : m = genericMatrix(R,a,2,2)

o2 = {0} | a c |
     {0} | b d |

             2       2
o2 : Matrix R  <--- R
i3 : diff(transpose m,m*m)

o3 = {1} | 2a c   c   0  |
     {1} | b  0   a+d c  |
     {1} | b  a+d 0   c  |
     {1} | 0  b   b   2d |

             4       4
o3 : Matrix R  <--- R

The most common usage of this function is when m : F <--- R^1 and n : R^1 <--- G. In this case the result is a matrix with shape diff(m,n) : F' <--- G, and the (i,j) th entry is the result of differentiating n_j by the differential operator corresponding to m_i.

i4 : m = matrix {{a,b,c,d}}

o4 = {0} | a b c d |

             1       4
o4 : Matrix R  <--- R
i5 : n = matrix {{a^2, (b + c)*(a + d), a*b*c}}

o5 = {0} | a2 ab+ac+bd+cd abc |

             1       3
o5 : Matrix R  <--- R
i6 : p = diff(transpose m,n)

o6 = {1} | 2a b+c bc |
     {1} | 0  a+d ac |
     {1} | 0  a+d ab |
     {1} | 0  b+c 0  |

             4       3
o6 : Matrix R  <--- R
i7 : target p

      4
o7 = R

o7 : R - module, free
i8 : source p

      3
o8 = R

o8 : R - module, free

As another example, we show how to compute the Wronskian of a polynomial f.

i9 : R = ZZ/101[a, x .. z]

o9 = R

o9 : PolynomialRing
i10 : f = matrix {{x^3 + y^3 + z^3 - a*x*y*z}}

o10 = {0} | -axyz+x3+y3+z3 |

              1       1
o10 : Matrix R  <--- R
i11 : v = matrix {{x,y,z}}

o11 = {0} | x y z |

              1       3
o11 : Matrix R  <--- R
i12 : W = diff(transpose v * v, f)

o12 = {1} | 6x  -az -ay |
      {1} | -az 6y  -ax |
      {1} | -ay -ax 6z  |

              3       3
o12 : Matrix R  <--- R
i13 : Wf = minors(3,W)

                3          2 3     2 3     2 3
o13 = ideal(- 2a x*y*z - 6a x  - 6a y  - 6a z  + 14x*y*z)

o13 : Ideal of R

See also contract and jacobian.


topindexpreviousupnext