Singular
https://www.singular.uni-kl.de/forum/

computations in a ring of fractions
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=1324
Page 1 of 1

Author:  Silviu Minut [ Thu Aug 11, 2005 5:31 pm ]
Post subject:  computations in a ring of fractions

Can SINGULAR do computations in a ring of fractinos of some
polynomial ring? How do I define a ring of fractions? Id
like for instance to define a

ring r=real,(a11,a12,a21,a22),dp;
matrix A[2][2]=a11,a12,a22,a21;

then to compute inverse(A). Then take derivatives of A^(-1)
with respect to aij. Is this possible with singular?



email: minutsil@cps.msu.edu
Posted in old Singular Forum on: 2002-03-28 16:28:30+01

Author:  Mathias Schulze [ Wed Sep 21, 2005 8:52 pm ]
Post subject: 

Singular does not really support fields of fractions.
But there are two ways to solve your special problem:


1) Multiply by the denominators before the computation.
In your example:

> ring r=real,(a11,a12,a21,a22),dp;
> matrix A[2][2]=a11,a12,a21,a22;
> division(det(A)*freemodule(2),A);
[1]:
_[1,1]=a22
_[1,2]=-a12
_[2,1]=-a21
_[2,2]=a11
...

Here we use the fact that the denominator is known to be
det(A).


2) Take the quotient field as basefield. In your example:

> ring r=(0,a11,a12,a21,a22),x,dp;
> matrix A[2][2]=a11,a12,a21,a22;
> list l=division(freemodule(2),A);
> l;
[1]:
_[1,1]=(a22)/(a11*a22-a12*a21)
_[1,2]=(-a12)/(a11*a22-a12*a21)
_[2,1]=(-a21)/(a11*a22-a12*a21)
_[2,2]=(a11)/(a11*a22-a12*a21)
...
But it is difficult to use this result for further
computations. This can be done as follows:
> matrix e[2][2]=1,1,1,1;
> e=l[1]*x-e;
> e;
e[1,1]=(a22)/(a11*a22-a12*a21)*x-1
e[1,2]=(-a12)/(a11*a22-a12*a21)*x-1
e[2,1]=(-a21)/(a11*a22-a12*a21)*x-1
e[2,2]=(a11)/(a11*a22-a12*a21)*x-1
> e[1,1]=cleardenom(e[1,1]);
> e[1,2]=cleardenom(e[1,2]);
> e[2,1]=cleardenom(e[2,1]);
> e[2,2]=cleardenom(e[2,2]);
> matrix a1=e/x;
> matrix a0=jet(e,0);
> a0;
a0[1,1]=(-a11*a22+a12*a21)
a0[1,2]=(-a11*a22+a12*a21)
a0[2,1]=(-a11*a22+a12*a21)
a0[2,2]=(-a11*a22+a12*a21)
> a1;
a1[1,1]=(a22)
a1[1,2]=(-a12)
a1[2,1]=(-a21)
a1[2,2]=(a11)
> ring s=0,(a11,a12,a21,a22),dp;
> def a0=imap(r,a0);
> def a1=imap(r,a1);

Now you can proceed to compute derivatives using the diff
command and the quotient rule. Singular does not support
differentiation of rational expressions at the moment.

email: mschulze@mathematik.uni-kl.de
Posted in old Singular Forum on: 2002-05-15 12:55:33+02

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/