X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_algebra.py;h=1cf6fa51dd2626df1e75dcaeab95fc743000130f;hb=8ccf1d8af20cea17897aed21426b17872fd0fca3;hp=e16fd97c4f0e55591728dc8204da3d941529380c;hpb=28d86108d78f1ea5a93d9cc8d69bad9cc8cd74fd;p=sage.d.git diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index e16fd97..1cf6fa5 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1737,7 +1737,7 @@ class MatrixEJA: """ # We take the norm (absolute value) because Octonions() isn't # smart enough yet to coerce its one() into the base field. - return (X*Y).trace().abs() + return (X*Y).trace().real().abs() class RealEmbeddedMatrixEJA(MatrixEJA): @staticmethod @@ -2629,7 +2629,7 @@ class OctonionHermitianEJA(FiniteDimensionalEJA, MatrixEJA): """ from mjo.octonions import OctonionMatrixAlgebra - MS = OctonionMatrixAlgebra(n, field=field) + MS = OctonionMatrixAlgebra(n, scalars=field) es = MS.entry_algebra().gens() basis = [] @@ -2641,7 +2641,13 @@ class OctonionHermitianEJA(FiniteDimensionalEJA, MatrixEJA): else: for e in es: E_ij = MS.monomial( (i,j,e) ) - E_ij += MS.monomial( (j,i,e.conjugate()) ) + ec = e.conjugate() + # If the conjugate has a negative sign in front + # of it, (j,i,ec) won't be a monomial! + if (j,i,ec) in MS.indices(): + E_ij += MS.monomial( (j,i,ec) ) + else: + E_ij -= MS.monomial( (j,i,-ec) ) basis.append(E_ij) return tuple( basis )