Degree zero part of localized graded ring in computer algebra

27 Views Asked by At

Does anyone know how to do the following computation in a standard computer algebra package (MAGMA, SAGE, Macualy2)

Let $S$ be a graded ring given by explicit generators (not necessarily all in degree $1$) and homogeneous relations. Let $f \in S$ be a homogeneous element of degree $d$. I want to compute an explicit presentation of $S_{(f)} = (S_f)_0$ meaning the ring obtained by localizing at $f$ and taking the degree zero part. By an explicit presentation I means an isomorphism,

$$ k[x_1, \dots, x_n] / (f_1, \dots, f_r) \to S_{(f)} $$

where the output tells me what the $f_i$ are and the images of the $x_i$ in $S_{(f)}$.

This is a ubiquitous operation in algebraic geometry. I care most about the case of toric varieties where it comes down to finding a generating set and relations for a given monoid. For example, for $S = k[x_1, \dots, x_n]$ with $x_i$ given weight $w_i$ then for $S_{(x_i)}$ the problem asks to find a basis for the monoid $M \subset \mathbb{Z}^n$ given by elements of the form $\sum w_i a_i$ for $a_i \in \mathbb{N}$ which are multiples of $w_i$. This is exactly the kernel of $\mathbb{N}^{n-1} \to \mathbb{Z} / w_i \mathbb{Z}$ given by sending the basis $e_j \mapsto w_j$ and omitting $w_i$.

I would assume this is already implemented somewhere but I cannot find it.

Thank you.