sf.apps.data.Dataset

class Dataset[source]

Bases: abc.ABC

Base class for loading datasets of pre-generated samples.

n_mean

mean number of photons in the GBS device

Type

float

threshold

flag to indicate whether samples are generated with threshold detection (i.e., detectors of zero or some photons) or with photon-number-resolving detectors.

Type

bool

n_samples

total number of samples in the dataset

Type

int

modes

number of modes in the GBS device or, equivalently, number of nodes in graph

Type

int

data

raw data of samples from GBS as a csr sparse array.

Type

sparse

n_mean

rtype

float

threshold

rtype

bool

n_mean
Return type

float

threshold
Return type

bool

counts([axis])

Count number of photons or clicks.

counts(axis=1)[source]

Count number of photons or clicks.

Counts number of photons/clicks in each sample (axis==1) or number of photons/clicks in each mode compounded over all samples (axis==0).

Parameters

axis (int) – axis to perform count

Returns

counts from samples

Return type

list