File: bloch_ex1.py

package info (click to toggle)
qutip 5.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,868 kB
  • sloc: python: 44,578; cpp: 456; makefile: 175; sh: 16
file content (17 lines) | stat: -rw-r--r-- 250 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import numpy as np
import qutip

b = qutip.Bloch()
th = np.linspace(0, 2*np.pi, 20)

xp = np.cos(th)
yp = np.sin(th)
zp = np.zeros(20)

xz = np.zeros(20)
yz = np.sin(th)
zz = np.cos(th)

b.add_points([xp, yp, zp])
b.add_points([xz, yz, zz])
b.show()