# sf.apps.similarity.prob_orbit_exact¶

prob_orbit_exact(graph, orbit, n_mean=5, loss=0.0)[source]

Gives the exact probability of a given orbit for the input graph.

The exact probability of an orbit is the sum of probabilities of all possible GBS output patterns that belong to it:

$p(O) = \sum_{S \in O} p(S)$

where $$S$$ are samples belonging to $$O$$.

Example usage:

>>> graph = nx.complete_graph(8)
>>> prob_orbit_exact(graph, [2, 1, 1])
0.03744399092424445

Parameters
• graph (nx.Graph) – input graph encoded in the GBS device

• orbit (list[int]) – orbit for which to calculate the probability

• n_mean (float) – total mean photon number of the GBS device

• loss (float) – fraction of photons lost in GBS

Returns

exact orbit probability

Return type

float