Sharedwww / talks / 2006-05-09-sage-digipen / 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
7
f = maxima('x*sin(x)^2').integral('x'); f # calculus
8
9
maple.eval('solve({ 2*x + 3*y = 1, 3*x + 5*y = 1 })')
10
11
A = MatrixSpace(QQ,3)([1,2,3, 4,5,6, 8,10,12]); A
12
A.charpoly().factor()
13
V = QQ^3
14
E = End(V); t = E(A); t
15
print latex(A)
16
17
18
P.<x,y,z,w> = ProjectiveSpace(3,QQ)
19
C = P.subscheme([y^2-x*z, z^2-y*w, x*w-y*z])
20
len(C.irreducible_components()) # twisted cubic
21
J = C.defining_ideal()
22
G = J.groebner_fan()
23
len(G.reduced_groebner_bases())
24
G.fvector()
25
26
27
f = prod(J.gens()) # \/-- newton polytope
28
NP = polymake.convex_hull(f.exponents())
29
NP.facets()
30
31
32
R.<t> = PowerSeriesRing(QQ, 't')
33
f = 1/(1-t)
34
f
35
print latex(f)
36
view(f)
37
38
39
E = EllipticCurve('37a')
40
v = E.Lseries_values_along_line(1, 1+10*I, 300)
41
w = [(z[1].real(), z[1].imag()) for z in v]
42
L = line(w, rgbcolor=(0.5,0,0))
43
L.show()
44
45
V = VectorSpace(QQ, 5)
46
W = V.submodule([[1,2,3,4,5],[2,3,4,5,3]]); W
47
W.save('W')
48
load('W')
49