Lyapunov-like on this cone.
"""
- pass # implement me lol
+ V = K.lattice().vector_space()
+
+ C_of_K = discrete_complementarity_set(K)
+
+ matrices = [x.tensor_product(s) for (x,s) in C_of_K]
+
+ # 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.
+ #
+ # The space W has the same base ring as V, but dimension
+ # 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.
+ W = VectorSpace(V.base_ring(), V.dimension()**2)
+
+ # Turn our matrices into long vectors...
+ vectors = [ W(m.list()) for m in matrices ]
+
+ # Vector space representation of Lyapunov-like matrices
+ # (i.e. vec(L) where L is Luapunov-like).
+ LL_vector = W.span(vectors).complement()
+
+ # Now construct an ambient MatrixSpace in which to stick our
+ # transformations.
+ M = MatrixSpace(V.base_ring(), V.dimension())
+
+ matrices = [ M(v.list()) for v in LL_vector.basis() ]
+
+ return matrices
+
def lyapunov_rank(K):