]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
Add a test for my construction of LL(pi(K,H)).
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 27 Aug 2016 22:25:20 +0000 (18:25 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 27 Aug 2016 22:25:20 +0000 (18:25 -0400)
mjo/cone/cone.py

index d364a01834a8e1c37e00f8468f5ed7136b7e8408..c71a24cbee0c9d0857fd3c8d8fe2ecbb0042238c 100644 (file)
@@ -433,6 +433,36 @@ def positive_operator_gens(K1, K2 = None):
         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
+
     """
     if K2 is None:
         K2 = K1