X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fcone%2Fcone.py;h=3f915ed66fb4ea33629bc1c30ff4e021f59f8607;hb=d3dd6210c93ee4ea0fbeb8e643649a0ab958c796;hp=f6f378e61cd71c93eb4abf3de017272d11192e0f;hpb=8cc66a7a6e7ffbba7ff2f3894cc449ca3b7d566f;p=sage.d.git diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index f6f378e..3f915ed 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -637,13 +637,11 @@ def positive_operators(K): A positive operator on a cone should send its generators into the cone:: sage: K = random_cone(max_ambient_dim = 6) - sage: pi_of_k = positive_operators(K) - sage: all([K.contains(p*x) for p in pi_of_k for x in K.rays()]) + sage: pi_of_K = positive_operators(K) + sage: all([K.contains(p*x) for p in pi_of_K for x in K.rays()]) True """ - V = K.lattice().vector_space() - # Sage doesn't think matrices are vectors, so we have to convert # our matrices to vectors explicitly before we can figure out how # many are linearly-indepenedent. @@ -652,12 +650,10 @@ def positive_operators(K): # dim(V)^2. So it has the same dimension as the space of linear # transformations on V. In other words, it's just the right size # to create an isomorphism between it and our matrices. + V = K.lattice().vector_space() W = VectorSpace(V.base_ring(), V.dimension()**2) - G1 = [ V(x) for x in K.rays() ] - G2 = [ V(s) for s in K.dual().rays() ] - - tensor_products = [ s.tensor_product(x) for x in G1 for s in G2 ] + tensor_products = [ s.tensor_product(x) for x in K for s in K.dual() ] # Turn our matrices into long vectors... vectors = [ W(m.list()) for m in tensor_products ]