Le 6 nov. 2009 à 17:46, Amelia Taylor a écrit :
> Hi.
>
> I am translating some work from Mathematica to M2 (better for many
> reasons, except 1) and I need to be able to compute the inverse of a
> matrix of variables. The current implementation of matrix inverse in
> M2 won't allow this,
I'm not sure what you mean by that. Macaulay 2 matrices have
coefficients in a ring, and it will try to invert the matrix in that
ring. If you want to work with a matrix with generic coefficients and
invert it, you probably need to work over the fraction field of the
ring of polynomials with coefficients as indeterminates, as in the
following session:
i1 : R=QQ[a,b,c,d]
o1 = R
o1 : PolynomialRing
i2 : S = frac R
o2 = S
o2 : FractionField
i3 : M=matrix{{a,b},{c,d}}
o3 = | a b |
| c d |
2 2
o3 : Matrix S <--- S
i4 : inverse M
o4 = {1} | -d/(bc-ad) b/(bc-ad) |
{1} | c/(bc-ad) -a/(bc-ad) |
2 2
o4 : Matrix S <--- S
I hope this helps.
Baptiste