- Every operator is positive on the trivial cone::
-
- sage: K = Cone([(0,)])
- sage: positive_operator_gens(K)
- [[1], [-1]]
-
- sage: K = Cone([(0,0)])
- sage: K.is_trivial()
- True
- sage: positive_operator_gens(K)
- [
- [1 0] [-1 0] [0 1] [ 0 -1] [0 0] [ 0 0] [0 0] [ 0 0]
- [0 0], [ 0 0], [0 0], [ 0 0], [1 0], [-1 0], [0 1], [ 0 -1]
- ]
-
- Every operator is positive on the ambient vector space::
-
- sage: K = Cone([(1,),(-1,)])
- sage: K.is_full_space()
- True
- sage: positive_operator_gens(K)
- [[1], [-1]]
-
- sage: K = Cone([(1,0),(-1,0),(0,1),(0,-1)])
- sage: K.is_full_space()
- True
- sage: positive_operator_gens(K)
- [
- [1 0] [-1 0] [0 1] [ 0 -1] [0 0] [ 0 0] [0 0] [ 0 0]
- [0 0], [ 0 0], [0 0], [ 0 0], [1 0], [-1 0], [0 1], [ 0 -1]
- ]
-
- A non-obvious application is to find the positive operators on the
- right half-plane::
-
- sage: K = Cone([(1,0),(0,1),(0,-1)])
- sage: positive_operator_gens(K)
- [
- [1 0] [0 0] [ 0 0] [0 0] [ 0 0]
- [0 0], [1 0], [-1 0], [0 1], [ 0 -1]
- ]
-
- TESTS:
-
- Each positive operator generator should send the generators of the
- cone into the cone::
-
- sage: set_random_seed()
- sage: K = random_cone(max_ambient_dim=4)
- sage: pi_of_K = positive_operator_gens(K)
- sage: all([ K.contains(P*x) for P in pi_of_K for x in K ])
- True
-
- Each positive operator generator should send a random element of the
- cone into the cone::