To start snap, type "snap". 

> geometry> snap
> pari initialized
> snap 1.7
> 1. :

First we read a cusped manifold from the Hildebrand-Weeks census. The
command "read census" may be abbreviated to "r c". The prompt is
changed to reflect the current manifold. 

The reason for the "1." is that snap can store up to 10 manifolds at a
time and can switch between them, making any one of them the current
manifold. This is only really necessary when we use commands which
involve more than one manifold, such as the "isometry" command. None of
these commands are discussed here, so the prompt will start with a
"1."  throughout.

> 1. : r c 5 304 
> 1. m304(,):

The help command prints a short help message for each snap command. 

> 1. m304(,): h r c
> 
> . read census <census> <number>
> . read file <filename>
> 
> Either read a census manifold or a manifold file. Eg. "r c 5 4" reads
> m004, manifold number four in the census of cusped manifolds having up
> to five tetrahedra. The search path used for the compressed (terse)
> census files (trs5, trs6, trs7), and for manifold files is printed by
> the command "print settings".

To see a full list of commands use the "menu" command. Multi-word
commands are shown by indentation. 

> 1. m304(,): menu
> ?
> help
> manifold
> menu
> list
> read
>   file
>   census
> clear
>   manifold
>   surgery
>   isometries
> quit
> print
>   settings
>   manifold
>   volume
>   chern_simons
....

If you just want to know what commands start "print" (say), type
"print <RETURN>" and you will be prompted with all the possible
continuations. Type return again to get back to the original prompt. 

> 1. m304(,): p
> print (settings manifold volume chern_simons geodesics ortholines fields arithmetic invariants cusp eigenvalue_fields holonomies solution_type shapes log_shapes histories tetrahedra domain cscorrection gluing_matrix filled_gluing_matrix flattening full_equations eta isometries) ?
> 1. m304(,): 

Next we do Dehn filling using the "surgery" command. This gives us a
manifold in the Hodgson-Weeks census of low-volume closed
manifolds. "print volume" prints the volume as computed by SnapPea. If
greater accuracy is required you can use the command "accurate
volume". This computes the shapes of the ideal tetrahedra of the
manifold to the current precision (default 50 significant digits) and
uses Pari functions to complete the volume computation. Although the
internal precision is 50, only 28 digits are printed. You can change
this using the "set digits_printed" command. 

> 1. m304(,): su 5 1
> solution type: geometric
> 1. m304(5,1): p vol
> Volume is: 3.663862376708876
> Estimated precision: 11 digits
> 1. m304(5,1): acc vol
> Volume is: 3.663862376708876060218414059

Let us now compute a couple of the number fields associated with the
manifold. The invariant trace field is well known; the shape field is
the field generated by the tetrahedral shape parameters of the ideal
triangulation of the manifold. These commands can take a while, and
are by no means guaranteed to succeed. Changing the maximum degree
("set degree") and internal precision ("set precision") may
help. Details of this are given in the paper "Computing arithmetic
invariants of 3-manifolds." 

On returning the "compute" function prints a defining polynomial for
the field, ie. a polynomial one of whose roots generates the field in
question. Next comes the signature of the field, which is the number
of real places of the field followed by the number of complex places.
Then the discriminant of the field. The signature and discriminant of
a field in many cases serve to identify it uniquely. Finally a root is
specified. The roots are numbered in such a way that roots with
negative imaginary part have negative numbers and the rest, positive.
The polynomial and root are carefully chosen so as to always coincide
for identical fields. (Isomorphic fields will always have the same
polynomial.)

> 1. m304(5,1): co inv
> Invariant trace field: x^2 + 1 [0, 1] -4 R(1) = 0.000000 + 1.00000*I
> 1. m304(5,1): co sh
> Shape field: x^4 - 2*x^3 + 2 [0, 2] 320 R(-1) = -0.529085 - 0.742934*I

When snap computes the shape field it also computes exact expressions
(in terms of the primitive element) for the tetrahedral shape
parameters. SnapPea finds hyperbolic structures by finding shapes
which solve the so-called gluing equations. Snap can go one step
further by checking that the gluing equations are solved exactly, by
doing exact arithmetic in the shape field. The "verify exact" command
carries out this verification. As a "sanity" check it prints both
numeric and exact shape parameters along with the difference between
the numeric shapes and the exact ones with the primitive element
substituted in (after each exact shape). Each equation states that a
product of (certain rational functions of) the shapes equals one. Also
the numeric value of each corresponding logarithmic gluing equation is
printed, since a solution of the gluing equations could fail to be a
solution of the logarithmic gluing equations by a multiple of 2*Pi*I.

> 1. m304(5,1): ver ex 
> Shapes (Numeric)
> shape(0) = 0.2354572431821269374195047381 + 0.1285329320608385804542840310*I
> shape(1) = 1.000000000000000000000000000 + 1.000000000000000000000000000*I
> shape(2) = 1.000000000000000000000000000 + 1.000000000000000000000000000*I
> shape(3) = 1.000000000000000000000000000 + 1.000000000000000000000000000*I
> shape(4) = 1.264542756817873062580495261 + 0.3714670679391614195457159689*I
> 
> Shape Field
> min poly: x^4 - 2*x^3 + 2
> root number: -1
> root: -0.5290855136357461251609905238 - 0.7429341358783228390914319379*I
> 
> Shapes (Exact)
> shape(0) = -1/2*x^3 + 1/2*x^2 + 1/2*x + 1 1.37853 E-67
> shape(1) = -x^3 + x^2 + 2 2.67474 E-67
> shape(2) = -x^3 + x^2 + 2 5.98091 E-67
> shape(3) = -x^3 + x^2 + 2 3.70920 E-68
> shape(4) = -1/2*x + 1 1.29822 E-67
> 
> Gluing Equations
> Filling curves:
> 2, -6, -10, -2, 0; -4, 10, 4, 0, -10; 4 -> 1 : 0.E-56
> Edges:
> 2, 2, 2, 2, 2; 0, 0, 0, 0, 0; -2 -> 1 : 0.E-57
> 0, -1, 0, -2, 0; -1, 1, 0, 1, -1; 1 -> 1 : 0.E-57
> -1, 0, 0, 0, -1; 1, -2, 0, 0, 1; 0 -> 1 : 1.85460 E-67
> -1, 0, 0, 0, -1; 1, 0, -1, -1, 1; 0 -> 1 : 1.85460 E-67
> 0, -1, -2, 0, 0; -1, 1, 1, 0, -1; 1 -> 1 : 0.E-57
> Verification OK

"Print invariants" prints most of the 3-manifold invariants which snap
knows about. Note that it needs to know the invariant trace field to
print everything from that line down, and it needs to know the shape
field too if the Borel regulator is to be computed. If neither of these
are known it simply prints accurate versions of the volume and
Chern-Simons invariant. The invariant trace field and invariant
quaternion algebra are commensurability invariants of the 3-manifold,
complete if the manifold is arithmetic. While the quaternion algebra
is determined by its Hilbert symbol, there is no obvious canonical
choice we can make for this. Fortunately quaternion algebras over a
number field are classified by the set of real and finite places where
they are ramified. This is explained further in the above mentioned
paper. 

The Borel regulator is a complete "cut and paste" invariant. One entry
is always the volume of the manifold. Each entry (when there is more
than one) comes from one complex place of the invariant trace field
(however the only convenient way to compute it involves using the
shape field.)

> 1. m304(5,1): p inv
> Volume: 3.663862376708876060218414059
> Chern-Simons: -0.1666666666666666666666666666
> Invariant trace field: x^2 + 1 [0, 1] -4 R(1) = 0.000000 + 1.00000*I
> Invariant quaternion algebra:
> Hilbert Symbol: (-2*x - 4, -9*x - 3)
> Real ramification: []
> Finite ramification: 
> [2, [1, 1]~, 2, 1, [1, 1]~]
> [3, [3, 0]~, 1, 2, [1, 0]~]
> Integer traces: YES
> Arithmetic: YES
> Borel Regulator: [3.663862376708876060218414059]

Closely related to the Chern-Simons invariant is the eta invariant:
modulo rescaling it is a real-valued extension of the former. Snap has
a bunch of functions for computing eta invariants using a surgery
formula and surgery relations between manifolds. Snap has some
precomputed numbers (in ../data/eta_fudges) which enable it to find
the eta invariants of Dehn fillings of most of the cusped census
manifolds. (Eta invariants of cusped manifolds can also be computed
but they depend on a choice of peripheral curves.)

> 1. m304(5,1): p eta inv
> Eta invariant: 0.5555555555555555555555555555
> 3*eta - 2*CS: 2.000000000000000000000000000

"Print manifold" is a slight misnomer. What it really prints are the
numbers which snap uses to compute the various fields in knows
about. Once these fields have been computed the numbers are printed as
exact expressions in terms of the primitive element of the relevant
field, rather than numerically. 

> 1. m304(5,1): p m
> Fundamental group generators
> g0 = [-0.181773+-1.081227*i, -1.424787+3.051333*i; -0.181773+0.332987*i, 0.888880+0.374120*i; 1]
> g1 = [-0.085121+1.427001*i, -0.564993+-1.833918*i; 1.020083+0.735234*i, -1.670197+-1.142152*i; 1]
> 
> Tetrahedron shapes
> shape(0) = Mod(-1/2*x^3 + 1/2*x^2 + 1/2*x + 1, x^4 - 2*x^3 + 2)
> shape(1) = Mod(-x^3 + x^2 + 2, x^4 - 2*x^3 + 2)
> shape(2) = Mod(-x^3 + x^2 + 2, x^4 - 2*x^3 + 2)
> shape(3) = Mod(-x^3 + x^2 + 2, x^4 - 2*x^3 + 2)
> shape(4) = Mod(-1/2*x + 1, x^4 - 2*x^3 + 2)
> 
> Traces
> tr(g0) = 0.7071067811865475244008443621 - 0.7071067811865475244008443621*I
> tr(g1) = 1.755317301824427886249087176 - 0.2848487845931410429465454123*I
> tr(g0g1) = 2.482393534508253454011085893 - 0.4028370143971123863027086397*I
> 
> Invariant trace field generators
> tr(g0^2) = Mod(-x - 2, x^2 + 1)
> tr(g1^2) = Mod(-x + 1, x^2 + 1)
> tr(g0^2g1^2) = Mod(-2*x + 1, x^2 + 1)

Thus, if we compute the trace field and then print the manifold
again.. 

> 1. m304(5,1): co tr
> Trace field: x^8 - 4*x^7 + 16*x^6 - 32*x^5 + 54*x^4 - 56*x^3 + 44*x^2 - 16*x + 2 [0, 4] 104857600 R(-1) = 0.298581 - 0.0340899*I

> 1. m304(5,1): p m

...

> Traces
> tr(g0) = Mod(19/15*x^7 - 14/3*x^6 + 284/15*x^5 - 174/5*x^4 + 878/15*x^3 - 797/15*x^2 + 598/15*x - 39/5, x^8 - 4*x^7 + 16*x^6 - 32*x^5 + 54*x^4 - 56*x^3 + 44*x^2 - 16*x + 2)
> tr(g1) = Mod(2/3*x^7 - 8/3*x^6 + 31/3*x^5 - 20*x^4 + 94/3*x^3 - 85/3*x^2 + 56/3*x - 2, x^8 - 4*x^7 + 16*x^6 - 32*x^5 + 54*x^4 - 56*x^3 + 44*x^2 - 16*x + 2)
> tr(g0g1) = Mod(4/5*x^7 - 7/3*x^6 + 152/15*x^5 - 226/15*x^4 + 138/5*x^3 - 316/15*x^2 + 274/15*x - 26/15, x^8 - 4*x^7 + 16*x^6 - 32*x^5 + 54*x^4 - 56*x^3 + 44*x^2 - 16*x + 2)
> 

To remind ourselves of all the fields snap knows about for this
manifold, "print fields". 

> 1. m304(5,1): p fi
> Invariant trace field
> x^2 + 1 [0, 1] -4 R(1) = 0.000000 + 1.00000*I
> Trace field
> x^8 - 4*x^7 + 16*x^6 - 32*x^5 + 54*x^4 - 56*x^3 + 44*x^2 - 16*x + 2 [0, 4] 104857600 R(-1) = 0.298581 - 0.0340899*I
> Shape field
> x^4 - 2*x^3 + 2 [0, 2] 320 R(-1) = -0.529085 - 0.742934*I

Snap has a lot of settings which can be changed to get printout in
different formats. "Print settings" shows us what we're currently
using. 

> 1. m304(5,1): p set
> Stack space available in MB: 4.95 of 5.00
> Significant digits printed: 28
> Show hilbert symbol factorization/embeddings: no/no
> Vertex epsilon for Dirichlet domain computation: 1e-07
> Precision in decimal digits: 50
> Maximum degree of polynomials: 16
> Fraction of significant digits to use in LLL: 0.60
> Canonical poly mode: 2
> Path: . /home/geometry/work1/oag/Snap/data /home/geometry/work1/oag/Snap/data/manifolds
> Show Chern-Simons diagnostic: no
> Field print style is: short
> Show field computation is: off

"Toggle field_print_style" switches us between printing fields in
short or long format. Most of the other settings respond to a "set .."
command. (It is currently not possible to change the pari stack size
without recompiling snap.) 

The long format for printing fields gives the prime factorization of
the discriminant and information about the ring of integers. 

> 1. m304(5,1): to fi
> 1. m304(5,1): p fie
> Invariant trace field
> canonical minumum polynomial: x^2 + 1
> canonical root number: 1
> numerical value of root: 0.E-96 + 1.000000000000000*I
> signature: [0, 1]
> discriminant: -4
> factors: [-1, 1; 2, 2]
> index of ring of integers: 1
> basis for ring of integers: [1, x]
> 
> Trace field
> canonical minumum polynomial: x^8 - 4*x^7 + 16*x^6 - 32*x^5 + 54*x^4 - 56*x^3 + 44*x^2 - 16*x + 2
> canonical root number: -1
> numerical value of root: 0.2985814928014438 - 0.03408998606757920*I
> signature: [0, 4]
> discriminant: 104857600
> factors: [2, 22; 5, 2]
> index of ring of integers: 45
> basis for ring of integers: [1, x, x^2, x^3, x^4, x^5, 1/3*x^6 - 1/3*x^5 - 1/3*x^4 - 1/3*x^2 + 1/3*x + 1/3, 1/15*x^7 + 1/15*x^5 + 2/15*x^4 + 2/15*x^3 - 1/5*x^2 + 2/15*x + 7/15]
> 
> Shape field
> canonical minumum polynomial: x^4 - 2*x^3 + 2
> canonical root number: -1
> numerical value of root: -0.5290855136357461 - 0.7429341358783228*I
> signature: [0, 2]
> discriminant: 320
> factors: [2, 6; 5, 1]
> index of ring of integers: 1
> basis for ring of integers: [1, x, x^2, x^3]
> 

Finally, we look at a couple of invariants particular to cusped
manifolds. If fields have previously been saved ("save fields") the
"load_fields" command will be quicker than "compute ..". Pre-computed
fields are supplied (in the files "cusped.fields" and "closed.fields")
for many of the manifolds in the cusped and closed censi.

> 1. : r c 6 448
> 1. s448(,): lo
> Invariant trace field
> x^3 - x^2 + x + 1 [1, 1] -44 R(-2) = 0.771844 - 1.11514*I
> Trace field
> x^6 - 2*x^4 + 2*x^2 - 2 [2, 2] 247808 R(-3) = -0.826559 - 0.674569*I
> Shape field
> x^3 - x^2 + x + 1 [1, 1] -44 R(-2) = 0.771844 - 1.11514*I
> 1. s448(,): 

For cusped manifolds, the set of fields generated by the cusp shapes
(called here cusp fields), is a commensurability invariant. The cusp
fields are all subfields of the invariant trace field, which coincides
with the shape field in the cusped case. In pretty much all the low
degree cases the cusp fields are all equal to the invariant trace
field. 

> 1. s448(,): co cu
> Cusp 1 field: x^3 - x^2 + x + 1 [1, 1] -44 R(-2) = 0.771844 - 1.11514*I

A more sensitive commensurability invariant for the 1-cusped case is the
cusp density. This is the fraction of the volume of the manifold
occupied by a horoball centered at the cusp which is expanded until it
first becomes tangent to itself in the manifold. (This is computed by
SnapPea in ordinary machine-precision arithmetic.)

> 1. s448(,): p cu de
> Cusp density: 0.6521611145751026

Note that the quaternion algebra of a cusped manifold is always
completely unramified, and therefore just the matrix algebra over the
invariant trace field. "Print arithmetic" bypasses the printing of
volume and Chern-Simons invariant in "print invariants". 

> 1. s448(,): p ari
> Invariant trace field: x^3 - x^2 + x + 1 [1, 1] -44 R(-2) = 0.771844 - 1.11514*I
> Invariant quaternion algebra:
> Hilbert Symbol: (-3/2*x^2 - 1/2*x - 2, -5*x^2 - 14*x - 6)
> Real ramification: []
> Finite ramification: none
> Integer traces: NO
> Arithmetic: NO
> Borel Regulator: [4.765939917900488964530741437]

"Quit" or ^D (control-D) gets you out of snap, no questions asked! 

> 1. s448(,): q
> geometry> 

If you want to know more about what snap can do, have a browse through
"snap_help" and read the paper "Computing arithmetic invariants of
3-manifolds." 
