qkd_key_rate.base.permutations module

Base class for Permutations object.

class qkd_key_rate.base.permutations.Permutations(permutations)[source]

Bases: object

Permutations object

__add__(other)[source]

Combine two permutations

Return type:

Permutations

__len__()[source]

Return number of passes

Return type:

int

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 iterations

  • message_size (int) – Size of the message for which to calculate the parity strategy

Return type:

Permutations

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 shorten

  • max_length (int) – New message length, and maximum of the entries in

  • permutation (the) –

Return type:

None