sf.apps.similarity.orbit_to_sample

orbit_to_sample(orbit, modes)[source]

Generates a sample selected uniformly at random from the specified orbit.

Example usage:

>>> orbit_to_sample([2, 1, 1], 6)
[0, 1, 2, 0, 1, 0]
Parameters
  • orbit (list[int]) – orbit to generate a sample from

  • modes (int) – number of modes in the sample

Returns

a sample in the orbit

Return type

list[int]