XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
747 stars 186 forks source link

Error "Probabilities do not sum to 1" using GBS for simulating Vibronic Spectra of Pyrazine #597

Closed wait-a-sec closed 3 years ago

wait-a-sec commented 3 years ago

Issue description

While simulating the Vibronic Spectra of Pyrazine, I get the error "Probabilities do not sum to 1" when simulating all 24 modes. However when I use less than 3 or modes the code is able to execute. This error pops up not only in the case of large molecules or number of modes, but is present in the case of high number of samples as well. When simulating the spectra for Water, this error is present if the number of samples are taken to be 50,000.

pyrazine_ground.log pyrazine_charged.log Screenshot (119) Screenshot (118)

soranjh commented 3 years ago

Thanks @wait-a-sec. The issue might be resolved by renormalizing the probability vector, which in your examples is very likely smaller than one by a small margin. I will look into it and come back to you asap.

co9olguy commented 3 years ago

Closing as this appears to have been fixed by https://github.com/XanaduAI/thewalrus/pull/250. Feel free to reopen if the issue is not resolved