]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
hurwitz.py: add conjugate() method for matrices.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 26 Jan 2022 14:26:09 +0000 (09:26 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 26 Jan 2022 14:26:09 +0000 (09:26 -0500)
mjo/hurwitz.py

index 43ed8f20782c074022a3a0f46f68c7dad00dae5f..c213283099c2464316994a9d0fec7fef1f31c284 100644 (file)
@@ -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.