Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bloch sphere deformed for matplotlib >= 3.3.0 #1385

Closed
steffen-micdev opened this issue Nov 18, 2020 · 2 comments · Fixed by #1496
Closed

Bloch sphere deformed for matplotlib >= 3.3.0 #1385

steffen-micdev opened this issue Nov 18, 2020 · 2 comments · Fixed by #1496
Labels

Comments

@steffen-micdev
Copy link

steffen-micdev commented Nov 18, 2020

Describe the bug
When plotting the Bloch sphere with qutip and matplotlib >=3.3.0 the sphere appears deformed in z-direction.
This is a result of a change in matplotlib Axes3D: https://matplotlib.org/3.3.0/users/whats_new.html#d-axes-improvements

To Reproduce

import qutip
b = qutip.Bloch()
b.show()

Work around

  1. downgrade to matplotlib 3.2.2
    or
  2. set aspect ratio manually
import qutip
b = qutip.Bloch()
b.show()
if hasattr(b.axes, 'set_box_aspect'):
    b.axes.set_box_aspect([1,1,1])

Environment
QuTiP Version: 4.5.2
Numpy Version: 1.19.2
Scipy Version: 1.5.2
Cython Version: 0.29.21
Matplotlib Version: 3.3.2
Python Version: 3.7.9
Number of CPUs: 6
BLAS Info: INTEL MKL
OPENMP Installed: False
INTEL MKL Ext: True
Platform Info: Linux (x86_64)

@paniash
Copy link
Contributor

paniash commented Nov 23, 2020

This is an issue with matplotlib rather than QuTiP. A possible workaround is downgrading to version 3.2.2.

@jakobjakobson13
Copy link
Contributor

The underlying reason is that matplotlib made some changes in the Axes3D module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants