]>
gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/cone/cone.py
7e9c549eec66ede6dc0c94bd67e0e16d4d999538
3 def is_lyapunov_like(L
,K
):
5 Determine whether or not ``L`` is Lyapunov-like on ``K``.
7 We say that ``L`` is Lyapunov-like on ``K`` if `\left\langle
8 L\left\lparenx\right\rparen,s\right\rangle = 0` for all pairs
9 `\left\langle x,s \right\rangle` in the complementarity set of
10 ``K``. It is known [Orlitzky]_ that this property need only be
11 checked for generators of ``K`` and its dual.
13 There are faster ways of checking this property. For example, we
14 could compute a `lyapunov_like_basis` of the cone, and then test
15 whether or not the given matrix is contained in the span of that
16 basis. The value of this function is that it works on symbolic
21 - ``L`` -- A linear transformation or matrix.
23 - ``K`` -- A polyhedral closed convex cone.
27 ``True`` if it can be proven that ``L`` is Lyapunov-like on ``K``,
28 and ``False`` otherwise.
32 If this function returns ``True``, then ``L`` is Lyapunov-like
33 on ``K``. However, if ``False`` is returned, that could mean one
34 of two things. The first is that ``L`` is definitely not
35 Lyapunov-like on ``K``. The second is more of an "I don't know"
36 answer, returned (for example) if we cannot prove that an inner
41 M. Orlitzky. The Lyapunov rank of an improper cone.
42 http://www.optimization-online.org/DB_HTML/2015/10/5135.html
46 The identity is always Lyapunov-like in a nontrivial space::
48 sage: set_random_seed()
49 sage: K = random_cone(min_ambient_dim=1, max_ambient_dim=8)
50 sage: L = identity_matrix(K.lattice_dim())
51 sage: is_lyapunov_like(L,K)
54 As is the "zero" transformation::
56 sage: K = random_cone(min_ambient_dim=1, max_ambient_dim=8)
57 sage: R = K.lattice().vector_space().base_ring()
58 sage: L = zero_matrix(R, K.lattice_dim())
59 sage: is_lyapunov_like(L,K)
62 Everything in ``K.lyapunov_like_basis()`` should be Lyapunov-like
65 sage: K = random_cone(min_ambient_dim=1, max_ambient_dim=6)
66 sage: all([ is_lyapunov_like(L,K) for L in K.lyapunov_like_basis() ])
70 return all([(L
*x
).inner_product(s
) == 0
71 for (x
,s
) in K
.discrete_complementarity_set()])
74 gens
= K
.lyapunov_like_basis()
75 L
= ToricLattice(K
.lattice_dim()**2)
76 return Cone([ g
.list() for g
in gens
], lattice
=L
, check
=False)
79 gens
= K
.cross_positive_operator_gens()
80 L
= ToricLattice(K
.lattice_dim()**2)
81 return Cone([ g
.list() for g
in gens
], lattice
=L
, check
=False)
84 gens
= K
.Z_operator_gens()
85 L
= ToricLattice(K
.lattice_dim()**2)
86 return Cone([ g
.list() for g
in gens
], lattice
=L
, check
=False)
88 def pi_cone(K1
, K2
=None):
91 gens
= K1
.positive_operator_gens(K2
)
92 L
= ToricLattice(K1
.lattice_dim()*K2
.lattice_dim())
93 return Cone([ g
.list() for g
in gens
], lattice
=L
, check
=False)