X-Git-Url: http://gitweb.michael.orlitzky.com/?p=sage.d.git;a=blobdiff_plain;f=mjo%2Fhurwitz.py;h=1f7c9dc3781a844d6d77a1e63168c52340bf6770;hp=ccc8219b1a92036c6ac92f118339c160a885977b;hb=fc29add6cf1d9ff4e8a240b0f8f2ca6672d4ea57;hpb=9861c4860c4bb1158243c06544cb54d1d9e3b411 diff --git a/mjo/hurwitz.py b/mjo/hurwitz.py index ccc8219..1f7c9dc 100644 --- a/mjo/hurwitz.py +++ b/mjo/hurwitz.py @@ -306,6 +306,31 @@ class Octonions(CombinatorialFreeModule): class HurwitzMatrixAlgebraElement(MatrixAlgebraElement): + def conjugate_transpose(self): + r""" + Return the conjugate-transpose of this matrix. + + SETUP:: + + sage: from mjo.hurwitz import HurwitzMatrixAlgebra + + EXAMPLES:: + + sage: A = HurwitzMatrixAlgebra(2, QQbar, ZZ) + sage: M = A([ [ I, 2*I], + ....: [ 3*I, 4*I] ]) + +------+------+ + | -1*I | -3*I | + +------+------+ + | -2*I | -4*I | + +------+------+ + + """ + entries = [ [ self[j,i].conjugate() + for j in range(self.ncols())] + for i in range(self.nrows()) ] + return self.parent()._element_constructor_(entries) + def is_hermitian(self): r""" @@ -322,6 +347,8 @@ class HurwitzMatrixAlgebraElement(MatrixAlgebraElement): True """ + # A tiny bit faster than checking equality with the conjugate + # transpose. return all( self[i,j] == self[j,i].conjugate() for i in range(self.nrows()) for j in range(self.ncols()) )