ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 08 Apr 2021 04:40:24 +0200"Ratio" of two elements in a ringhttps://ask.sagemath.org/question/56538/ratio-of-two-elements-in-a-ring/Suppose I have a $\mathbb{Q}$-algebra R, and I have two elements x and y in R. I happen to know that x is a scalar multiple of y. Is there a way to figure out what the scalar is?
In other words, I want to identify the $\mathbb{Q}$-span of y with 1-dimensional vector space, choose an isomorphism of this vector space with $\mathbb{Q}$ (sending y to 1), and see where x goes.
The general context is that R is a finite-dimensional graded $\mathbb{Q}$-algebra (given as a quotient of a polynomial ring), and the top degree piece has dimension 1. I have an isomorphism of this top degree piece with $\mathbb{Q}$ (defined by sending a certain element to 1), and I want to be able to compute what it does to other elements.
An example of such a ring: let $A = \mathbb{Q}[x_1, x_2, x_3, x_4]$. Let $I_1 = (x_1x_3, x_2x_4)$. Let $I_2 = (x_1 + x_3, x_2 + x_4)$. Let $R = A/(I_1 + I_2)$.
(Note that $R$ is the Stanley-Reisner ring of simplicial complex (a triangulation of the circle) modulo a linear system of parameters. So it is graded by degree, and as the simplicial complex is a circle, the degree 2 is a 1-dimensional vector space.)
Let $y = x_1 x_2$, and let $x = (x_1 + x_4)(x_2 + x_3)$. Then x is a scalar multiple of y (as they are both in degree 2), and I would like to know what the scalar is.
(In this case, x = 2y.)
Later edit: fixed typovukovThu, 08 Apr 2021 04:40:24 +0200https://ask.sagemath.org/question/56538/Gaussians as Euclidean Domainhttps://ask.sagemath.org/question/44271/gaussians-as-euclidean-domain/Follow up to [a comment](https://ask.sagemath.org/question/44251/making-a-quotient-with-gaussian-elements/?comment=44265#post-id-44265) by @nbruin in a previous question:
> One reason that Euclidean division isn't available by default on ZI is because as far as sage is concerned, it's a quadratic ring, and those generally are not euclidean rings. There are some quadratic rings that are, but most of them are only euclidean with rather obscure euclidean norms. The fact that Z[i] is euclidean with the "standard" norm is really quite anomalous among quadratic rings.
> If you're interested in studying euclidean rings you probably should write some utility functions yourself to help you with it (or search if such utilities are already available). You could even consider writing a new ring subclass for Euclidean rings. To illustrate that sage doesn't know that ZI is a euclidean domain:
sage: ZI in EuclideanDomains()
False
context: `ZI = QuadraticField(-1, 'I').ring_of_integers()`
My question is: Is there a built in way in SageMath to work with Gaussian integers as an Euclidean domain?JsevillamolTue, 13 Nov 2018 17:48:43 +0100https://ask.sagemath.org/question/44271/