Symplectic group over GF2
numqi.group.spf2
canonical ordering of symplectic group elements, implements the algorithms in paper
doi-link How to efficiently select an arbitrary clifford group element
numqi.group.spf2.get_number(n, kind='base')
Get the number of elements in the symplectic group over GF(2) of order 2n.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
int
|
The order of the symplectic group. |
required |
kind
|
str
|
'base', 'order', or 'coset'. Default is 'base'. |
'base'
|
Returns:
Name | Type | Description |
---|---|---|
ret |
(int, tuple[int])
|
for |
numqi.group.spf2.get_inner_product(v0, v1)
Get symplectic inner product of two vectors GF(2).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v0
|
ndarray
|
The first vector. |
required |
v1
|
ndarray
|
The second vector. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
The symplectic inner product of two vectors. |
numqi.group.spf2.int_to_bitarray(i, n)
Convert an integer to a bit array.
int_to_bitarray(3, 4)==[1,1,0,0]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int
|
The integer to be converted. |
required |
n
|
int
|
The length of the bit array. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
The bit array. |
numqi.group.spf2.bitarray_to_int(b)
Convert a bit array to an integer.
bitarray_to_int([1,1,0,0])==3
Parameters:
Name | Type | Description | Default |
---|---|---|---|
b
|
ndarray
|
The bit array. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
int
|
The integer. |
numqi.group.spf2.schmidt_orthogonalization(vec_list)
Schmidt orthogonalization of a list of vectors using the symplectic inner product.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vec_list
|
list[ndarray]
|
A list of vectors. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
list[ndarray]
|
A list of orthogonal vectors. |
numqi.group.spf2.transvection(x, *h_list)
Apply a transvection to a vector. see doi-link
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
ndarray
|
The vector. |
required |
h_list
|
tuple[ndarray]
|
The transvection. |
()
|
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
of same shape as |
numqi.group.spf2.find_transvection(v0, v1)
find a transvection that maps v0 to v1. see doi-link Lemma 2
h0,h1 = find_transvection(v0, v1)
v1 = transvection(transvection(v0, h0), h1) = transvection(v0, h0, h1)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v0
|
ndarray
|
The first vector. |
required |
v1
|
ndarray
|
The second vector. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
The transvections. |
numqi.group.spf2.from_int_tuple(int_tuple)
Convert an integer tuple to a symplectic matrix over GF(2).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
int_tuple
|
tuple[int]
|
The integer tuple. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
The symplectic matrix. |
numqi.group.spf2.to_int_tuple(mat)
Convert a symplectic matrix over GF(2) to an integer tuple.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mat
|
ndarray
|
The symplectic matrix. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
tuple[int]
|
The integer tuple. |
numqi.group.spf2.inverse(mat)
Get the inverse of a symplectic matrix over GF(2).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mat
|
ndarray
|
The symplectic matrix. |
required |
Returns:
Name | Type | Description |
---|---|---|
ret |
ndarray
|
The inverse of the symplectic matrix. |