C2QA / bosonic-qiskit

Extension of Qiskit to support hybrid boson-qubit simulations for the NQI C2QA effort.
BSD 2-Clause "Simplified" License
44 stars 8 forks source link

`ValueError: contour levels must be increasing` when state vector is all zeros #73

Closed tjstavenger-pnnl closed 1 year ago

tjstavenger-pnnl commented 1 year ago

@EllaCrane found that if the result of the Wigner function is all zeros (there were other code errors causing this), the plot & animate functionality tries to make a color / contour range from 0 to 0, which fails. If the min/max of the range is equal, force a range that includes the min/max to let the plot then just be empty (in the case of the zero values).