LoginSignup
1
0

More than 3 years have passed since last update.

量子コンパイラを作る。 その2

Posted at

概要

量子コンパイラを作る。

成果物

投入したソース。

make 4
in 0 1
out 2 3
and 0 1 3
xor 0 1 2

出力。

from blueqat import Circuit

print (Circuit(4).h[ : 2].cx[0, 3].cx[1, 3].ccx[0, 1, 2].m[ : ].run(shots = 1000))

実行結果

Counter({'0101': 272, '1110': 258, '1001': 249, '0000': 221})

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0