ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 07 Jan 2019 02:55:20 -0600Is there a way to make sage print out all monomials of a Boolean Ring?http://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 02:55:20 -0600http://ask.sagemath.org/question/44921/Inverse of a number modulo 2**255 -19http://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 12:26:43 -0500http://ask.sagemath.org/question/43738/kernel of a matrix defined over polynomial ringshttp://ask.sagemath.org/question/42453/kernel-of-a-matrix-defined-over-polynomial-rings/ I have a matrix defined as a function of variables in a polynomial ring defined over finite field as follows-
Gr.<xp,yp>=LaurentPolynomialRing(GF(2));
M=Matrix(Gr,[[xp-1,0],
[yp-1,0],
[0,(yp^(-1))-1],
[0,-(xp^(-1))+1]]);
I want to calculate the kernel of this matrix but the kernel function
M.kernel()
gives an error. What am I doing wrong?arpitSun, 27 May 2018 17:40:42 -0500http://ask.sagemath.org/question/42453/Examining the quotients of a module $R\times R$ where $R$ is a finite ring.http://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 08:28:00 -0600http://ask.sagemath.org/question/41421/