sage: sum(map(abs, l))
0
+ Try the formula in my paper::
+
+ sage: K = random_cone(max_dim=15, max_rays=25)
+ sage: actual = lyapunov_rank(K)
+ sage: K_S = project_span(K)
+ sage: J_T1 = project_span(K, K_S.dual())
+ sage: J_T2 = project_span(K_S.dual()).dual()
+ sage: J_T2 = Cone(J_T2.rays(), lattice=J_T1.lattice())
+ sage: J_T1 == J_T2
+ True
+ sage: J_T = J_T1
+ sage: l = K.linear_subspace().dimension()
+ sage: codim = K.lattice_dim() - K.dim()
+ sage: expected = lyapunov_rank(J_T) + K.dim()*(l + codim) + codim**2
+ sage: actual == expected
+ True
+
"""
V = K.lattice().vector_space()
An integer representing the Lyapunov rank of the cone. If the
dimension of the ambient vector space is `n`, then the Lyapunov rank
will be between `1` and `n` inclusive; however a rank of `n-1` is
- not possible for any cone.
+ not possible (see the first reference).
.. note::
cone and Lyapunov-like transformations, Mathematical Programming, 147
(2014) 155-170.
- .. [Orlitzky/Gowda] M. Orlitzky and M. S. Gowda. The Lyapunov Rank of an
- Improper Cone. Work in-progress.
-
.. [Rudolf et al.] G. Rudolf, N. Noyan, D. Papp, and F. Alizadeh, Bilinear
optimality constraints for the cone of positive polynomials,
Mathematical Programming, Series B, 129 (2011) 5-31.
sage: b == n-1
False
- In fact [Orlitzky/Gowda]_, no closed convex polyhedral cone can have
- Lyapunov rank `n-1` in `n` dimensions::
-
- sage: K = random_cone(max_dim=10, max_rays=16)
- sage: b = lyapunov_rank(K)
- sage: n = K.lattice_dim()
- sage: b == n-1
- False
-
- The calculation of the Lyapunov rank of an improper cone can be
- reduced to that of a proper cone [Orlitzky/Gowda]_::
-
- sage: K = random_cone(max_dim=15, max_rays=25)
- sage: actual = lyapunov_rank(K)
- sage: K_S = project_span(K)
- sage: J_T1 = project_span(K_S.dual()).dual()
- sage: J_T2 = project_span(K, K_S.dual())
- sage: J_T2 = Cone(J_T2.rays(), lattice=J_T1.lattice())
- sage: J_T1 == J_T2
- True
- sage: J_T = J_T1
- sage: l = K.linear_subspace().dimension()
- sage: codim = K.lattice_dim() - K.dim()
- sage: expected = lyapunov_rank(J_T) + K.dim()*(l + codim) + codim**2
- sage: actual == expected
- True
-
"""
return len(LL(K))