diff --git a/test_documents/test.py b/test_documents/test.py new file mode 100644 index 0000000000000000000000000000000000000000..38b676cdf428019f64d75ac37cf0eb2f9d6a9a84 --- /dev/null +++ b/test_documents/test.py @@ -0,0 +1,16 @@ +from paddle_quantum.utils import img_to_density_matrix +import paddle +import matplotlib.image +import numpy as np + + +img_file = '/home/aistudio/f1.jpeg' +rho = (img_to_density_matrix(img_file)) + +#半正定 +w,_=np.linalg.eig(rho) +print(all(w>=0)) +#迹为1 +print(np.trace(rho)) +#shape为[2**n,2**n] +print(rho.shape)