Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【PaddlePaddle Hackathon】78 实现密度矩阵可视化 #29

Merged
merged 2 commits into from
Nov 22, 2021
Merged

【PaddlePaddle Hackathon】78 实现密度矩阵可视化 #29

merged 2 commits into from
Nov 22, 2021

Conversation

gsq7474741
Copy link
Contributor

【PaddlePaddle Hackathon】78 实现密度矩阵可视化

PR types

New features

PR changes

APIs

Describe

@gsq7474741
Copy link
Contributor Author

@Quleaf

@gsq7474741
Copy link
Contributor Author

@TCChenlong

@Quleaf
Copy link
Collaborator

Quleaf commented Nov 17, 2021

使用以下代码测试,显示的图片会有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()

@gsq7474741
Copy link
Contributor Author

@Quleaf 感谢指正,已修复

@Quleaf Quleaf merged commit 34bb545 into PaddlePaddle:master Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants