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.Mon, 29 Jun 2020 16:55:09 +0200Solving a polynomial system in a quotient ringhttps://ask.sagemath.org/question/52254/solving-a-polynomial-system-in-a-quotient-ring/I want to compute all solutions in $\mathbb{Z}_9[\sqrt2,x]$, where $x$ is such that $(x+\sqrt2)^2=2(x+\sqrt2)$, of the equation
$$X^2=1.$$
I'm first defining the polynomial ring over $\mathbb{Z}_9$ in variables $x,y$, then factoring by the ideal generated by
$$y^2-2, (x+y)^2-2(x+y),$$
to get the ring $S$, but then I don't know which command to use in order to get the solutions of $X^2-1$. I have tried "solve" and "variety" (defining $S[X]$ first and then the ideal of $X^2-1$), but they do not seem to work. The code up to this point is just
R.<x,y> = PolynomialRing(IntegerModRing(9),order='lex')
J= R.ideal(x^2-2,(x+y)^2-2*(x+y))
S=R.quotient(J)
Which function should I use?Jose BroxMon, 29 Jun 2020 16:55:09 +0200https://ask.sagemath.org/question/52254/Linear code over a finite ringhttps://ask.sagemath.org/question/45640/linear-code-over-a-finite-ring/The command
LinearCode(M)
works well on a Finite Field `F`, but doesn't work for a finite ring.
Is there any way to construct a linear code over a finite ring using sage?
In other words, could we construct a module over ZZ/nZZ?
I try to understand the trac tickets [#6452](https://trac.sagemath.org/ticket/6452) and [#19345](https://trac.sagemath.org/ticket/19345) for constructing a linear code over a finite ring.
Unfortunately, I failed to understand.nur_hamidMon, 04 Mar 2019 12:01:18 +0100https://ask.sagemath.org/question/45640/Is there a way to make sage print out all monomials of a Boolean Ring?https://ask.sagemath.org/question/44921/is-there-a-way-to-make-sage-print-out-all-monomials-of-a-boolean-ring/Hi all,
In a finite ring, is there a way to get Sage to print out all possible monomials of the ring? I have a method, but it's very crude. It's simply doing something like taking a random variable to mutiply with a random ring element from B.random_element(). But this is obviously not what I want.
Below is the ring I'm working with.
B = BooleanPolynomialRing(20,'x', order = 'lex')
Is there a Sage function to put every monomial of the ring into a list? I can't seem to find it in Sage documentation.Stockfish3709Mon, 07 Jan 2019 09:55:20 +0100https://ask.sagemath.org/question/44921/Inverse of a number modulo 2**255 -19https://ask.sagemath.org/question/43738/inverse-of-a-number-modulo-2255-19/ I don't understand this code to solve the inverse of a number:
b = 256;
q = 2**255 - 19
def expmod(b,e,m):
if e == 0: return 1
t = expmod(b,e/2,m)**2 % m
if e & 1: t = (t*b) % m
return t
def inv(x):
return expmod(x,q-2,q)`
Finally, If I want to put: $\frac{2}{3}$ I can to do this: `aux=2*inv(3)`
What does the variable `e` mean?
Could you explain me this code, please?
Thank you so much.ZacariasSatrusteguiMon, 24 Sep 2018 19:26:43 +0200https://ask.sagemath.org/question/43738/Examining the quotients of a module $R\times R$ where $R$ is a finite ring.https://ask.sagemath.org/question/41421/examining-the-quotients-of-a-module-rtimes-r-where-r-is-a-finite-ring/I'm new to Sage, and I've been struggling to get started with (what I thought) should be a basic construction.
I have an $8$-element commutative ring $R$ which is constructed as a quotient of a polynomial ring in two variables. I need to examine all of the quotient of the right $R$ module $R\times R$.
I tried to use `M=R^2` and got something that looked promising, but when I tried to use the `quotient_module` method, I kept getting errors. I saw in the docs for that method that quotient_module isn't fully supported, so I started looking at the CombinatorialFreeModule class too.
> Can someone recommend an idiomatic way to accomplish the task?
I have been plagued by NotImplemented errors and a myriad of other error messages every step of the way, even when just attempting to find a method to list all elements of my $8$ element ring. All the examples I've seen really look like they stick to basic linear algebra, or free $\mathbb Z$ modules. I just want to do something similar for my small ring of $8$ elements.
Here's what I've been trying:
k # <- (finite field of size 2)
R.<x,y>=PolynomialRing(k)
S = R.quotient([x^2, x*y, y^3])
list(S) # <-- NotImplementedError("object does not support iteration") I noticed it worked for the univariate case though. What's a good way to recover the elements?
M = S^2
v = M.gens()
M.quotient_module([v[0]]) # <- ValueError("unable to compute the row reduced echelon form") TypeError("self must be an integral domain.")
Had the same problem with a univariate polynomial ring over $F_2$ mod $(x^3)$.
Obviously the messages are informative enough about what they think is wrong. But this seems like such an elementary task... is there some other class that can handle such a construction?rschwiebWed, 07 Mar 2018 15:28:00 +0100https://ask.sagemath.org/question/41421/Listing elements of (Z/nZ)*https://ask.sagemath.org/question/35006/listing-elements-of-znz/ I want to find all the elements of (Z/nZ)*. Is there a command for that ?
For example if the user gives input 8, the the output will be
{1,3,5,7}.nebuckandazzerSat, 01 Oct 2016 18:28:42 +0200https://ask.sagemath.org/question/35006/