]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/cone/cone.py: don't import from sage.all
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 22 Nov 2024 20:22:33 +0000 (15:22 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 22 Nov 2024 20:22:33 +0000 (15:22 -0500)
mjo/cone/cone.py

index b7456e21abc170d6479f9010a2b7ccdd5ab9438d..5b9f839f797bbd93f6defee5c6347af0059cf224 100644 (file)
@@ -1,21 +1,39 @@
-from sage.all import *
+r"""
+Matrices aren't vectors in Sage, so these ugly little functions
+allow you to create some important cones of matrices quickly and
+easily, without the boilerplate.
+"""
+
+from sage.geometry.toric_lattice import ToricLattice
 
 def LL_cone(K):
+    r"""
+    The cone of Lyapunov-like operators on ``K``.
+    """
     gens = K.lyapunov_like_basis()
     L = ToricLattice(K.lattice_dim()**2)
     return Cone(( g.list() for g in gens ), lattice=L, check=False)
 
 def Sigma_cone(K):
+    r"""
+    The cone of cross-positive operators on ``K``.
+    """
     gens = K.cross_positive_operators_gens()
     L = ToricLattice(K.lattice_dim()**2)
     return Cone(( g.list() for g in gens ), lattice=L, check=False)
 
 def Z_cone(K):
+    r"""
+    The cone of Z-operators on ``K``.
+    """
     gens = K.Z_operators_gens()
     L = ToricLattice(K.lattice_dim()**2)
     return Cone(( g.list() for g in gens ), lattice=L, check=False)
 
 def pi_cone(K1, K2=None):
+    r"""
+    The cone of positice operators on ``K``.
+    """
     if K2 is None:
         K2 = K1
     gens = K1.positive_operators_gens(K2)