Questions tagged [sagemath]

For questions concerning the mathematical software system SageMath.

SageMath is a free open-source mathematics software system licensed under the GPL. It combines the power of many existing open-source packages into a common Python-based interface.

StackOverflow has a fairly heavily used [sage] tag as well for more programming-related question, with more links; see also the [sage] tag on MathOverflow.

Note also that Ask Sage, SageMath's questions-and-answers site, and sage-support, the user support mailing list, are very active and that questions asked there typically get answered faster than on the StackExchange network.

You can also look at the official documentation of SageMath.

402 questions
0
votes
1 answer

Sage command :To find a polynomial using lagrange interpolation over finite Ring

how to initialize lagrange_polynomial command for Finite Ring . It works for Finite Field,Z and Q . I tried for Ring with finite order, for me its shows ERROR.here is the code: R = PolynomialRing(Zmod(8),…
0
votes
0 answers

Tubular surface around curve

I need help with drawing tubular surface around curve. It is for my college project but we never used program like Sage so I don't know how to use it properly. We have Curve c(t)=(2cos(t),2sin(t),0.5*t) and I need to draw tubular surface around it.…
0
votes
1 answer

Calculate parameters of a parabola with SageMath

I would like to use SageMath to solve some equations of combined/composite curves. However, I did not find a way to solve even a simple parabola so far. Here is the most simplified code I can think of: x, a = var('x a') y(x) = a * x^2 solve([y,…
0
votes
2 answers

Define polynomial inductively and symbolic calculation

I need to define polynomials like $n\sum_{i=1}^aX^i +m \sum_{i=1}^bX^i$, where $a,b,n$ and $m$ are unknown integers, and then sum polynomials like this up. How should I do this in Sage? Should I define the polynomial inductively by for loop? And how…
0
votes
0 answers

Implementing the sbox components using lookup tables

Does it is possible to implement the components of a SBOX tables using lookup_tables. For example for a 4-bit SBOX it is possible to obtain the component 3 using SAGE in the following way sage: from sage.crypto.sbox import SBox sage: S =…
juaninf
  • 1,264
0
votes
1 answer

Solving system of equations over RR in sage

I would like to solve a polynomial system over RR in sage. See the toy example below >>> var_names = ['xor_0_7_x0', 'xor_0_7_x12', 'xor_0_7_y0'] >>> nvars = 3 >>> R=PolynomialRing(RealField(53), nvars, var_names, order="degneglex") >>>…
juaninf
  • 1,264
0
votes
0 answers

sagemath 3d plot tumble (enhanced spin)?

I am experimenting with SageMath today; I am new to SageMath. In cocalc.com I found this demo: show(icosahedron(color='green', opacity=.5, mesh=3), spin=1) Are there different axes that you can configure it to spin around, so that it'd be possible…
0
votes
1 answer

How to use a string in a symbolic expression with SageMath?

I would like to use a string as part of a symbolic expression. For instance: function('P') var('x1 x2 x3 y1 y2 y3') st = eval('y1,0,1') sum(P(x1,y1,y2,y3),st) How could I use st which is a string in the symbolic expression sum? I want the same…
0
votes
0 answers

Sage automatically/unnecessarily rounds ratio of two integers inside double loop.

I am not very familiar with Sage so maybe it is obvious. Input to Sage: i=3; j=2; print(i/j); for i in range(3,4): for j in range(2,3): print(i/j); Output from Sage: 3/2 1 First output is as expected $3/2$, but why the second…
azerbajdzan
  • 1,166
0
votes
2 answers

Patterns from an Algorithm

Consider the following algorithm: pick an integer $n> 0$. If $n$ is even, divide by 2. If $n$ is odd, find the least perfect square $m^2$ greater then $n$ and add $m^2$+n. Repeat step 2. with either $n/2$ or $n + m^2$. The conjecture is this…
0
votes
0 answers

sage : plotting graph with dotted edges

I need to draw a graph in which some edges are usual and some edges are dotted. I know how to make all the edges dotted (using the option "dotted" for the parameter edge_style of plot). But I need mixed edges (some are dotted and some are usual).…
GA316
  • 4,324
  • 27
  • 50
0
votes
1 answer

SageMath non-GUI mode

I'm not sure where to post this, but is it possible to run Sage without a GUI/notebook interface? The idea is to be able to run Sage solely in the terminal so that I can detach from the Tmux session and have Sage compute for hours. With the notebook…
m1cky22
  • 637
0
votes
1 answer

How do I force Sage to order my expressions a particular way, in LaTeX code?

I started learning Sage a couple of weeks ago and I'm working on getting output which I can copy/paste into LaTeX. I've got the general idea but I have to tweek things to get it how I really want it, and it's still very time consuming to typeset…
j0equ1nn
  • 3,429
0
votes
1 answer

hasse diagram of a subset of a poset in sage

E = {1,2,3} P = SetPartitions(E) This gives the set of all partitions of E,. I have a subset Q of P and I want to construct the directed graph whose vertex set is this set Q and we draw an arrow from p to q in this graph if q covers p. How to…
GA316
  • 4,324
  • 27
  • 50
0
votes
1 answer

putting a sage program inside a loop with out modifying the indentation

I have written a simple program on sage, in which I will define a graph G at the beginning , and the program will return a matrix. now I want the program to return all such matrices corresponds to all trees of order 5. So basically I want to iterate…
GA316
  • 4,324
  • 27
  • 50