def test_visualization():
ax = Axes3D(figure())
# Without axis.
ut.state_histogram(grove.tomography.operator_utils.GS, title="test")
# With axis.
ut.state_histogram(grove.tomography.operator_utils.GS, ax, "test")
assert ax.get_title() == "test"
ptX = grove.tomography.operator_utils.PAULI_BASIS.transfer_matrix(qt.to_super(
grove.tomography.operator_utils.QX)).toarray()
ax = Mock()
with patch("matplotlib.pyplot.colorbar"):
ut.plot_pauli_transfer_matrix(ptX, ax, grove.tomography.operator_utils.PAULI_BASIS.labels, "bla")
assert ax.imshow.called
assert ax.set_xlabel.called
assert ax.set_ylabel.called
评论列表
文章目录