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.Fri, 18 Jan 2019 10:26:41 -0600weird behavior quotient operatorhttp://ask.sagemath.org/question/45099/weird-behavior-quotient-operator/Hello,
i am calculating the quotient of a really big number using the operator //
the fact is: if the big number is in a variable, let's say x, and i write x//2, it won't work (it'll return x/2).
But if i copy/paste the big number and write //2 at the end, it works.
I don't understand it.
I wanted to post a picture as example, but it seems that i need more karma to do it...
so instead i put a copy/paste of the problem at the end of this post. The variable's name is "test", so i first print it, then do the //2; as you can see it doesn't work, i got the same number with /2 at the end. Then i copy/paste the number and use //2 again and here it works. The point is: when i use it in a programm, i can't copy/paste the number, it'll be in a variable. And then it fails.
sage: test
837852367160941686882182203279810821534331590056292182065749220359229900094799322306853693706463088872767820405170018794451898101765853614283153521412505365960228304480760794688517092896652646155467604050167410281621256684893277033624912312765082826592417694451712096609637026970174504593832198908321736540951
sage: test//2
837852367160941686882182203279810821534331590056292182065749220359229900094799322306853693706463088872767820405170018794451898101765853614283153521412505365960228304480760794688517092896652646155467604050167410281621256684893277033624912312765082826592417694451712096609637026970174504593832198908321736540951/2
sage: 83785236716094168688218220327981082153433159005629218206574922035922990009479932230685369370646
....: 30888727678204051700187944518981017658536142831535214125053659602283044807607946885170928966526
....: 46155467604050167410281621256684893277033624912312765082826592417694451712096609637026970174504
....: 593832198908321736540951//2
418926183580470843441091101639905410767165795028146091032874610179614950047399661153426846853231544436383910202585009397225949050882926807141576760706252682980114152240380397344258546448326323077733802025083705140810628342446638516812456156382541413296208847225856048304818513485087252296916099454160868270475AbliaFri, 18 Jan 2019 10:26:41 -0600http://ask.sagemath.org/question/45099/Identity in a quotient Grouphttp://ask.sagemath.org/question/44965/identity-in-a-quotient-group/ Hello everyone, I have the following groups
F3.<a1,b1,a2,b2,a3,b3> = FreeGroup()
H3 = F3.quotient([a1*b1/a1/b1*a2*b2/a2/b2*a3*b3/a3/b3])
Then I inject the variables to $H3$
H3.inject_variables()
Now when every element that I write have parent $H3$, but when I write the word `a1*b1/a1/b1*a2*b2/a2/b2*a3*b3/a3/b3`
this does not return the identity of $H3$, although if I put
a1*b1/a1/b1*a2*b2/a2/b2*a3*b3/a3/b3 == H3.one()
this is true. Does anyone know why this happen and how can I get sage to reduce this word to identity of $H3$?
MarioMTue, 08 Jan 2019 18:03:52 -0600http://ask.sagemath.org/question/44965/Quotient Group constructionhttp://ask.sagemath.org/question/42747/quotient-group-construction/ I have created a group in the category - finite enumerated commutative subgroup. But it doesn't have an option of quotient group ( it has but shows Not Implemented Error)
I wanted to know why implementing a quotient group is not possible if quotient ring is done already?
Actually, I was thinking to implement it myself, but I thought it will be good to ask here first if people have tried that.
Also, does anyone know how I can track the current progress being done in sage.mathjainTue, 26 Jun 2018 19:49:42 -0500http://ask.sagemath.org/question/42747/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/How can you operate in a quotient of a group finitely presented?http://ask.sagemath.org/question/37511/how-can-you-operate-in-a-quotient-of-a-group-finitely-presented/Hello everyone, I have the following groups
G.<a,b> = FreeGroup()
H = G.quotient([a*b*a.inverse()*b.inverse()])
I would like SAGE to understand the product of to lateral clases in H? It is that possible?
Thanks in advance!NCAThu, 04 May 2017 12:56:13 -0500http://ask.sagemath.org/question/37511/Writing elements as a linear combination in a basis in a quotient ringhttp://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/I have an explicit ideal in a multivariable polynomial ring R. I know a priori that the quotient
ring R/I is finite dimensional (as a vector space). In fact I have an explicit basis in R/I. I have all this programmed into sage. Is there a way to find the linear combination for a given element in R/I in the given basis?
example:
sage: R.<e1,e2>=PolynomialRing(QQ)
sage: I = ideal(e1^3 -2 * e2 * e1 +1, e2 * e1^2 - e2^2 - e1)
sage: I.vector_space_dimension()
6
sage: f22= e2^2 - e1; f21 = e2*e1 - 1; f11 = e1^2 - e2; f1= e1; f2 = e2; f0 = 1;
sage: I.reduce(f21*f21)
e1*e2
sage: I.reduce(f21*f21) == f21 + f0
True
I have an ideal I in R and I know that the quotient ring R/I is 6 dimensional over the field. I have the basis
f22,f21,f11,f2,f1,f0 of R/I as a vector space over QQ. I would like to find the structure constants of this finite dimensional algebra. For example compute f21^2 in the quotient ring, and write it in the basis, we get f21^2=f21+f0.
But I only get it by hand and would like to compute it with sage, so that I could get the whole set of structure constants. mathworkerThu, 05 May 2016 14:07:11 -0500http://ask.sagemath.org/question/33322/How to find a particular coset?http://ask.sagemath.org/question/33317/how-to-find-a-particular-coset/I am in the situation where I have groups $A,G$ with $G$ normal in $A$ such that $A/G$ is cyclic. I would like to find the coset of $G$ corresponding to a generator of $A/G$. AsvinWed, 04 May 2016 11:17:55 -0500http://ask.sagemath.org/question/33317/Rings, Ideals, Quotient Rings in Sagehttp://ask.sagemath.org/question/29990/rings-ideals-quotient-rings-in-sage/Hi everybody.
I am new to sage. I want to construct rings, ideals, and quotient rings.
I used Z.IntegerRing() to generate the ring of integers.
Question 1:
Then I used I = Z.ideal(2) to get the ideal generated by 2 (even numbers).
Question: How can I display the Elements. E.g. I(2) does not work in order to display the second element of the ideal.
Question 2:
To generate the quotientring Z/2Z i used S = Z.quotient_ring(I).
What if I want to generate the quotientring 2Z/6Z ? S = I.quotient_ring(J) does not work (I = Z.ideal(2), J = Z.ideal(6).
Thanks for any help
DesperateUserWed, 14 Oct 2015 02:38:47 -0500http://ask.sagemath.org/question/29990/Quotient of Polynomial rings reduction not workinghttp://ask.sagemath.org/question/27068/quotient-of-polynomial-rings-reduction-not-working/<code>
<br>R.<x>=PolynomialRing(QQ)
<br>R.ideal(x^4).reduce(x^8+1)
<br>R.<x>=PolynomialRing(ZZ)
<br>R.ideal(x^4).reduce(x^8+1)
1
x^8 + 1
</code>
Why am I not getting the result 1 in both cases?WizqTue, 09 Jun 2015 08:44:26 -0500http://ask.sagemath.org/question/27068/Mysterious behavior for quotient rings and cover()http://ask.sagemath.org/question/10944/mysterious-behavior-for-quotient-rings-and-cover/I don't understand this:
R.<T,U>=PolynomialRing(QQ)
Q=R.quo((T^2))
pi=Q.cover()
pi(T)
-- returns Tbar
However:
R.<T>=PolynomialRing(QQ)
Q=R.quo((T^2))
pi=Q.cover()
pi(T)
-- returns an error.jeremy9959Sat, 18 Jan 2014 01:49:36 -0600http://ask.sagemath.org/question/10944/preorders and posetshttp://ask.sagemath.org/question/10866/preorders-and-posets/I am looking for a module having to do with preorders (sets with reflexive and transitive relations, also called quasi-orders). I'd like to use a few of the poset methods on preorders, but this doesn't seem to work. That is, I get
Traceback (click to the left of this block for traceback)
...
ValueError: Hasse diagram contains cycles.
I figure that either there is a way to indirectly use the poset methods on preorders more generally, or else someone has implemented the quotient operation. (This turns a preorder (A,\leq) into a poset by taking the quotient under the equivalence relation \equiv on A by a \equiv b iff a \leq b and b \leq a.Larry MossSun, 29 Dec 2013 05:02:55 -0600http://ask.sagemath.org/question/10866/Power of a polynomial mod (n, X^r - 1)http://ask.sagemath.org/question/8742/power-of-a-polynomial-mod-n-xr-1/I need to calculate (X + a)^n mod (n, X^r - 1), where n can be very large.
I use the following code:
R.<x>=PolynomialRing(Integers(n))
pow(x + a, n, X^r - 1)
A better (i.e. faster) solution?
Thanks.mcl1962Mon, 27 Feb 2012 00:39:15 -0600http://ask.sagemath.org/question/8742/