From 6c7b006daa3f6be00e49696b617fe9159cba85cd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 27 Jan 2022 16:31:08 -0500 Subject: [PATCH] hurwitz.py: swap is_sker_hermitian() for is_skew_symmetric(). It turns out I've been working with the wrong concept for the past two days. Welp. --- mjo/hurwitz.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mjo/hurwitz.py b/mjo/hurwitz.py index c213283..6767fe1 100644 --- a/mjo/hurwitz.py +++ b/mjo/hurwitz.py @@ -385,8 +385,9 @@ class HurwitzMatrixAlgebraElement(MatrixAlgebraElement): for j in range(self.ncols()) ) - def is_skew_hermitian(self): + def is_skew_symmetric(self): r""" + Return whether or not this matrix is skew-symmetric. SETUP:: @@ -398,15 +399,23 @@ class HurwitzMatrixAlgebraElement(MatrixAlgebraElement): sage: A = ComplexMatrixAlgebra(2, QQbar, ZZ) sage: M = A([ [ 0,I], ....: [-I,1] ]) - sage: M.is_skew_hermitian() + sage: M.is_skew_symmetric() False + :: + + sage: A = ComplexMatrixAlgebra(2, QQbar, ZZ) + sage: M = A([ [ 0, 1+I], + ....: [-1-I, 0] ]) + sage: M.is_skew_symmetric() + True + :: sage: A = HurwitzMatrixAlgebra(2, AA, QQ) sage: M = A([ [1, 1], ....: [1, 1] ]) - sage: M.is_skew_hermitian() + sage: M.is_skew_symmetric() False :: @@ -414,13 +423,13 @@ class HurwitzMatrixAlgebraElement(MatrixAlgebraElement): sage: A = ComplexMatrixAlgebra(2, QQbar, ZZ) sage: M = A([ [2*I , 1 + I], ....: [-1 + I, -2*I] ]) - sage: M.is_skew_hermitian() - True + sage: M.is_skew_symmetric() + False """ - # A tiny bit faster than checking equality with the conjugate - # transpose. - return all( self[i,j] == -self[j,i].conjugate() + # A tiny bit faster than checking equality with the negation + # of the transpose. + return all( self[i,j] == -self[j,i] for i in range(self.nrows()) for j in range(self.ncols()) ) -- 2.44.2