]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
Add a test for the lineality spaces of Z/pi-star being equal.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 25 Nov 2015 20:15:32 +0000 (15:15 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 25 Nov 2015 20:15:32 +0000 (15:15 -0500)
mjo/cone/cone.py

index 15857be3ce5d29a5a3726a3a3e9d1390fde64f70..702472c30466f7cba79d4a79f1bf47a552079364 100644 (file)
@@ -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