Exemplo n.º 1
0
    def jacobian(self):
        s = len(self.mcomplex.Edges)
        result = matrix(self.vertex_gram_matrices[0].base_ring(), s, s)

        for tet in self.mcomplex.Tetrahedra:
            cofactor_matrices = _cofactor_matrices_for_submatrices(
                self.vertex_gram_matrices[tet.Index])
            vga = self.vertex_gram_adjoints[tet.Index]

            for angle_edge, (i, j) in _OneSubsimplicesWithVertexIndices:
                cii = vga[i, i]
                cij = vga[i, j]
                cjj = vga[j, j]

                dcij = -1 / sqrt(cii * cjj - cij**2)
                tmp = -dcij * cij / 2
                dcii = tmp / cii
                dcjj = tmp / cjj

                a = tet.Class[t3m.comp(angle_edge)].Index

                for length_edge, (m, n) in _OneSubsimplicesWithVertexIndices:
                    l = tet.Class[length_edge].Index

                    result[a, l] += (
                        dcij *
                        _cofactor_derivative(cofactor_matrices, i, j, m, n) +
                        dcii *
                        _cofactor_derivative(cofactor_matrices, i, i, m, n) +
                        dcjj *
                        _cofactor_derivative(cofactor_matrices, j, j, m, n))
        return result
Exemplo n.º 2
0
def _compute_R13_point_on_horosphere_for_vertex(tet, V0):
    V1, V2, V3 = t3m.VerticesOfFaceCounterclockwise[t3m.comp(V0)]

    cusp_length = tet.horotriangles[V0].get_real_lengths()[V0 | V1 | V2]
    pts  = [ tet.complex_vertices[V] for V in [V0, V1, V2]]
    
    pts[1] = 1.0 / (pts[1] - pts[0])
    pts[2] = 1.0 / (pts[2] - pts[0])

    base_length = abs(pts[2] - pts[1])
    
    horosphere_height = cusp_length / base_length

    return complex_and_height_to_R13_time_vector(pts[0], horosphere_height)