AUTHORS:
Calculate the Voronoi cell of the lattice defined by basis
INPUT:
OUTPUT:
A :class:Polyhedron instance.
EXAMPLES:
sage: from sage.modules.diamond_cutting import calculate_voronoi_cell
sage: V = calculate_voronoi_cell(matrix([[1, 0], [0, 1]]))
sage: V.volume()
1
Perform diamond cutting on polyhedron V with basis matrix GM and radius C.
INPUT:
OUTPUT:
A :class:Polyhedron instance.
EXAMPLES:
sage: from sage.modules.diamond_cutting import diamond_cut
sage: V = Polyhedron([[0], [2]])
sage: GM = matrix([2])
sage: V = diamond_cut(V, GM, 4)
sage: V.vertices()
(A vertex at (2), A vertex at (0))
Compute the upper-triangular part of the Cholesky/Jacobi decomposition of the symmetric matrix M.
Let be a symmetric
-matrix over a field
.
Let
denote the
-th entry of
for any
and
. Then, the
upper-triangular part computed by this method is the
upper-triangular
-matrix
whose
-th entry
satisfies
for all and
. (These
equalities determine the entries of
uniquely by
recursion.) This matrix
is defined for all
in a
certain Zariski-dense open subset of the set of all
-matrices.
EXAMPLES:
sage: from sage.modules.diamond_cutting import jacobi
sage: jacobi(identity_matrix(3) * 4)
[4 0 0]
[0 4 0]
[0 0 4]
sage: def testall(M):
....: Q = jacobi(M)
....: for j in range(3):
....: for i in range(j):
....: if Q[i,j] * Q[i,i] != M[i,j] - sum(Q[r,i] * Q[r,j] * Q[r,r] for r in range(i)):
....: return False
....: for i in range(3):
....: if Q[i,i] != M[i,i] - sum(Q[r,i] ** 2 * Q[r,r] for r in range(i)):
....: return False
....: for j in range(i):
....: if Q[i,j] != 0:
....: return False
....: return True
sage: M = Matrix(QQ, [[8,1,5], [1,6,0], [5,0,3]])
sage: Q = jacobi(M); Q
[ 8 1/8 5/8]
[ 0 47/8 -5/47]
[ 0 0 -9/47]
sage: testall(M)
True
sage: M = Matrix(QQ, [[3,6,-1,7],[6,9,8,5],[-1,8,2,4],[7,5,4,0]])
sage: testall(M)
True
Return the inequality for points on the same side as the origin with respect to the plane through v normal to v.
EXAMPLES:
sage: from sage.modules.diamond_cutting import plane_inequality
sage: ieq = plane_inequality([1, -1]); ieq
[2, -1, 1]
sage: ieq[0] + vector(ieq[1:]) * vector([1, -1])
0