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
11
votes
1 answer

Simplify function in Sage

In Sage, simplify(x/(x^2 + x)) gives x/(x^2 + x) I would instead expect to get 1/(x + 1) Is there a way to achieve that?
Ystar
  • 2,866
6
votes
1 answer

Create Graph In Sage

I want define new graph in sage. Let $V$ be vector space over finite field $GF(q)$. The graph's vertices are 1-dimensional subspace from $V$ and $n-1$ -dimensional subspace from $V$ and two vertices are adjacent if and only if direct sum of two…
Bobby
  • 7,396
4
votes
1 answer

Defining a function in Sage

How do I define the following function in Sage and compute some values? The function is $$P(n) = \sqrt{\frac{e^{-h}h^n}{n!}},$$ where $h$ is a real variable and $n$ is a nonnegative integer. I want to see the values of $P(n)$ for $h = 20$ from $n =…
3
votes
1 answer

Drawing fundamental domains with sage

What is the easiest way to draw fundamental domains for congruence subgroups of $SL_2(\mathbb{Z})$ in sage?
user360730
3
votes
3 answers

"unable to simplify to float approximation" error in Sage on calling a function

I have following python code in Sage: %python import math T = 2.0 * math.pi a = 1.0 / 4.0 def SumT(t, n): global T global a sum = 0 if n < 0: return 0 else: for i in range (1, n+1): sum = sum + (…
irina
  • 61
3
votes
1 answer

How to draw a Frenet Trihedron in Sage?

How would I draw this in sage? It's a Frenet Trihedron along a given curve: Tools other then Sage are welcome too. Im just interested in which equations I need to input, besides the curve to obtain the animation.
Tool
  • 431
  • 2
  • 6
  • 15
3
votes
3 answers

How to load and use a PARI/GP script in Sage notebook?

I don't know whether this is the correct place to ask such a question, but I am dealing with this problem for a couple of days. Take for example the script http://math.stanford.edu/~stange/scripts/tate_via_nets.gp. What I do…
Nadori
  • 867
2
votes
1 answer

Variables in Sage with many indices and with negative indices.

I need to define some variables in Sage with 2 indices and the second index is negative. For example, Y[2, -6]. I know how to define variables with one index: rank=8 R=PolynomialRing(QQ, 'a' ,rank+1) a=R.gens() Edit: I tried the following…
LJR
  • 14,520
2
votes
1 answer

Assumption seems to break Sage's integrate() function; is this a bug?

Consider the following Sage code (tested using Sage 8.6): var('t') var('a') t.integrate(t, 0, a) # \int_{0}^{a} t dt Output (as expected): t a 1/2*a^2 Next: t.integrate(t, 0, 2*a - a^2) # 2*a - a^2 could be positive, negative, non-real(?) Output…
mathmandan
  • 2,014
2
votes
1 answer

Define the ring of integers of a number field in sage.

I am new to sage and I searched the documentation, but could not find an answer for defining the ring of integers. n = 7777 d = next_prime(n) K. = NumberField(x^2-d) Now I want to define the ring of integers of the numberfield $K$. Is there a…
user408858
  • 2,463
  • 12
  • 28
2
votes
1 answer

in SAGE, how to convert a permutation into coxeter-generators (simple reflections)?

For example: for the permutation $[6,3,2,4,1,5]$, we know that $[6,3,2,4,1,5]=(56)(45)(34)(23)(12)(23)(34)(45)(23)$ For Weyl Group of A5, that is $s_5*s_4*s_3*s_2*s_1*s_2*s_3*s_4*s_2$, My question is: are there any existed codes to convert any…
2
votes
1 answer

Sagemath :Replace an expression in a formula by a function define previously

I have defined a function F by $F(x)=(f(x)+h)/g(x)$ where $f, g$ are functions and $h$ a variable. Suppose that I write $f(x)+h$, how can i ask to sagemath to use F in the result: $F(x)*g(x)$ Thanks
2
votes
1 answer

Sage problem - numeric solving trigonometric equation

I am relatively new to Sage. Can someone please help me how to solve: $$ \tan (x) - x/10 = 0$$ numerically?
1
vote
1 answer

labels used in SAGE for automorphisms of graphs

When I create a graph in SAGE and then look at its automorphism group, the permutation group obtained acts on points $1,\ldots, n$ (where $n$ is the number of vertices of the graph), but it is not clear to me what the correspondence is between the…
AG.
  • 2,027
1
vote
1 answer

Singular and Sage Grobner bases

Does the function grobner_basis in Sage (which I think comes from the implementation in Singular) compute a reduced Grobner base for an ideal? Or is it just a Grobner base with no special property ?
johnyy
  • 31
1
2 3 4 5