From e0e9c70961b93516c9423e370aab735aa8ab90c1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 26 Jan 2022 09:26:09 -0500 Subject: [PATCH] hurwitz.py: add conjugate() method for matrices. --- mjo/hurwitz.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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. -- 2.43.2