]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
octonions: alias abs() to norm().
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 13:37:21 +0000 (08:37 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 13:37:21 +0000 (08:37 -0500)
mjo/octonions.py

index 073765ccf1ef934ab6d9f6fc59435384bf832f36..bd014c22eb4c180117cf70291e4f2357c091bd20 100644 (file)
@@ -141,6 +141,11 @@ class Octonion(IndexedFreeModuleElement):
         """
         return self._norm_squared().sqrt()
 
         """
         return self._norm_squared().sqrt()
 
+    # The absolute value notation is typically used for complex numbers...
+    # and norm() isn't supported in AA, so this lets us use abs() in all
+    # of the division algebras we need.
+    abs = norm
+
     def inverse(self):
         r"""
         Return the inverse of this element if it exists.
     def inverse(self):
         r"""
         Return the inverse of this element if it exists.