Linalg module¶
Norm and squared norm¶
pqlattice.linalg.norm ¶
computes the square root of the dot product of the vector with itself.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
Vector
|
|
required |
Returns:
| Type | Description |
|---|---|
float
|
|
pqlattice.linalg.norm2 ¶
computes the squared norm of a given vector, that is the dot product of vector with itself
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
Vector
|
|
required |
Returns:
| Type | Description |
|---|---|
int
|
|
pqlattice.linalg.per_row_norm ¶
Computes the list of norms of rows of a given matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
|
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
|
pqlattice.linalg.per_row_norm2 ¶
Computes the list of squared norms of rows of a given matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
|
required |
Returns:
| Type | Description |
|---|---|
list[int]
|
|
Helper functions for in place matrix operations¶
pqlattice.linalg.row_add ¶
utility function for in place row add operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Matrix
|
|
required |
i
|
int
|
target row |
required |
k
|
int
|
source row |
required |
s
|
int
|
scaling factor |
required |
pqlattice.linalg.row_scale ¶
utility function for in place row scale operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Matrix
|
|
required |
i
|
int
|
|
required |
s
|
int
|
scaling factor |
required |
pqlattice.linalg.row_swap ¶
utility function for in place row swap operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Matrix
|
|
required |
i
|
int
|
|
required |
k
|
int
|
|
required |
pqlattice.linalg.col_add ¶
utility function for in place column add operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Matrix
|
|
required |
i
|
int
|
target column |
required |
k
|
int
|
source column |
required |
s
|
int
|
scaling factor |
required |
pqlattice.linalg.col_scale ¶
utility function for in place column scale operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Matrix
|
|
required |
i
|
int
|
|
required |
s
|
int
|
scaling factor |
required |
pqlattice.linalg.col_swap ¶
utility function for in place column swap operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Matrix
|
|
required |
i
|
int
|
|
required |
k
|
int
|
|
required |
Functions for integral matrices¶
pqlattice.linalg.det ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
SquareMatrix
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |
pqlattice.linalg.left_kernel ¶
{x : xA = 0}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
Returns:
| Type | Description |
|---|---|
_type_
|
description |
pqlattice.linalg.right_kernel ¶
{x : Ax = 0}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
description |
pqlattice.linalg.left_nullity ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
Matrix
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |
pqlattice.linalg.right_nullity ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
Matrix
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |
pqlattice.linalg.rank ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
Matrix
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |
pqlattice.linalg.minor ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
SquareMatrix
|
description |
required |
i
|
int
|
description |
required |
j
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |
pqlattice.linalg.cofactor ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
SquareMatrix
|
description |
required |
i
|
int
|
description |
required |
j
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |
pqlattice.linalg.cofactor_matrix ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
SquareMatrix
|
description |
required |
Returns:
| Type | Description |
|---|---|
SquareMatrix
|
description |
Functions for matrices with coefficients from \(Z_q\)¶
pqlattice.linalg.mod_ref ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
modulus
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
tuple[Matrix, SquareMatrix]
|
description |
pqlattice.linalg.mod_rref ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
modulus
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
tuple[Matrix, SquareMatrix]
|
description |
pqlattice.linalg.mod_matinv ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
SquareMatrix
|
description |
required |
modulus
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
SquareMatrix
|
description |
pqlattice.linalg.mod_right_kernel ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
modulus
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
description |
pqlattice.linalg.mod_left_kernel ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
modulus
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
description |
pqlattice.linalg.mod_left_nullity ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
modulus
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |
pqlattice.linalg.mod_right_nullity ¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
Matrix
|
description |
required |
modulus
|
int
|
description |
required |
Returns:
| Type | Description |
|---|---|
int
|
description |