sf.apps.similarity.feature_vector_orbits_sampling

feature_vector_orbits_sampling(samples, list_of_orbits)[source]

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

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

Example usage:

>>> from strawberryfields.apps import data
>>> samples = data.Mutag0()
>>> feature_vector_orbits_sampling(samples, [[1,1], [2], [2,1,1], [1,1,1,1]])
[0.19035, 0.0, 0.05175, 0.1352]
Parameters
  • samples (list[list[int]]) – a list of samples

  • list_of_orbits (list[list[int]]) – a list of orbits

Returns

a feature vector made up of estimated orbit probabilities in the same order as list_of_orbits

Return type

list[float]