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, 04 Mar 2019 20:56:58 +0100Writing elements as a linear combination in a basis in a quotient ringhttps://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. Thu, 05 May 2016 21:07:11 +0200https://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/Answer by tmonteil for <p>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? </p>
<p>example:</p>
<p>sage: R.<e1,e2>=PolynomialRing(QQ)</p>
<p>sage: I = ideal(e1^3 -2 * e2 * e1 +1, e2 * e1^2 - e2^2 - e1)</p>
<p>sage: I.vector_space_dimension()</p>
<p>6</p>
<p>sage: f22= e2^2 - e1; f21 = e2*e1 - 1; f11 = e1^2 - e2; f1= e1; f2 = e2; f0 = 1; </p>
<p>sage: I.reduce(f21*f21)</p>
<p>e1*e2</p>
<p>sage: I.reduce(f21*f21) == f21 + f0</p>
<p>True</p>
<p>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. </p>
https://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/?answer=33324#post-id-33324You can use the `lift` method. You can look at the following links for concrete examples:
- http://ask.sagemath.org/question/8346/find-polynomial-in-terms-of-ideal/
- http://ask.sagemath.org/question/7853/quotient-decomposition-by-groebner-basis/
- http://ask.sagemath.org/question/31946/polynomial-decomposition/
Fri, 06 May 2016 11:18:46 +0200https://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/?answer=33324#post-id-33324Comment by mathworker for <p>You can use the <code>lift</code> method. You can look at the following links for concrete examples:</p>
<ul>
<li><a href="http://ask.sagemath.org/question/8346/find-polynomial-in-terms-of-ideal/">http://ask.sagemath.org/question/8346...</a></li>
<li><a href="http://ask.sagemath.org/question/7853/quotient-decomposition-by-groebner-basis/">http://ask.sagemath.org/question/7853...</a></li>
<li><a href="http://ask.sagemath.org/question/31946/polynomial-decomposition/">http://ask.sagemath.org/question/3194...</a></li>
</ul>
https://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/?comment=33326#post-id-33326Thanks. I think that the lift can only be used to find a combination of given elements where the coefficients come from the whole polynomial ring, and not just from the field. What I need is a linear combination where the coefficients come from the field. See the extended question.Fri, 06 May 2016 15:07:04 +0200https://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/?comment=33326#post-id-33326Answer by J Swanson for <p>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? </p>
<p>example:</p>
<p>sage: R.<e1,e2>=PolynomialRing(QQ)</p>
<p>sage: I = ideal(e1^3 -2 * e2 * e1 +1, e2 * e1^2 - e2^2 - e1)</p>
<p>sage: I.vector_space_dimension()</p>
<p>6</p>
<p>sage: f22= e2^2 - e1; f21 = e2*e1 - 1; f11 = e1^2 - e2; f1= e1; f2 = e2; f0 = 1; </p>
<p>sage: I.reduce(f21*f21)</p>
<p>e1*e2</p>
<p>sage: I.reduce(f21*f21) == f21 + f0</p>
<p>True</p>
<p>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. </p>
https://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/?answer=45655#post-id-45655You want I.normal_basis(). The documentation is abysmal (both in Sage and for the underlying Singular routine). In practice it appears that the leading term g.lt() of the result of g=I.reduce(f) belongs to I.normal_basis(). So, you can subtract that off, reduce the result, pick off the next leading term, etc. to get the coefficients you're after. You can of course use a change of basis matrix to use your own preferred basis. For certain nice quotients I.reduce(f) yields an expression that's a linear combination of I.normal_basis(), but sometimes I've had to use the iterative approach. It's never been enough of a bottleneck for me to investigate what's actually going on (i.e. read Singular's kbase method's source code), and there's at least no correctness concerns with this approach.Mon, 04 Mar 2019 20:56:58 +0100https://ask.sagemath.org/question/33322/writing-elements-as-a-linear-combination-in-a-basis-in-a-quotient-ring/?answer=45655#post-id-45655