From: Michael Orlitzky Date: Wed, 26 Jan 2022 14:26:09 +0000 (-0500) Subject: hurwitz.py: add conjugate() method for matrices. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=e0e9c70961b93516c9423e370aab735aa8ab90c1;p=sage.d.git hurwitz.py: add conjugate() method for matrices. --- diff --git a/mjo/hurwitz.py b/mjo/hurwitz.py index 43ed8f2..c213283 100644 --- a/mjo/hurwitz.py +++ b/mjo/hurwitz.py @@ -299,6 +299,32 @@ class Octonions(CombinatorialFreeModule): class HurwitzMatrixAlgebraElement(MatrixAlgebraElement): + def conjugate(self): + r""" + Return the entrywise conjugate of this matrix. + + SETUP:: + + sage: from mjo.hurwitz import ComplexMatrixAlgebra + + EXAMPLES:: + + sage: A = ComplexMatrixAlgebra(2, QQbar, ZZ) + sage: M = A([ [ I, 1 + 2*I], + ....: [ 3*I, 4*I] ]) + sage: M.conjugate() + +------+----------+ + | -I | -2*I + 1 | + +------+----------+ + | -3*I | -4*I | + +------+----------+ + + """ + entries = [ [ self[i,j].conjugate() + for j in range(self.ncols())] + for i in range(self.nrows()) ] + return self.parent()._element_constructor_(entries) + def conjugate_transpose(self): r""" Return the conjugate-transpose of this matrix.