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] |
i2 : m = genericMatrix(R,a,2,2) |
i3 : diff(transpose m,m*m) |
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}} |
i5 : n = matrix {{a^2, (b + c)*(a + d), a*b*c}} |
i6 : p = diff(transpose m,n) |
i7 : target p |
i8 : source p |
As another example, we show how to compute the Wronskian of a polynomial f.
i9 : R = ZZ/101[a, x .. z] |
i10 : f = matrix {{x^3 + y^3 + z^3 - a*x*y*z}} |
i11 : v = matrix {{x,y,z}} |
i12 : W = diff(transpose v * v, f) |
i13 : Wf = minors(3,W) |
See also contract and jacobian.