diff --git a/python/raytracing/raytracing_data.py b/python/raytracing/raytracing_data.py index fdcf0f68..ed53ff8e 100644 --- a/python/raytracing/raytracing_data.py +++ b/python/raytracing/raytracing_data.py @@ -1,9 +1,10 @@ from snappy.snap import t3mlite as t3m from snappy.snap.mcomplex_base import * -from snappy.SnapPy import matrix from .hyperboloid_utilities import * +from ..matrix import make_matrix + __all__ = ['RaytracingData'] @@ -84,14 +85,14 @@ def get_compile_time_constants(self): def update_view_state(self, boost_tet_num_and_weight, - m=matrix([[1.0, 0.0, 0.0, 0.0], - [0.0, 1.0, 0.0, 0.0], - [0.0, 0.0, 1.0, 0.0], - [0.0, 0.0, 0.0, 1.0]])): + m=make_matrix([[1.0, 0.0, 0.0, 0.0], + [0.0, 1.0, 0.0, 0.0], + [0.0, 0.0, 1.0, 0.0], + [0.0, 0.0, 0.0, 1.0]])): boost, tet_num, weight = boost_tet_num_and_weight - boost = matrix(boost, base_ring=self.RF) - m = matrix(m, base_ring=self.RF) + boost = make_matrix(boost, ring=self.RF) + m = make_matrix(m, ring=self.RF) boost, tet, weight = _graph_trace( boost * m, self.mcomplex.Tetrahedra[tet_num], weight) diff --git a/python/upper_halfspace/__init__.py b/python/upper_halfspace/__init__.py index 6bffc96a..f01d7cde 100644 --- a/python/upper_halfspace/__init__.py +++ b/python/upper_halfspace/__init__.py @@ -1,4 +1,4 @@ -from ..matrix import matrix +from ..matrix import make_matrix from ..sage_helper import _within_sage from ..exceptions import InsufficientPrecisionError from ..math_basics import is_ComplexIntervalFieldElement @@ -39,7 +39,7 @@ def sl2c_inverse(A): - return matrix([[A[1,1], -A[0, 1]], [-A[1, 0], A[0, 0]]]) + return make_matrix([[A[1,1], -A[0, 1]], [-A[1, 0], A[0, 0]]]) def psl2c_to_o13(A): @@ -51,7 +51,7 @@ def psl2c_to_o13(A): Aadj = _adjoint(A) - return matrix( + return make_matrix( [ _o13_matrix_column(A, m, Aadj) for m in _basis_vectors_sl2c(A.base_ring()) ]).transpose() @@ -117,19 +117,18 @@ def complex_length_of_psl2c_matrix(m): "Try increasing precision" % tr) def _basis_vectors_sl2c(CF): - return [ matrix([[ 1 , 0 ], - [ 0, 1 ]], base_ring=CF), - matrix([[ 1 , 0 ], - [ 0 ,-1 ]], base_ring=CF), - matrix([[ 0 , 1 ], - [ 1 , 0 ]], base_ring=CF), - matrix([[ 0 , 1j], - [-1j, 0 ]], base_ring=CF) ] - + return [ make_matrix([[ 1 , 0 ], + [ 0, 1 ]], ring=CF), + make_matrix([[ 1 , 0 ], + [ 0 ,-1 ]], ring=CF), + make_matrix([[ 0 , 1 ], + [ 1 , 0 ]], ring=CF), + make_matrix([[ 0 , 1j], + [-1j, 0 ]], ring=CF) ] def _adjoint(m): - return matrix([[ m[0][0].conjugate(), m[1][0].conjugate()], - [ m[0][1].conjugate(), m[1][1].conjugate()]]) + return make_matrix([[ m[0][0].conjugate(), m[1][0].conjugate()], + [ m[0][1].conjugate(), m[1][1].conjugate()]]) def _o13_matrix_column(A, m, Aadj):