From: Michael Orlitzky Date: Fri, 22 Nov 2024 20:22:33 +0000 (-0500) Subject: mjo/cone/cone.py: don't import from sage.all X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=9d02ca4fd81f5d25ea164690781cbf201b5c07fd;p=sage.d.git mjo/cone/cone.py: don't import from sage.all --- diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index b7456e2..5b9f839 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -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)