- sage: e1 = (1,0,0,0,0)
- sage: neg_e1 = (-1,0,0,0,0)
- sage: e2 = (0,1,0,0,0)
- sage: neg_e2 = (0,-1,0,0,0)
- sage: z = (0,0,0,0,0)
- sage: K = Cone([e1, neg_e1, e2, neg_e2, z, z, z])
- sage: lyapunov_rank(K)
- 19
- sage: K.lattice_dim()**2 - K.dim()*codim(K)
- 19
-
- The Lyapunov rank should be additive on a product of proper cones
- [Rudolf et al.]_::
-
- sage: L31 = Cone([(1,0,1), (0,-1,1), (-1,0,1), (0,1,1)])
- sage: octant = Cone([(1,0,0), (0,1,0), (0,0,1)])
- sage: K = L31.cartesian_product(octant)
- sage: lyapunov_rank(K) == lyapunov_rank(L31) + lyapunov_rank(octant)
- True
-
- Two isomorphic cones should have the same Lyapunov rank [Rudolf et al.]_.
- The cone ``K`` in the following example is isomorphic to the nonnegative
- octant in `\mathbb{R}^{3}`::
-
- sage: K = Cone([(1,2,3), (-1,1,0), (1,0,6)])
- sage: lyapunov_rank(K)
- 3
-
- The dual cone `K^{*}` of ``K`` should have the same Lyapunov rank as ``K``
- itself [Rudolf et al.]_::
-
- sage: K = Cone([(2,2,4), (-1,9,0), (2,0,6)])
- sage: lyapunov_rank(K) == lyapunov_rank(K.dual())
- True
-
- TESTS:
-
- The Lyapunov rank should be additive on a product of proper cones
- [Rudolf et al.]_::
-
- sage: set_random_seed()
- sage: K1 = random_cone(max_dim=10, strictly_convex=True, solid=True)
- sage: K2 = random_cone(max_dim=10, strictly_convex=True, solid=True)
- sage: K = K1.cartesian_product(K2)
- sage: lyapunov_rank(K) == lyapunov_rank(K1) + lyapunov_rank(K2)
+ sage: K = Cone([(1,0),(0,1)])
+ sage: Z_transformations(K)
+ [
+ [ 0 -1] [ 0 0] [-1 0] [1 0] [ 0 0] [0 0]
+ [ 0 0], [-1 0], [ 0 0], [0 0], [ 0 -1], [0 1]
+ ]
+ sage: K = Cone([(1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)])
+ sage: all([ z[i][j] <= 0 for z in Z_transformations(K)
+ ....: for i in range(z.nrows())
+ ....: for j in range(z.ncols())
+ ....: if i != j ])