Closed gsq7474741 closed 2 years ago
@Quleaf
@TCChenlong
使用以下代码测试,显示的图片会有bug。
import numpy as np
import paddle
from paddle_quantum.circuit import UAnsatz
from paddle_quantum.utils import plot_density_graph
import matplotlib.pyplot as plt
cir = UAnsatz(3)
rng = np.random.default_rng()
a = rng.random(size=[3, 3, 3])
a = paddle.to_tensor(a)
cir.complex_entangled_layer(a, 3)
cir.ry(paddle.to_tensor(1, dtype='float64'), 0)
state = cir.run_density_matrix()
figure = plot_density_graph(state)
plt.show()
@Quleaf 感谢指正,已修复
【PaddlePaddle Hackathon】78 实现密度矩阵可视化
PR types
New features
PR changes
APIs
Describe