pysiglib.lyndon_words

pysiglib.lyndon_words#

Added in version v1.1.0.

lyndon_words(alphabet_size, max_length)[source]#

Returns all Lyndon words up to a given length.

Parameters:
  • alphabet_size (int) – Size of the alphabet.

  • max_length (int) – Max length of words.

Returns:

All Lyndon words up to the given length.

Return type:

list[tuple[int, …]]

Example:#

import pysiglib

# All Lyndon words up to length 3 over alphabet {0, 1}
w = pysiglib.lyndon_words(2, 3)
print(w) # [(0,), (1,), (0, 1), (0, 0, 1), (0, 1, 1)]

Citation#

If you found this library useful in your research, please consider citing the paper:

@article{shmelev2025pysiglib,
  title={pySigLib-Fast Signature-Based Computations on CPU and GPU},
  author={Shmelev, Daniil and Salvi, Cristopher},
  journal={arXiv preprint arXiv:2509.10613},
  year={2025}
}