Formula Used in Wigner Method in sf.backend.BaseState


I am trying to figure out which formula is being used in calculating the Wigner function when the wigner method is used within the class sf.backends.BaseState

More specifically, I want to compare the Wigner function of a squeezed state obtained from using this method with the Wigner function obtained by using the formula I attached.

When I plot the Wigner function using both methods, I get qualitatively the same plots. But they still differ in their maximum and minimum values as well as their variances.

I am new to this field, so any advice will be appreciated.

Please let me know if you’d like more information or the code itself.


Note: The formula I attached is from “Exploring the Quantum Atoms, Cavities, and Photons” by Haroche and Reimond; Eq. A.53 p. 577WignerFunctionSqueezedState

Hi @Francisco_J_Estrella — Welcome to the forum! The “hbar” convention used by Haroche and Raymond is hbar = 1. If you want to make sure you agree with their convention you can set the value of the variable sf.hbar to be theirs, i.e., 1. Note that in SF the default value of hbar is 2.

The precise methods used to generate Wigner functions in each backend can be found here:

Hope this helps,