From a4109ab945f5d3ed94207c936e60b5b187ae450b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 27 Aug 2016 18:25:20 -0400 Subject: [PATCH] Add a test for my construction of LL(pi(K,H)). --- mjo/cone/cone.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index d364a01..c71a24c 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -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 -- 2.44.2