Sharedwww / talks / 2006-05-04-sage-uw-intro / ex.sageOpen in CoCalc
Author: William A. Stein
1
mathematica('N[Gamma[Pi + I]]') # optional
2
G = mathematica('Plot3D[Sin[x]*Cos[y],{x,2,10},{y,2,10}]');
3
_ = G.show()
4
gp.zeta(2) # number theory
5
gp.factor(2006)
6
f = maxima('x*sin(x)^2').integral('x'); f # calculus
7
maple.eval('solve({ 2*x + 3*y = 1, 3*x + 5*y = 1 })')
8
A = MatrixSpace(QQ,3)([1,2,3, 4,5,6, 8,10,12]); A
9
A.charpoly().factor()
10
V = QQ^3
11
E = End(V); t = E(A); t
12
print latex(A)
13
P.<x,y,z,w> = ProjectiveSpace(3,QQ)
14
C = P.subscheme([y^2-x*z, z^2-y*w, x*w-y*z])
15
len(C.irreducible_components()) # twisted cubic
16
J = C.defining_ideal()
17
G = J.groebner_fan()
18
len(G.reduced_groebner_bases())
19
G.fvector()
20
f = prod(J.gens()) # \/-- newton polytope
21
NP = polymake.convex_hull(f.exponents())
22
NP.facets()
23
R.<t> = PowerSeriesRing(QQ, 't')
24
f = 1/(1-t)
25
f
26
print latex(f)
27
view(f)
28
E = EllipticCurve('37a')
29
v = E.Lseries_values_along_line(1, 1+10*I, 300)
30
w = [(z[1].real(), z[1].imag()) for z in v]
31
L = line(w, rgbcolor=(0.5,0,0))
32
L.save('line.png')
33
V = VectorSpace(QQ, 5)
34
W = V.submodule([[1,2,3,4,5],[2,3,4,5,3]]); W
35
W.save('W')
36
load('W')
37