Hi, I have followed this demo exactly and tried to reproduce the graph shown for the vibronic spectra, yet it gives the following graph.
I have checked with the appendix of the relevant paper and tried different combinations of the frequencies and Duschinsky matrices but cannot obtain the same graph. I notice the peaks are located similarly but the counts are much different. Can someone advise on how to correct this? The same distribution occurs when using my own data for another molecule also.
import numpy as np
import strawberryfields as sf
from strawberryfields import ops
from strawberryfields.apps import vibronic, plot
import plotly
#(E)-phenylvinylacetylene:
U_vibronic = np.array([
[-0.5349105592386603, 0.8382670887228271, 0.10356058421030308, -0.021311662937477004],
[-0.6795134137271818, -0.4999083619063322, 0.5369830827402383, 0.001522863010877817],
[-0.4295084785810517, -0.17320833713971984, -0.7062800928050401, 0.5354341876268153],
[0.2601051345260338, 0.13190447151471643, 0.4495473331653913, 0.8443066531962792]
])
nr_modes = 8
eng = sf.RemoteEngine("X8")
vibronic_prog = sf.Program(nr_modes)
with vibronic_prog.context as q:
ops.S2gate(1.0) | (q[0], q[4])
ops.Interferometer(U_vibronic) | (q[0], q[1], q[2], q[3])
ops.Interferometer(U_vibronic) | (q[4], q[5], q[6], q[7])
ops.MeasureFock() | q
vibronic_results = eng.run(vibronic_prog, shots=400000)
vibronic_samples = vibronic_results.samples
vibronic_samples = [list(s) for s in vibronic_samples]
# frequencies of the initial and final normal modes
#ethylene
w = [2979, 1580, 1286, 977]
wp = [2828, 1398, 1227, 855]
energies = vibronic.energies(vibronic_samples, w, wp)
plot.spectrum(energies, xmin=-6000, xmax=6000)
Thanks