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.Thu, 02 Aug 2018 10:50:51 -0500How to find the normal form of an elliptic curve using Sage?http://ask.sagemath.org/question/43242/how-to-find-the-normal-form-of-an-elliptic-curve-using-sage/Let $C$ be the following curve in $\mathbb{C}^2$.
\begin{align}
& 11664 {c_1}^3 {c_2}^2 + 536544 {c_1}^3 c_2 + 6170256 {c_1}^3 + 67068 {c_1}^2 {c_2}^2 + 1542564 {c_1}^2 c_2 \\
& + 3085128 c_1 {c_2}^2 - 32393844 c_1 c_2 + 3085128 c_1 + 17739486 {c_2}^2 + 6941538 c_2 = 0.
\end{align}
I checked that this curve has genus $1$ using Sage. Therefore it is an elliptic curve. How to change coordinates such that the equation of this curve is of the form $y^2 = f(x)$, where $f$ is some polynomial. Thank you very much.
I tried to use the following codes in Sage.
R.<c1,c2> = QQ[]; Jacobian(11664*c1^3*c2^2 + 536544*c1^3*c2 + 6170256*c1^3 + 67068*c1^2*c2^2 + 1542564*c1^2*c2 + 3085128*c1*c2^2 - 32393844*c1*c2 + 3085128*c1 + 17739486*c2^2 + 6941538*c2)
But there is an error: NoEmbeddingError: not a sub-polytope of a reflexive polygon. How to find the normal form of the curve using Sage? Thank you very much.lijr07Thu, 02 Aug 2018 10:50:51 -0500http://ask.sagemath.org/question/43242/Plot plane projective curves.http://ask.sagemath.org/question/38707/plot-plane-projective-curves/Hey wanted to plot plane projective curves (i.e. an algebraic curve in $\mathbb P^2$) as a 3 dimensional pictures
or as the intersection with a sphere.
Any idea how to do that in sage math?
![Examples](http://voltage.typepad.com/.a/6a00e55375ef1c8833014e88802058970d-500wi)http://voltage.typepad.com/.a/6a00e55375ef1c8833014e88802058970d-500wi
![Examples](https://mathsbyagirl.files.wordpress.com/2015/10/projective-curve-in-p2.png)hanswFri, 01 Sep 2017 11:20:02 -0500http://ask.sagemath.org/question/38707/Computing the ideal of relationshttp://ask.sagemath.org/question/27263/computing-the-ideal-of-relations/Given two projective spaces $\mathbb P^n$ and $\mathbb P^m$ together with $m+1$ global sections of the invertible sheaf $\mathcal O_{\mathbb P^n}(d)$ (e.g. $m+1$ homogeneous polynomials of degree $d$ in the variables $x_0,\cdots,x_n$, say $f_0,\cdots,f_m$), we know that there exists a unique morphism $[f_0,\cdots,f_m] : \mathbb P^n \to \mathbb P^m$. Assume the projective spaces are considered over a noetherian ring ; the morphisms to the base are both projective, hence proper, which means $[f_0,\cdots,f_m]$ is a proper morphism, hence has closed image.
Question : Does there exist an algorithm already implemented in Sage to find the homogeneous ideal of relations of the image of the map $[f_0,\cdots,f_m]$? I've been messing around for a few days now and it seems to only involve linear algebra, so in the case where the base is the spectrum of a field there should be an algorithm, I just don't know how efficient it is or if it's implemented at all. I would not mind if the algorithm was slow, I just want it to work in small cases (i.e. small degree and small number of polynomials)!Patrick D. SilvaMon, 06 Jul 2015 02:25:49 -0500http://ask.sagemath.org/question/27263/Map between projective curves defined in an extension fieldhttp://ask.sagemath.org/question/38263/map-between-projective-curves-defined-in-an-extension-field/For example, suppose I have the following 2 projective curves:
k = GF(13)
x,y,z = ProjectiveSpace(k, 2, 'x,y,z').gens()
E = Curve(2*x^2 + 8*y*z + 8*z^2)
W = Curve(x^2 + y*z + z^2)
I like to define a map from E to W that involves $\sqrt 2$ and $\sqrt 8$, which do not exist in k = GF(13), but do in an extension of k:
x = PolynomialRing(k,'x').gen()
K = GF(13**2, 'w', modulus=x^2-2)
w = K.gen()
So $w = \sqrt 2$ and $2w = \sqrt 8$. The map I like to define sends $(x:y:z)$ to $(wx:2wy:2wz)$.
In this particular example, it's obvious that $(wx:2wy:2wz) = (x:2y:2z)$; but it's just a simple example do demonstrate the problem.
Something like this doesn't work:
x,y,z = ProjectiveSpace(k, 2, 'x,y,z').gens() #or ProjectiveSpace(K, 2, 'x,y,z').gens()
E.Hom(W)([w*x, 2*w*y, 2*w*z])
Thank you.RoadFri, 14 Jul 2017 11:08:01 -0500http://ask.sagemath.org/question/38263/Intercept theorem in sagehttp://ask.sagemath.org/question/33330/intercept-theorem-in-sage/ Hi,
I'm working on Grobner bases and Buchberger algorithm and begginning in Sage. I would like to find a way to prove that if we have $B, C, D$ three points, then the point $C$ is in the circle of diameter $BD$ if and only if the triangle $BCD$ is an $C$-shaped right-angled triangle.
I'm thinking about using the Intercept theorem but I would like to prove it using Sage.
Thank you
interception47Fri, 06 May 2016 11:48:30 -0500http://ask.sagemath.org/question/33330/how can I Calculate grobner bases in this application?http://ask.sagemath.org/question/36407/how-can-i-calculate-grobner-bases-in-this-application/ I want to solve some questions ,which they need to find many Grobner Bases but I don't know how can I use this app to find Grobner Bases , I will be so Thanks full if some one helps me .mahyaSat, 28 Jan 2017 10:09:33 -0600http://ask.sagemath.org/question/36407/The perimeter of a rectangle is 600 yards. What are the dimensions of the rectangle if the length is 10 yards more than the width?http://ask.sagemath.org/question/35036/the-perimeter-of-a-rectangle-is-600-yards-what-are-the-dimensions-of-the-rectangle-if-the-length-is-10-yards-more-than-the-width/The perimeter of a rectangle is 600 yards. What are the dimensions of the rectangle if the length is 10 yards more than the width? mgraceb16Mon, 03 Oct 2016 00:58:44 -0500http://ask.sagemath.org/question/35036/Modular Functionshttp://ask.sagemath.org/question/7487/modular-functions/Is there a way in SAGE to find modular functions associated to a given congruence subgroup?805801Thu, 30 Jun 2011 12:29:15 -0500http://ask.sagemath.org/question/7487/Passing ideals between Macaulay and Sagehttp://ask.sagemath.org/question/10455/passing-ideals-between-macaulay-and-sage/During some sage code, I'd like to take an ideal, send it to Macaulay2, do some computations with it, and then continue to use the new ideal in sage.
Are there smart ways to do this? I'm currently doing it by converting all variables/equations to strings, and using string maniuplations to produce valid macaulay2 commands. More concretely:
1.) Define the same ring in Macaulay2 via:
<PRE>(my rings are Z-algebras):
l = R.cover_ring().variable_names(); #variable names
m = R.defining_ideal().gens(); #generators of ideal
T = "R = ZZ[" + ", ".join(str(z) for z in l) + "]/("+ ",".join(str(z) for z in m) +")" ;
macaulay2(T);
</PRE>
2.) Then, I can define an ideal I and do some computations with it.
3.) Question: I can print the generators of I via
<PRE>macaulay2("toString gens I");</PRE>
and then, again using string maniuplations remove the "matrix {{" and "}}" from Macaulay2's output, split the string to get a list which can be then be interpreted as generators of an ideal in sage.
Is there a better way to do any of these steps?LMNSun, 18 Aug 2013 12:20:41 -0500http://ask.sagemath.org/question/10455/I need something unique about sagehttp://ask.sagemath.org/question/10257/i-need-something-unique-about-sage/Hi
I have a presentation about Sage tutorial and I know sage commands for algebra and algebraic geometry, but is there something interesting about sage that I can say and encourage the others for learning sage?
AminWed, 19 Jun 2013 09:07:25 -0500http://ask.sagemath.org/question/10257/why this algorithm does not work?http://ask.sagemath.org/question/10234/why-this-algorithm-does-not-work/Hello
I'm trying to write this algorithm in sage:
def roots(f, q):
# return list of roots of f in finite field of q elements
K.<T> = GF(q)
r = [ ]
g = qq2zz(f).change_ring(K)
for a in K:
if g(a) == 0:
r.append(a)
return r
but i get error, it says that:
Traceback (click to the left of this block for traceback ) ....
how should I correct it?
NedaThu, 13 Jun 2013 09:28:39 -0500http://ask.sagemath.org/question/10234/How to write twisted cubic in sage?http://ask.sagemath.org/question/8705/how-to-write-twisted-cubic-in-sage/Hello
could you please tell me how can I write twisted cubic
( {cost,sint | t in R}= v(x^2+y^2-1) )
in sage? should I use subscheme command and introduce it as an affine variety?NedaMon, 17 Jun 2013 02:12:12 -0500http://ask.sagemath.org/question/8705/How to write Buchberger algorithm?http://ask.sagemath.org/question/10223/how-to-write-buchberger-algorithm/Hello, I want to write this algorithm in sage, I know sage is python base but I'm not much familiar with this programming language so I'm working on it..
Could you please tell me how can I write Buchberger algorithm in sage? I know there is commands for computing it, but I want the algorithm..
input= (f1, ,fs)
output= a groebner basis G={ g1,...,gt} for f ? G
initialization :
G=F
*g*:= {(fi,fj) | fi,fj *?* G , fi!= fj }
h:=0
iteration
WHILE *g* != 0 DO
choose any {f,g} ? *g*
*g*:= *g* \ {{f,g}}
h:= (s(f,g)) ^G
IF h != 0 THEN
*g* := *g* U {{u,h}| u ? G }
G:= G U {h}
NedaTue, 11 Jun 2013 22:11:04 -0500http://ask.sagemath.org/question/10223/how to find standard monomials of an Ideal?http://ask.sagemath.org/question/7523/how-to-find-standard-monomials-of-an-ideal/Hello
Is there any special command for contributing standard monomials of an Ideal I?
NedaFri, 07 Jun 2013 04:17:14 -0500http://ask.sagemath.org/question/7523/How should I write this algorithm?http://ask.sagemath.org/question/10022/how-should-i-write-this-algorithm/hello
I want to write this algorithm in sage, but I don't know how to write it as an algorithm in sage, could you please help me
Algorithm : update basis-update of intermediate basis G with reduct h
Given: a finite set G_old ? B[X] and the reduct 0!=h ? B[X]
Find: updates G_new ? B[X] of G_old
begin
1: G_new <-- Ø
2: while G_old !=Ø do
3: selecting from G_old ; G_old <-- G_old \{g}
4: if HT(h) not divisible HT(g) then
5: G_new <-- G_new U {g}
6: end
7:end
8: G_new <-- G_new U {h}
9: return G_new
end
thank you so muchNedaSun, 14 Apr 2013 01:16:08 -0500http://ask.sagemath.org/question/10022/How to write trgonometric parametrization?http://ask.sagemath.org/question/9986/how-to-write-trgonometric-parametrization/Hello,
Could you please tell me how can I solve a trigonometric parametrization, for example
using a trigonometric identity to show that x= cos(t) y= cos(2t)
parametrizes a portion of a parabola so indicate what portion of the parabola is coverd..
thank youNedaSat, 06 Apr 2013 07:25:17 -0500http://ask.sagemath.org/question/9986/what is "set_verbose"command in buchberger algorithm?http://ask.sagemath.org/question/9994/what-is-set_verbosecommand-in-buchberger-algorithm/ Hello
I computed buchberger algorithm as
R.<x,y,z>=PolynomialRing(QQ,3)
I=ideal(x^6-y^2+z, z^3+y^2)
set_verbose(3)
I.groebner_basis('toy:buchberger')
(x^6 - y^2 + z, z^3 + y^2) => 0
G: set([x^6 - y^2 + z, z^3 + y^2])
(z^3 + y^2, x^6 - y^2 + z) => 0
G: set([x^6 - y^2 + z, z^3 + y^2])
2 reductions to zero.
[x^6 - y^2 + z, z^3 + y^2]
I just want to know what is `set_verbose(3)` command for in this? also `toy:` ...
thank you
NedaFri, 05 Apr 2013 04:35:32 -0500http://ask.sagemath.org/question/9994/Sketch affine variety in R^3http://ask.sagemath.org/question/9992/sketch-affine-variety-in-r3/Hello
I want to sketch this affine variety in $R^3$: $V((x-2)(x^2-1) , y(x^2-y),(z+1)(x^2-1))$.
Is this command
implicit_plot3d((x-2)(x^2-1) , y(x^2-y),(z+1)(x^2-1),[-2,2],[-2,2],[-2,2])
correct ? or I should try writing that command 3 times for each part?
NedaFri, 05 Apr 2013 01:33:37 -0500http://ask.sagemath.org/question/9992/how to write Division command?http://ask.sagemath.org/question/9977/how-to-write-division-command/ Hello
could you please tell me how can I compute the remainder on division of the given polynomial f by the order set F using grlex order in sage? thank you
f= x*y^2+x^3*y^2-y+1
F=(x*y^2-x , x-y^3)NedaTue, 02 Apr 2013 22:22:10 -0500http://ask.sagemath.org/question/9977/Algebraic geometry exampleshttp://ask.sagemath.org/question/9963/algebraic-geometry-examples/Hi, does anyone have some examples and exercises about algebraic geometrt such as affine variety,hilbert's nullstellensat,finite dimentional algebra,elimination theory.. or anything relevant to algebraic geometry? Because I'm new in using sage and I want to practice and use it in algebraic geometry..or even if you know some books that have Many examples for learning sage in algebraic geometry please tell me..thank you allNedaSat, 30 Mar 2013 22:18:00 -0500http://ask.sagemath.org/question/9963/Polynomial division commandhttp://ask.sagemath.org/question/9974/polynomial-division-command/hello
I found this post from sage documents for division of two polynomials
def division(dividend, divisor) :
print 'quotient: ', (dividend._maxima_().divide(divisor).sage())[0]
print 'remainder: ', (dividend._maxima_().divide(divisor).sage())[1]
but could you please explain a little bit about this post? such as what is divided.maxima_() ?
NedaTue, 02 Apr 2013 08:37:22 -0500http://ask.sagemath.org/question/9974/Affine varietyhttp://ask.sagemath.org/question/9971/affine-variety/Hi
Is there any commands for writing affine variety (Let k be a field, and let f1,...,fs be polynomials in k[ x1,...,xn]. Then we set
V(f1,...,fs)= { (a1,...,an) ? k^n : fi (a1,...,an)=0 for all 1 ?i?s } we call V(f1,...,fs) the affine variety defined by f1,...,fs ) ?
Also how can I drew an affine variety plane such as V(x^2- y^2*z^2+ z^3) ?
NedaMon, 01 Apr 2013 21:46:00 -0500http://ask.sagemath.org/question/9971/Defining a general curvehttp://ask.sagemath.org/question/9934/defining-a-general-curve/Hey, I am relatively new to Sage, so this question might be very simple:
I want to define a projective curve in $\mathbb{P}^2$ given by $x^3=y^3-Az^3$, where $A$ is an arbitrary non-zero element of an algebraically closed field, say C. I tried the following:
x,y,z=ProjectiveSpace(2,CC,'xyz').gens();
var('A',domain=CC);
C=Curve(x^3+y^3-A*z^3);
But I get TypeError: F (=-A*z^3 + x^3 + y^3) must be a multivariate polynomial.
Is it possible to define the curve I want in Sage? All examples of algebraic geometry in Sage I saw deal with explicitly defined curves.
Michalis NFri, 22 Mar 2013 06:48:07 -0500http://ask.sagemath.org/question/9934/invariant_theory packagehttp://ask.sagemath.org/question/9896/invariant_theory-package/I am trying to follow the tutorial on the invariant_theory package: http://www.sagemath.org/doc/reference/sage/rings/invariant_theory.html
I asked sage to execute the first example:
sage: R.<x,y> = QQ[]
sage: q = x^4 + y^4
sage: quartic = invariant_theory.binary_quartic(q); quartic
But received the following error:
Traceback (click to the left of this block for traceback)
...
NameError: name 'invariant_theory' is not defined
I have the newest version of sage installed. What's going wrong here?JDAFri, 08 Mar 2013 14:31:11 -0600http://ask.sagemath.org/question/9896/Finding the dual basis of a space of rational functions?http://ask.sagemath.org/question/9893/finding-the-dual-basis-of-a-space-of-rational-functions/I am trying to calculate the algebraic geometry codes (Function codes and Residue Code) for a given divisor. For calculating the function codes, sage directly provides a way to calculate the Riemann Roch Basis (they are rational functions). But, I need an explicit basis for the Residue code too (which is the dual of the function code).
So, essentially, when a basis (in terms of rational functions) is given, is there a way in sage to find the dual basis?THEcreationistThu, 07 Mar 2013 09:13:12 -0600http://ask.sagemath.org/question/9893/Buchberger Algorithmhttp://ask.sagemath.org/question/9815/buchberger-algorithm/Hi!
could you please tell me which command I should use for contributing the buchberger algorithm to finding a groebner basis for an Ideal over a field like rational field?
I found these commands but did'nt work..
sage: from sage.rings.polynomial.toy_buchberger import *
sage: P.<a,b,c,e,f,g,h,i,j,k> = PolynomialRing(GF(32003),10)
sage: I = sage.rings.ideal.Katsura(P,6)
sage: g1 = buchberger(I)
sage: g2 = buchberger_improved(I)
sage: g3 = I.groebner_basis()NedaSun, 17 Feb 2013 06:23:46 -0600http://ask.sagemath.org/question/9815/Elementary algebraic geometry?http://ask.sagemath.org/question/9806/elementary-algebraic-geometry/I'm not an algebraic geometer, so apologies in advance if this is a trivial question. I'm currently exploring some (Euclidean) geometry relating to various lines and circles, and their intersections. Here is one of the sorts of questions I'm looking at: given a fixed point (u,v) and a fixed circle C of radius R with centre (0,0), then given a general point (x,y) on C, find another point (X,Y) on C so that the line between (x,y) and (X,Y) is at distance d from (u,v). In other words, I'd like to express (X,Y) as a function of (x,y) in the nicest possible way. I can set up a system of equations and attempt to solve them, but this is slow and produces hugely messy results.
I was wondering if there's a more natural, or better way, in Sage.AlasdairThu, 14 Feb 2013 13:42:08 -0600http://ask.sagemath.org/question/9806/System of polynomial inequalitieshttp://ask.sagemath.org/question/9596/system-of-polynomial-inequalities/I heard that something called a Groebner Basis can be used to find the solutions of a system of polynomial equations like $p_1(x_1,\ldots,x_m)=0,\ldots,p_n(x_1,\ldots,x_m)=0$
Is there something analgous that can find solutions when inequalities are also involved such as
$$p_1(x_1,\ldots,x_m)=0,\ldots,p_n(x_1,\ldots,x_m)=0$$
$$q_1(x_1,\ldots,x_m)>0,\ldots,q_r(x_1,\ldots,x_m)>0$$
and is there a way to do this in Sage?kevinfatSat, 01 Dec 2012 14:56:21 -0600http://ask.sagemath.org/question/9596/Finding Hauptmodulshttp://ask.sagemath.org/question/8194/finding-hauptmoduls/Given a modular curve with genus zero (for example $X_{1}(7)$) is there a way in SAGE to find its Hauptmodul?805801Wed, 29 Jun 2011 19:10:45 -0500http://ask.sagemath.org/question/8194/Groebner basis for rational functions with real coefficientshttp://ask.sagemath.org/question/8151/groebner-basis-for-rational-functions-with-real-coefficients/Does anybody know if sage supports computing groebner basis for an ideal of rational functions with real coefficients? I can do this in mathematica, but when using sage I get the error:
verbose 0 (2416: multi_polynomial_ideal.py, groebner_basis) Warning:
falling back to very slow toy implementation.haharringtonMon, 06 Jun 2011 07:36:40 -0500http://ask.sagemath.org/question/8151/