diff --git a/src/sage/geometry/semialgebraic/semidefinite.py b/src/sage/geometry/semialgebraic/semidefinite.py index f0b7789dda3..7d0c24a1ef6 100644 --- a/src/sage/geometry/semialgebraic/semidefinite.py +++ b/src/sage/geometry/semialgebraic/semidefinite.py @@ -15,8 +15,10 @@ from sage.structure.unique_representation import UniqueRepresentation from sage.geometry.convex_set import ConvexSet_closed, ConvexSet_relatively_open -class PositiveSemidefiniteMatrices_base(UniqueRepresentation): - +class SemidefiniteMatrices_base(UniqueRepresentation): + r""" + Base class for convex sets of semidefinite matrices. + """ def __init__(self, matrix_space): r""" @@ -54,9 +56,10 @@ def contains(self, point): __contains__ = contains -class PositiveSemidefiniteMatrices(PositiveSemidefiniteMatrices_base, ConvexSet_closed): + +class PositiveSemidefiniteMatrices(SemidefiniteMatrices_base, ConvexSet_closed): r""" - The convex cone of positive semidefinite matrices + The convex cone of positive semidefinite symmetric matrices EXAMPLES:: @@ -78,12 +81,19 @@ class PositiveSemidefiniteMatrices(PositiveSemidefiniteMatrices_base, ConvexSet_ sage: A in M_psd True - And finally, an indefinite matrix:: + An indefinite matrix:: sage: A = matrix(QQ, [ [0,1], ....: [1,0] ] ) sage: A in M_psd False + + And, finally, a non-symmetric matrix:: + + sage: A = matrix(QQ, [ [2,2], + ....: [1,2] ] ) + sage: A in M_psd + False """ def relative_interior(self): return PositiveDefiniteMatrices(self._matrix_space) @@ -97,9 +107,10 @@ def is_relatively_open(self): def is_compact(self): return self.dimension() == 0 -class PositiveDefiniteMatrices(PositiveSemidefiniteMatrices_base, ConvexSet_relatively_open): + +class PositiveDefiniteMatrices(SemidefiniteMatrices_base, ConvexSet_relatively_open): r""" - The convex set of positive definite matrices + The convex set of positive definite symmetric matrices EXAMPLES:: @@ -121,12 +132,19 @@ class PositiveDefiniteMatrices(PositiveSemidefiniteMatrices_base, ConvexSet_rela sage: A in M_pd False - And finally, an indefinite matrix:: + An indefinite matrix:: sage: A = matrix(QQ, [ [0,1], ....: [1,0] ] ) sage: A in M_pd False + + And, finally, a non-symmetric matrix:: + + sage: A = matrix(QQ, [ [2,2], + ....: [1,2] ] ) + sage: A in M_pd + False """ def closure(self): return PositiveSemidefiniteMatrices(self._matrix_space)