// EXAMPLE: Quaternion algebra over QQ of discriminant 6.
B := QuaternionAlgebra(6);
B;
StandardForm(B);
B := QuaternionAlgebra(6 : Al := "Smallest");
StandardForm(B);
O := MaximalOrder(B);
Discriminant(O);
G := FuchsianGroup(O);
time FDH := FundamentalDomain(G);
FDH;
// Algorithm for displaying hyperbolic polygons due to Verrill.
DisplayPolygons(FDH, "./quat6.ps");

FD := FundamentalDomain(G, UnitDisc());
ArithmeticVolume(FD);
ArithmeticVolume(G);
Signature(G);
U, m := Group(G);
U;
m;
m(U.1);
Type(m(U.1));
gamma1 := Quaternion(m(U.1));
gamma1^2;

// EXAMPLE: (2,3,7) triangle group.
K<z> := CyclotomicField(7);
F<b> := sub<K | z+1/z>;
Z_F := MaximalOrder(F);
Foo := RealPlaces(F);
B := QuaternionAlgebra(ideal<Z_F | 1>, Foo[2..3]);
StandardForm(B);
B<i,j,k> := QuaternionAlgebra<F | b, b>;
O := MaximalOrder(B);
Discriminant(O);
G := FuchsianGroup(O);
FDH := FundamentalDomain(G);
DisplayPolygons(FDH, "./quat237triang.ps");

Group(G);

// EXAMPLE: With verbose
K<z> := CyclotomicField(13);
F := [F : F in Subfields(K) | Degree(F[1]) eq 3][1][1];
F;
Discriminant(MaximalOrder(F));

_<x> := PolynomialRing(Rationals());
F<b> := NumberField(x^3+4*x^2+x-1);
Z_F := MaximalOrder(F);

B<alpha,beta> := QuaternionAlgebra<F | -1,b>;
Discriminant(B);
Omax := MaximalOrder(B);
p := ideal<Z_F | b+2>;
O := Order(Omax, p);
Discriminant(O);
PseudoBasis(O);

O := Order([(2+b)*alpha,(b^2+(b+4)*alpha+beta)/2,(b+(b^2+4)*alpha+alpha*beta)/2]);
Discriminant(O);
Discriminant(O) eq p;

G := FuchsianGroup(O);
SetVerbose("Shimura", 3);
FD := FundamentalDomain(G, UnitDisc());
