-- Deutsch-Jozsa algorithm demo (4 qbits) run("Downloads/q4.txt") -- eigenmath.org/Downloads/q4.txt -- M is measurement function, plots probability of observing each of 16 states -- Hn is Hadamard operator on qbit n -- Cmn is CNOT operator, m is control qbit, n is target qbit "Constant oracle" psi = dot(H2,H1,H0,H3,X3,H2,H1,H0,ket0000) M(psi) "Balanced oracle" psi = dot(H2,H1,H0,C23,C13,C03,H3,X3,H2,H1,H0,ket0000) M(psi)
Run