elementary_vectors.utility¶
Utility functions
Functions
|
Apply conformal elimination to two real vectors to find a new vector. |
|
Return whether this element is a symbolic expression. |
|
Return a right kernel vector such that the support is a subset of given indices. |
- elementary_vectors.utility.conformal_elimination(vector1, vector2, indices: Optional[list[int]] = None)¶
Apply conformal elimination to two real vectors to find a new vector.
INPUT:
vector1
– a real vectorvector2
– a real vectorindices
– a list of indices (default:None
)
OUTPUT: Return a new vector
z = x + a y
wherea > 0
, such thatz[e] == 0
for somee
inindices
andZ_k <= X_k
fork
inindices
andZ_f = (X o Y)_f
forf
not inD(X, Y)
. Here,X
,Y
andZ
are the sign vectors corresponding tox
,y
andz
.Note
If
indices
is not given, the whole list of separating elements will be considered instead. (default)EXAMPLES:
sage: from elementary_vectors.utility import conformal_elimination sage: x = vector([1, 0, 2]) sage: y = vector([-1, 1, 1]) sage: conformal_elimination(x, y) (0, 1, 3)
- elementary_vectors.utility.is_symbolic(value)¶
Return whether this element is a symbolic expression.
If it belongs to the symbolic ring but doesn’t contain any variables it does not count as “symbolic”.
EXAMPLES:
sage: from elementary_vectors.utility import is_symbolic sage: is_symbolic(5) False sage: var('a, b') (a, b) sage: is_symbolic(a) True sage: is_symbolic(-a) True sage: is_symbolic(b^2 - a) True sage: is_symbolic(SR(5)) False
- elementary_vectors.utility.kernel_vector_support_given(M, indices)¶
Return a right kernel vector such that the support is a subset of given indices.
INPUT:
M
– a matrixindices
– a list of indices
OUTPUT: a vector in the right kernel of
M
such that the support is a subset ofindices
.EXAMPLES:
sage: from elementary_vectors.utility import kernel_vector_support_given sage: M = matrix([[1, 2, 0, 0], [0, 1, -1, 0]]) sage: v = kernel_vector_support_given(M, [0, 1, 2]) sage: max(v, -v) (2, -1, -1, 0) sage: kernel_vector_support_given(M, [3]) (0, 0, 0, 1) sage: kernel_vector_support_given(M, [0, 3]) (0, 0, 0, 1)