Sage
SAGE
Sage Quick Reference by William Stein (March 2009) - quickref.pdf download (and the source quickref.tar.bz2)
Sage Linear Algebra Quick Reference by Robert A. Beezer (December 2011, Sage 4.8) - quickref-linalg.pdf download (source quickref-linalg.tex)
Sage Elementary Number Theory Quick Reference by William Stein (April 2009) - quickref-nt.pdf download (and the source quickref-nt.tar.bz2)
Sage Calculus Quick Reference by William Stein (April 2009) - quickref-calc.pdf download (and the source quickref-calc.tar.bz2)
Basic Math by Peter Jipsen, version 1.1 (January 2008) - sage-quickref.pdf download (and the source sage-quickref.tex)
Graph Theory by Steven Rafael Turner, version 4.7 (July 2011) - quickref-graphtheory.pdf download (and the source quickref-graphtheory.tex)
Abstract Algebra by B. Balof, T. W. Judson, D. Perkinson, R. Potluri, version 1.0 (June 2012) - quickref-algebra.pdf download (and the source quickref-algebra.tar.bz2)
Dynamical Systems by B. Hutz and J. Silverman, version 1.0 (Auguts 2016) - dynamics_ref.pdf download (and the source download).
9.Constructing Small groups: See here.
10.Filter on graph database: Sometimes you need to query something on the database of small graphs.
from itertools import ifilter
f = lambda g: g."filter1" and not g."filter2"
for g in ifilter(f, graphs(6)):
print(g)
Or you can use the following command:
import six
f = lambda g: g."filter1" and not g."filter2"
for g in six.moves.filter(f, graphs(6)):
print(g)
Or you can use the following command:
from sage.graphs.connectivity import is_connected
Q = GraphQuery(display_cols=['graph6'], num_vertices=9)
for g in Q:
if is_connected(g) and g.is_vertex_transitive():
print(diameter(g, algorithm='standard'))
Or you can use the following command:
for g in graphs(6):
if is_connected(g) and g.is_vertex_transitive():
11.Multiplicities of Eigenvalues:
For algebraic multiplicities, you can use the following command:
sage: G.charpoly().roots(AA, multiplicities=True)
sage: A = G.am()
sage: for (l, E) in A.right_eigenspaces():
print('Eigenvalue', l, 'geometric multiplicity', E.dimension())
12.graph6 <--> sage format:
with the following command you can convert your graph in the sage format to graph6 format.
sage: your_graph.graph6_string()
Also for digraphs with digraph6.
sage: your_graph.dig6_string()
Conversely convert graph6 format to sage format
sage: d6 = "C?"
sage: G = Graph(d6, format='graph6')
Also for digraphs with digraph6.
sage: d6 = "C?"
sage: G = DiGraph(d6, format='dig6')
13.Creating .sage file: In Jupyter Notebook, the click on "New" pop-down menu.
Then select "Text File" and name it with the extension .sage .
14.Run your sage program from your command line: Let us call your file "test.sage".
sage:test.sage
15.Time execution:
from datetime import datetime
start_time = datetime.now()
# your code here
end_time = datetime.now()
print('Duration: {}'.format(end_time - start_time))
16. Launch Sage Notebook from Terminal:
sage: -n jupyter
17. The group id database:
sage:G.group_id() .all_subgroups()
18. All subgroups of a group:
sage:G.all_subgroups()
sage:G.conjugacy_classes_subgroups()
19. Cayley graphs:
sage:G = SymmetricGroup(4)
sage:G.cayley_graph(generators=[(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)])