]> gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/cone/cone.py
mjo/ldlt.py: delete naive implementations; fix tests.
[sage.d.git] / mjo / cone / cone.py
1 from sage.all import *
2
3 def LL_cone(K):
4 gens = K.lyapunov_like_basis()
5 L = ToricLattice(K.lattice_dim()**2)
6 return Cone(( g.list() for g in gens ), lattice=L, check=False)
7
8 def Sigma_cone(K):
9 gens = K.cross_positive_operators_gens()
10 L = ToricLattice(K.lattice_dim()**2)
11 return Cone(( g.list() for g in gens ), lattice=L, check=False)
12
13 def Z_cone(K):
14 gens = K.Z_operators_gens()
15 L = ToricLattice(K.lattice_dim()**2)
16 return Cone(( g.list() for g in gens ), lattice=L, check=False)
17
18 def pi_cone(K1, K2=None):
19 if K2 is None:
20 K2 = K1
21 gens = K1.positive_operators_gens(K2)
22 L = ToricLattice(K1.lattice_dim()*K2.lattice_dim())
23 return Cone(( g.list() for g in gens ), lattice=L, check=False)