sf.apps.similarity.orbit_cardinality¶
-
orbit_cardinality
(orbit, modes)[source]¶ Gives the number of samples belonging to the input orbit.
For example, there are three possible samples in the orbit [2, 1, 1] with three modes: [1, 1, 2], [1, 2, 1], and [2, 1, 1]. With four modes, there are 12 samples in total.
Example usage:
>>> orbit_cardinality([2, 1, 1], 4) 12
- Parameters
orbit (list[int]) – orbit; we count how many samples are contained in it
modes (int) – number of modes in the samples
- Returns
number of samples in the orbit
- Return type
int
code/api/strawberryfields.apps.similarity.orbit_cardinality
Download Python script
Download Notebook
View on GitHub