# sf.apps.similarity.feature_vector_events_sampling¶

feature_vector_events_sampling(samples, event_photon_numbers, max_count_per_mode=2)[source]

Calculates feature vector of given events with respect to input samples.

The feature vector is composed of event probabilities reconstructed by measuring the occurrence of given events in the input samples.

Example usage:

>>> from strawberryfields.apps import data
>>> samples = data.Mutag0()
>>> feature_vector_events_sampling(samples, [2, 4, 6], 2)
[0.19035, 0.2047, 0.1539]

Parameters
• samples (list[list[int]]) – a list of samples

• event_photon_numbers (list[int]) – a list of events described by their total photon number

• max_count_per_mode (int) – maximum number of photons per mode for all events

Returns

a feature vector made up of estimated event probabilities in the same order as event_photon_numbers

Return type

list[float]