From 1ce1d354d9442cf64cb61d41b3354f55b8a4331d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 25 Nov 2015 15:15:32 -0500 Subject: [PATCH] Add a test for the lineality spaces of Z/pi-star being equal. --- mjo/cone/cone.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index 15857be..702472c 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -315,10 +315,24 @@ def Z_transformation_gens(K): And thus, the lineality of Z is the Lyapunov rank:: sage: set_random_seed() - sage: K = random_cone(min_ambient_dim = 1, max_ambient_dim = 6) - sage: z_cone = Cone([ z.list() for z in Z_transformation_gens(K) ]) + sage: K = random_cone(max_ambient_dim=6) + sage: Z_of_K = Z_transformation_gens(K) + sage: L = ToricLattice(K.lattice_dim()**2) + sage: z_cone = Cone([ z.list() for z in Z_of_K ], lattice=L) sage: z_cone.lineality() == K.lyapunov_rank() True + + The lineality spaces of pi-star and Z-star are equal: + + sage: set_random_seed() + sage: K = random_cone(max_ambient_dim=5) + sage: pi_of_K = positive_operator_gens(K) + sage: Z_of_K = Z_transformation_gens(K) + sage: L = ToricLattice(K.lattice_dim()**2) + sage: pi_star = Cone([p.list() for p in pi_of_K], lattice=L).dual() + sage: z_star = Cone([ z.list() for z in Z_of_K], lattice=L).dual() + sage: pi_star.linear_subspace() == z_star.linear_subspace() + True """ # Matrices are not vectors in Sage, so we have to convert them # to vectors explicitly before we can find a basis. We need these -- 2.44.2