test_utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:grove 作者: rigetticomputing 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号