mat_inner_product
qoptcraft.math.mat_inner_product
Matrix inner product and norm.
hs_inner_product(matrix_1, matrix_2)
Hilbert-Schmidt product of two matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix_1 |
Matrix
|
first matrix |
required |
matrix_2 |
Matrix
|
second matrix |
required |
Raises:
Type | Description |
---|---|
ValueError
|
Matrix type is not array or scipy sparse. |
Returns:
Name | Type | Description |
---|---|---|
Number |
Number
|
scalar value of the product. |
Source code in qoptcraft/math/mat_inner_product.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
hs_norm(matrix)
Hilbert-Schmidt norm of a matrix
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix |
Matrix
|
a matrix. |
required |
Returns:
Name | Type | Description |
---|---|---|
Number |
float
|
the norm. |
Source code in qoptcraft/math/mat_inner_product.py
50 51 52 53 54 55 56 57 58 59 |
|
hs_scalar_product(matrix_1, matrix_2)
Hilbert-Schmidt product of two matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix_1 |
Matrix
|
first matrix |
required |
matrix_2 |
Matrix
|
second matrix |
required |
Raises:
Type | Description |
---|---|
ValueError
|
Matrix type is not array or scipy sparse. |
Returns:
Name | Type | Description |
---|---|---|
Number |
Number
|
scalar value of the product. |
Source code in qoptcraft/math/mat_inner_product.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|