# Computing ratio of two elements in a large ring

I have a ring (a matroid Chow ring) which has a large number of generators. It's structure is well-understood: it's graded, and the top degree is isomorphic to Q via a specific map, called the degree map. I know an explicit element whose image under the degree map is 1, call it a^{r-1}.

I have another element x of the matroid Chow ring, and I would like to compute it's degree. I can do that by computing x/a^{r-1}, but that is very slow (it seems to require a Grobner basis computation which does not finish on my computer).

When I ask sage to output x and a^{r-1}, sage outputs them as constant multiples of the same monomial. So from the output it is easy to read off what the degree is (look at the ratio of the monomials), but I would like to get it an automated way.

Example:

M = matroids.Uniform(4, 8)
A = M.chow_ring(QQ)
def flatToChow(F):
s = 'A'
for i in F:
s = s + str(i)
return A(s)

beta = A(0)
for i in range(1, M.rank()):
for F in M.flats(i):
if (0 not in F):
beta = beta + flatToChow(F)
a = A(0)
for i in range(1, M.rank()):
for F in M.flats(i):
if (0 in F):
a = a + flatToChow(F)
x = beta^3
x/a^3 #long time

edit retag close merge delete

1

In this particular example you can compute the ratio as x.lift()/(a^3).lift() but I'm not sure it will work in general.

( 2022-11-02 01:09:54 +0100 )edit
1

maybe

next(iter(x.lift().dict().values()))

( 2022-11-02 07:56:00 +0100 )edit
1

or maybe

x.lc() / a.lc()

( 2022-11-02 07:57:31 +0100 )edit

( 2022-11-02 10:36:09 +0100 )edit

Sort by » oldest newest most voted

When the ratio of two elements is known to belong to the base ring (QQ in your example), it can be computed as the ratio of the underlying polynomials (obtained via .lift() method) or just of their leading coefficients (via .lc() method, as suggested by @FrédéricC).

more