sf.apps.qchem.vibronic.sample¶
-
sample
(t, U1, r, U2, alpha, n_samples, loss=0.0)[source]¶ Generate samples for computing vibronic spectra. The following gates are applied to input vacuum states:
Two-mode squeezing on all \(2N\) modes with parameters
t
Interferometer
U1
on the first \(N\) modesSqueezing on the first \(N\) modes with parameters
r
Interferometer
U2
on the first \(N\) modesDisplacement on the first \(N\) modes with parameters
alpha
A sample is generated by measuring the number of photons in each of the \(2N\) modes. In the special case that all of the two-mode squeezing parameters
t
are zero, only \(N\) modes are considered, which speeds up calculations.Example usage:
>>> formic = data.Formic() >>> w = formic.w >>> wp = formic.wp >>> Ud = formic.Ud >>> delta = formic.delta >>> T = 0 >>> t, U1, r, U2, alpha = gbs_params(w, wp, Ud, delta, T) >>> sample(t, U1, r, U2, alpha, 2, 0.0) [[0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
- Parameters
t (array) – two-mode squeezing parameters
U1 (array) – unitary matrix for the first interferometer
r (array) – squeezing parameters
U2 (array) – unitary matrix for the second interferometer
alpha (array) – displacement parameters
n_samples (int) – number of samples to be generated
loss (float) – loss parameter denoting the fraction of generated photons that are lost
- Returns
a list of samples from GBS
- Return type
list[list[int]]