Class swarmauri_core.inner_products.IInnerProduct.IInnerProduct
swarmauri_core.inner_products.IInnerProduct.IInnerProduct
Bases: ABC
Interface defining the contract for inner product operations.
This interface requires implementation of methods to compute inner products between vectors, matrices, or callables, as well as methods to verify mathematical properties of the inner product such as conjugate symmetry, linearity, and positivity.
compute
abstractmethod
compute(a, b)
Compute the inner product between two objects.
Parameters
a : Union[Vector, Matrix, Callable] The first object for inner product calculation b : Union[Vector, Matrix, Callable] The second object for inner product calculation
Returns
float The inner product value
Source code in swarmauri_core/inner_products/IInnerProduct.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
check_conjugate_symmetry
abstractmethod
check_conjugate_symmetry(a, b)
Check if the inner product satisfies the conjugate symmetry property: = * (complex conjugate).
Parameters
a : Union[Vector, Matrix, Callable] The first object b : Union[Vector, Matrix, Callable] The second object
Returns
bool True if conjugate symmetry holds, False otherwise
Source code in swarmauri_core/inner_products/IInnerProduct.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
check_linearity_first_argument
abstractmethod
check_linearity_first_argument(a1, a2, b, alpha, beta)
Check if the inner product satisfies linearity in the first argument:
Parameters
a1 : Union[Vector, Matrix, Callable] First component of the first argument a2 : Union[Vector, Matrix, Callable] Second component of the first argument b : Union[Vector, Matrix, Callable] The second object alpha : float Scalar multiplier for a1 beta : float Scalar multiplier for a2
Returns
bool True if linearity in the first argument holds, False otherwise
Source code in swarmauri_core/inner_products/IInnerProduct.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
check_positivity
abstractmethod
check_positivity(a)
Check if the inner product satisfies the positivity property: >= 0 and = 0 iff a = 0.
Parameters
a : Union[Vector, Matrix, Callable] The object to check positivity for
Returns
bool True if positivity holds, False otherwise
Source code in swarmauri_core/inner_products/IInnerProduct.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |