Skip to content

Commit

Permalink
Using make_matrix in upper_halfspace/__init__.py and raytracing/raytr…
Browse files Browse the repository at this point in the history
…acing_data.py.
  • Loading branch information
unhyperbolic committed May 6, 2024
1 parent 9ec9824 commit 7f6937e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
15 changes: 8 additions & 7 deletions python/raytracing/raytracing_data.py
Original file line number Diff line number Diff line change
@@ -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']


Expand Down Expand Up @@ -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)
Expand Down
27 changes: 13 additions & 14 deletions python/upper_halfspace/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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()

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 7f6937e

Please sign in to comment.