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
1
vote
1 answer

How can I get Sagemath to simplify the following?

I am new to sage. If I provide the following instructions to sagemath x, y = var('x,y') E = function('E')(x,y) F = function('F')(x,y) G = function('G')(x,y) s = function('s')(x,y) firstX = E^(-1/2) * diff(s,x) (E^(-1/2) * diff(firstX,x)) it…
1
vote
0 answers

Computing PARI Group ID in Sage

I am hoping to compute the PARI Group ID for (1) a group and (2) a semi direct group constructor in Sage: (1) G = PermutationGroup([(1, 3, 2)], [(2, 3, 4)], [(1, 2, 4)]) K = G.as_finitely_presented_group() (2) Z/NZ x Z/NZ semi direct Z/MZ
Ebenezer
  • 11
  • 1
1
vote
1 answer

p part of a group in Sagemath

I am new to Sagemath, so apologies if this is trivial. Is there any command to calculate the p-part of any group ? (finite/infinite, abelian/non-abelian). In particular, I am interested in the p-part of the class group. I found the command…
fhn
  • 1,097
1
vote
0 answers

Simplify function numerically in Sage

When I have a function that is exact, such as: x = var("x") fnc = sqrt(2) * x print(fnc) And I want to resolve/approximate all those parts of the function which can be resolved numerically, how can I do this? fnc.n() does not work because it…
1
vote
1 answer

How can I search for a certain object in Sage?

If I’m reading a paper and I want to try to rewrite the content in a math programming language like Sage, I’d like to search from within Sage for objects they have corresponding to a certain name, like “homological invariant”. It would be cool if…
1
vote
2 answers

How to take indices and name of a variable in Sage?

I define the following in Sage. rank=8 R=PolynomialRing(QQ, 'a' ,rank+1) a=R.gens() I would like to define a function f which returns the index of a[3]: f(a[3])=3 and define another function g such that g(a[3])=a. How to do this in Sage? Thank you…
LJR
  • 14,520
1
vote
0 answers

Beginner question SageMath: maximum-minimum identity

I am a complete beginner to SageMath. I was wondering how I could recreate the maximum-minimum identity using it. Any idea?
Cesare
  • 346
1
vote
1 answer

Convolving two functions doesn't work as expected in sage

I'm trying to convolve two functions as follows: forget() x = PolynomialRing(QQ, 'x').gen() f1 = Piecewise([[(-1, 1), 1*x^0]]) f2 = Piecewise([[(0, 1), x], [(1, 2), -x + 2]]) g = f2.convolution(f1) Q = g.plot(rgbcolor=(1,1,0), figsize = 4); g I get…
1
vote
1 answer

Help with sage math defining function of two variables

Hello I need help regarding sage math, since I cant find anything about it on the manuals. So I have a function of the form $F(r,t) = 2r H(t)$ and then i want to perform an operation on it involving differentiation. H(t) is kept arbitrary. I know…
jboy
  • 173
1
vote
1 answer

SageMath curve from Weierstrass normal form cubic over finite field

I have a cubic equation that I think represents a valid Weierstrass normal form in SageMath. K = GF(19) cubic = z*y^2 - 4*x^3 - 11*z^2*x - 5*z^3 R. = K[] f = EllipticCurve_from_cubic(cubic, [0,9,1], morphism = True) f Scheme morphism: …
quietkid
  • 151
1
vote
2 answers

Using sage to plot 3d region

Say I want to plot $$E_1 = \{(x,y,z)\in\mathbb{R}^3\mid 0\le z\le 1-y, \sqrt{x}\le y\le 1, 0\le x \le 1\}$$ or $$E_2 = \{(x,y,z)\in\mathbb{R}^3\mid 0\le z\le \sqrt{9-y^2}, {3x}\le y\le 3, 0\le x \le 1\}. $$ Is it possible to accomplish this in…
user346096
  • 1,068
1
vote
1 answer

How to convert a list to a set in sagemath?

I am trying to convert a list to a set in sagemath 8.2 H = Set(range(1,n+1)) [1, 2, 3, 4] L=Combinations(H,2).list() [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]] Now, I would like to use SetPartitions but L is a list. How can I convert this…
MathNew C
  • 109
  • 5
1
vote
1 answer

Shortest presentation of a permutation using generators

A question in sagemath: Let $S$ be a set of generators of a permutation group $H\subseteq S_n$ and let $\pi$ be an element in $H$. Is there a way in sage to find the shortest words in the letters $S$ equal to $\pi$?
1
vote
0 answers

Finding all maximally-matchable edges in a bipartite grah sage

Has anyone coded of the algorithm given by Tassa, Tamir. "Finding all maximally-matchable edges in a bipartite graph." Theoretical Computer Science 423 (2012): 50-58 in Sage ?
1
vote
1 answer

Sage--use spkg coxeter3 in Sage notebook

I want to use the well-known coxeter3 package (http://math.univ-lyon1.fr/~ducloux/coxeter/coxeter3/english/coxeter3_e.html) in sage-notebook. I've tried 'i' and 'f' but doesn't work, so far I couldn't find a 'good' answer online. How to install the…