Skip to content

Commit 187988a

Browse files
committed
Removed duplicate of .is_definite()
1 parent 227d488 commit 187988a

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

src/sage/algebras/quatalg/quaternion_algebra.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,29 +1078,6 @@ def invariants(self):
10781078
"""
10791079
return self._a, self._b
10801080

1081-
def is_definite(self):
1082-
"""
1083-
Checks whether the quaternion algebra ``self`` is definite, i.e. whether it ramifies at the
1084-
unique Archimedean place of its base field QQ. This is the case if and only if both
1085-
invariants of ``self`` are negative.
1086-
1087-
EXAMPLES::
1088-
1089-
sage: QuaternionAlgebra(QQ,-5,-2).is_definite()
1090-
True
1091-
sage: QuaternionAlgebra(1).is_definite()
1092-
False
1093-
1094-
sage: QuaternionAlgebra(RR(2.),1).is_definite()
1095-
Traceback (most recent call last):
1096-
...
1097-
ValueError: base field must be rational numbers
1098-
"""
1099-
if not isinstance(self.base_ring(), RationalField):
1100-
raise ValueError("base field must be rational numbers")
1101-
a, b = self.invariants()
1102-
return a < 0 and b < 0
1103-
11041081
def __eq__(self, other):
11051082
"""
11061083
Compare self and other.
@@ -1248,7 +1225,7 @@ def is_definite(self):
12481225
...
12491226
ValueError: base field must be rational numbers
12501227
"""
1251-
if not is_RationalField(self.base_ring()):
1228+
if not isinstance(self.base_ring(), RationalField):
12521229
raise ValueError("base field must be rational numbers")
12531230
a, b = self.invariants()
12541231
return a < 0 and b < 0

0 commit comments

Comments
 (0)