+
+ The positive operators of a permuted cone can be obtained by
+ conjugation::
+
+ sage: set_random_seed()
+ sage: K = random_cone(max_ambient_dim=4)
+ sage: L = ToricLattice(K.lattice_dim()**2)
+ sage: p = SymmetricGroup(K.lattice_dim()).random_element().matrix()
+ sage: pK = Cone([ p*k for k in K ], K.lattice(), check=False)
+ sage: pi_of_pK = positive_operator_gens(pK)
+ sage: actual = Cone([t.list() for t in pi_of_pK],
+ ....: lattice=L,
+ ....: check=False)
+ sage: pi_of_K = positive_operator_gens(K)
+ sage: expected = Cone([(p*t*p.inverse()).list() for t in pi_of_K],
+ ....: lattice=L,
+ ....: check=False)
+ sage: actual.is_equivalent(expected)
+ True
+
+ A transformation is positive on a cone if and only if its adjoint is
+ positive on the dual of that cone::
+
+ sage: set_random_seed()
+ sage: K = random_cone(max_ambient_dim=4)
+ sage: F = K.lattice().vector_space().base_field()
+ sage: n = K.lattice_dim()
+ sage: L = ToricLattice(n**2)
+ sage: W = VectorSpace(F, n**2)
+ sage: pi_of_K = positive_operator_gens(K)
+ sage: pi_of_K_star = positive_operator_gens(K.dual())
+ sage: pi_cone = Cone([p.list() for p in pi_of_K],
+ ....: lattice=L,
+ ....: check=False)
+ sage: pi_star = Cone([p.list() for p in pi_of_K_star],
+ ....: lattice=L,
+ ....: check=False)
+ sage: M = MatrixSpace(F, n)
+ sage: L = M(pi_cone.random_element(ring=QQ).list())
+ sage: pi_star.contains(W(L.transpose().list()))
+ True
+
+ sage: L = W.random_element()
+ sage: L_star = W(M(L.list()).transpose().list())
+ sage: pi_cone.contains(L) == pi_star.contains(L_star)
+ True
+
+ The Lyapunov rank of the positive operator cone is the product of
+ the Lyapunov ranks of the associated cones if they're all proper::
+
+ sage: K1 = random_cone(max_ambient_dim=4,
+ ....: strictly_convex=True,
+ ....: solid=True)
+ sage: K2 = random_cone(max_ambient_dim=4,
+ ....: strictly_convex=True,
+ ....: solid=True)
+ sage: pi_K1_K2 = positive_operator_gens(K1,K2)
+ sage: L = ToricLattice(K1.lattice_dim() * K2.lattice_dim())
+ sage: pi_cone = Cone([ g.list() for g in pi_K1_K2 ],
+ ....: lattice=L,
+ ....: check=False)
+ sage: beta1 = K1.lyapunov_rank()
+ sage: beta2 = K2.lyapunov_rank()
+ sage: pi_cone.lyapunov_rank() == beta1*beta2
+ True
+
+ The Lyapunov-like operators on a proper polyhedral positive operator
+ cone can be computed from the Lyapunov-like operators on the cones
+ with respect to which the operators are positive::
+
+ sage: K1 = random_cone(max_ambient_dim=4,
+ ....: strictly_convex=True,
+ ....: solid=True)
+ sage: K2 = random_cone(max_ambient_dim=4,
+ ....: strictly_convex=True,
+ ....: solid=True)
+ sage: pi_K1_K2 = positive_operator_gens(K1,K2)
+ sage: F = K1.lattice().base_field()
+ sage: m = K1.lattice_dim()
+ sage: n = K2.lattice_dim()
+ sage: L = ToricLattice(m*n)
+ sage: M1 = MatrixSpace(F, m, m)
+ sage: M2 = MatrixSpace(F, n, n)
+ sage: LL_K1 = [ M1(x.list()) for x in K1.dual().lyapunov_like_basis() ]
+ sage: LL_K2 = [ M2(x.list()) for x in K2.lyapunov_like_basis() ]
+ sage: tps = [ s.tensor_product(x) for x in LL_K1 for s in LL_K2 ]
+ sage: W = VectorSpace(F, (m**2)*(n**2))
+ sage: expected = span(F, [ W(x.list()) for x in tps ])
+ sage: pi_cone = Cone([p.list() for p in pi_K1_K2],
+ ....: lattice=L,
+ ....: check=False)
+ sage: LL_pi = pi_cone.lyapunov_like_basis()
+ sage: actual = span(F, [ W(x.list()) for x in LL_pi ])
+ sage: actual == expected
+ True
+