qkd_key_rate.base.permutations module
Base class for Permutations object.
- class qkd_key_rate.base.permutations.Permutations(permutations)[source]
Bases:
object
Permutations object
- static calculate_inverted_permutations(permutations)[source]
Invert every permutation in a list of permutations
- Return type:
List
[List
[int
]]
- classmethod random_permutation(number_of_passes, message_size)[source]
Generate a random Permutations object
- Parameters:
number_of_passes (
int
) – Total number of iterationsmessage_size (
int
) – Size of the message for which to calculate the parity strategy
- Return type:
- shorten_pass(pass_idx, max_length)[source]
In some protocols, the message length decreases, this function adjusts the permutations accordingly, by discarding large indices.
- Parameters:
pass_idx (
int
) – Index of the permutation to shortenmax_length (
int
) – New message length, and maximum of the entries inpermutation (the) –
- Return type:
None