powered by
Applies Grover's search algorithm to a uniform ket to simulate a quantum search
GroversAlgorithm(n,w,iterations=n,printOutput=FALSE,plotOutput=FALSE,tag="")
Number of qubits in the problem, not counting the extra ancillary qubit
Integer specifying the state to search for, between 0 and 2^n-1 where n is the number of qubits
Number of iterations to apply the oracle and diffusion, optimal is approximately n
Boolean specifying if the measurement probabilities should be printed as search progresses
Boolean specifying if the output probabilities should be plotted to a graph
String which is attached to output file name if plotOutput is TRUE
Ket after a Grover search has been applied to it
# NOT RUN { GroversAlgorithm(7,0,14) GroversAlgorithm(7,0,14,printOutput=TRUE) # }
Run the code above in your browser using DataLab