sf.apps.sample.postselect¶
-
postselect
(samples, min_count, max_count)[source]¶ Postselect samples by imposing a minimum and maximum number of photons or clicks.
Example usage:
>>> s = [[1, 1, 1, 1, 1], [1, 1, 0, 1, 1], [0, 0, 0, 0, 0], [1, 0, 0, 0, 1]] >>> postselect(s, 2, 4) [[1, 1, 0, 1, 1], [1, 0, 0, 0, 1]]
- Parameters
samples (list[list[int]]) – a list of samples
min_count (int) – minimum number of photons or clicks for a sample to be included
max_count (int) – maximum number of photons or clicks for a sample to be included
- Returns
the postselected samples
- Return type
list[list[int]]
code/api/strawberryfields.apps.sample.postselect
Download Python script
Download Notebook
View on GitHub