]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
matrix_algebra: use "[]" for trivial matrices and fix a test.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 9 Mar 2021 21:21:40 +0000 (16:21 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 9 Mar 2021 21:21:40 +0000 (16:21 -0500)
mjo/hurwitz.py
mjo/matrix_algebra.py

index 57f65786ebf564e1f250d5c22c60e35dcd440c08..10b308d2bfa602373e0924e390e7e10453eff221 100644 (file)
@@ -715,11 +715,11 @@ class ComplexMatrixAlgebra(HurwitzMatrixAlgebra):
         sage: (I,) = A.entry_algebra().gens()
         sage: A([ [1+I, 1],
         ....:     [-1, -I] ])
-        +-------+----+
-        | I + 1 | 1  |
-        +-------+----+
-        | -1    | -I |
-        +-------+----+
+        +---------+------+
+        | 1 + 1*I | 1    |
+        +---------+------+
+        | -1      | -1*I |
+        +---------+------+
 
     ::
 
index 29a37d1e7c9bdee3dee6b36960126d5f545753fe..69d9aebcabfd566bf95b797ec20444629c62c14f 100644 (file)
@@ -60,15 +60,16 @@ class MatrixAlgebraElement(IndexedFreeModuleElement):
         TESTS::
 
             sage: MatrixAlgebra(0,ZZ,ZZ).zero()
-            0
+            []
 
         """
         if self.nrows() == 0 or self.ncols() == 0:
-            # Otherwise we get a crash or a blank space, depending
-            # on how hard we work for it.
-            return self.parent().entry_algebra().zero().__repr__()
+            # Otherwise we get a crash or a blank space, depending on
+            # how hard we work for it. This is what MatrixSpace(...,
+            # 0) returns.
+            return "[]"
 
-        return table(rs, frame=True)._repr_()
+        return table(self.rows(), frame=True)._repr_()
 
 
     def list(self):