Nobisuke
Dekisugi
RAG
Privacy policy
2022/11/07 02:53
We will actually build a quantum circuit about Dicke state generation. the previous article is here.
https://blueqat.com/yuichiro_minato2/4190e59f-4f2a-4593-b880-c336b177b3f5
the reference is
https://arxiv.org/pdf/1904.07358.pdf
I would like to start by creating a 01/10 Dicke state from the classic bit of 01.
The circuit is going to use CX and CRY, the angles are
Let's use numpy backend to get state vec. I forgot to implement CRY into TN backend...
|0> -----C--RY--C--
| | |
|0> --X--X--C---X--
Copy from blueqat import Circuit import numpy as np l=1 n=2 circ = Circuit(2).x[1].cx[0,1].cry(2*np.arccos(np.sqrt(l/n)))[1,0].cx[0,1] circ.run(backend="numpy")
array([0. +0.j, 0.70710678+0.j, 0.70710678+0.j, 0. +0.j])
Copy circ.m[:].run(backend="numpy",shots=1000)
Counter({'10': 530, '01': 470})
done! next!
|001> + |010> + |100>
|0> ---------------C--RY--C--
| | |
|0> -----C--RY--C--X--C---X--
| | |
|0> --X--X--C---X------------
Copy circ2 = Circuit(3).x[2].cx[1,2].cry(2*np.arccos(np.sqrt(1/3)))[2,1].cx[1,2].cx[0,1].cry(2*np.arccos(np.sqrt(1/2)))[1,0].cx[0,1] circ2.run(backend="numpy")
array([0. +0.j, 0.57735027+0.j, 0.57735027+0.j, 0. +0.j,
0.57735027+0.j, 0. +0.j, 0. +0.j, 0. +0.j])
Copy circ2.m[:].run(backend="numpy",shots=1000)
Counter({'100': 360, '001': 299, '010': 341})
Done! Next we try
|011> + |110> + |101>
|0> ---------------C--RY--C--C--RY--C--
| | | | | |
|0> --X--C--RY--C--|--C---|--X--C---X--
| | | | | |
|0> --X--X--C---X--X--C---X------
I havent prepare CCRY, so instead we use CCRY = RY(theta)-CCX-RY(-theta)-CCX
Copy circ3 = Circuit(3).x[1,2].cx[1,2].cry(2*np.arccos(np.sqrt(1/3)))[2,1].cx[1,2].cx[0,2].ry(np.arccos(np.sqrt(2/3)))[0].ccx[2,1,0].ry(-np.arccos(np.sqrt(2/3)))[0].ccx[2,1,0].cx[0,2].cx[0,1].cry(2*np.arccos(np.sqrt(1/2)))[1,0].cx[0,1] circ3.run(backend="numpy")
array([0. +0.j, 0. +0.j, 0. +0.j, 0.57735027+0.j,
0. +0.j, 0.57735027+0.j, 0.57735027+0.j, 0. +0.j])
Copy circ3.m[:].run(backend="numpy",shots=1000)
Counter({'101': 314, '011': 339, '110': 347})
Done! Perfect.
© 2024, blueqat Inc. All rights reserved