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.
# 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 ]