-- https://arxiv.org/abs/1703.10535 Q0 = 0 Q1 = 1 Q2 = 2 psi = (1,0,0,0,0,0,0,0) -- 3 qubits -- init psi = rotate(psi, H,Q0, H,Q1, H,Q2) -- oracle psi = rotate(psi, C,Q0, Z,Q2, C,Q1, Z,Q2) -- amplification (diffuser) psi = rotate(psi, H,Q0, H,Q1, H,Q2) psi = rotate(psi, X,Q0, X,Q1, X,Q2) psi = rotate(psi, C,Q0, C,Q1, Z,Q2) psi = rotate(psi, X,Q0, X,Q1, X,Q2) psi = rotate(psi, H,Q0, H,Q1, H,Q2) -- probability p = psi conj(psi) -- format result b = ("000","100","010","110","001","101","011","111") transpose((b,p))
Run