Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
代码:
b=qt.Bloch(axes=a) pnt = [px[:],py[:],pz[:]] b.add_points(pnt) # b.fig = plt.subplot(326) plt.title('Bloch sphere')
此代码创建小的起始图,但它是空的。 看结果截图
将 Bloch 球体显示为单独的图形效果很好。
在 show() 之前需要渲染函数。必须为创建 Bloch 实例和调用渲染分配参数(无花果和轴)。
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = subplot('211', projection='3d') b = qt.Bloch(fig=fig, axes=ax) b.render(fig=fig, axes=ax) plt.show()