How to show sage code results in LaTeX file and do other computations?

asked 2020-04-13 08:21:29 +0100

Shreya gravatar image


I am new to Sage (just installed it a few days ago) so I apologise if this question is too basic for this site. But since I'm really stuck and have no other platform to get help, I'll go ahead with my query anyway.

  1. am writing a LaTeX document (on elliptic curves) and I wanted to do some related computations. Now I know how to embed the sage code in Latex file (you use sageblock) but I also want to show the results of those codes (like listing torsion points automatically as sage code output, the way we see it) in my LaTeX file. How do I do this?
  2. Next, I saw someone's thesis here: 1812.10415 (can't post links yet, but googling this number gives that pdf) (page 68). They have shown the results of two descent like, computed the bounds on the ranks of quotients $E'(\mathbb{Q})/\phi(E(\mathbb{Q})$, $E(\mathbb{Q})/2E(\mathbb{Q})$, etc. and I couldn't find the codes to do the same in the Sage manual: Elliptic Curves on Rational Numbers. They have not only shown what sage codes they typed (which I didn't understand) but have also embedded their results in their latex file. How do I go on about doing the same?

I would really appreciate any kind of useful comments or answers.

Thank you.

Edit: my system is Ubuntu 14.04 and I use sage either in terminal or jypyter notebook.

edit retag flag offensive close merge delete


At page 67, it is written "I wrote the following script example.sage inSageMath:". The lines that follows should allow you to reproduce the results seen at page 68 (I didn't check myself).

Sébastien gravatar imageSébastien ( 2020-04-13 16:35:02 +0100 )edit

And how do I build this .sage file? In terminal?

Shreya gravatar imageShreya ( 2020-04-13 17:21:10 +0100 )edit

You don't need to create such a file, you can just copy its content in a cell of the jupyter notebook, for example inside of a function def f(): that you may call in another cell by doing f()

Sébastien gravatar imageSébastien ( 2020-04-13 18:35:53 +0100 )edit

Doesn't help, sorry! I'm a total noob to this whole sage world. I read some parts of sage tutorial in example.pdf but all I get ?? instead of the sage code output. It's frustrating.

Shreya gravatar imageShreya ( 2020-04-13 19:16:24 +0100 )edit

Are you able to reproduce the first part in a terminal or in the jupyter notebook?

sage: E = EllipticCurve([0,0,0,17,0])
sage: E
Elliptic Curve defined by y^2 = x^3 + 17*x over Rational Field
sage: d = E.discriminant()
sage: d
sage: d.factor()
-1 * 2^6 * 17^3
sage: E.is_minimal()
Sébastien gravatar imageSébastien ( 2020-04-13 22:33:42 +0100 )edit