GroversAlgorithm {QuantumOps} | R Documentation |
GroversAlgorithm
Description
Applies Grover's search algorithm to a uniform ket to simulate a quantum search
Usage
GroversAlgorithm(n,w,iterations=n,printOutput=FALSE,plotOutput=FALSE,tag="")
Arguments
n |
Number of qubits in the problem, not counting the extra ancillary qubit |
w |
Integer specifying the state to search for, between 0 and 2^n-1 where n is the number of qubits |
iterations |
Number of iterations to apply the oracle and diffusion, optimal is approximately n |
printOutput |
Boolean specifying if the measurement probabilities should be printed as search progresses |
plotOutput |
Boolean specifying if the output probabilities should be plotted to a graph |
tag |
String which is attached to output file name if plotOutput is TRUE |
Value
Ket after a Grover search has been applied to it
Examples
GroversAlgorithm(7,0,14)
GroversAlgorithm(7,0,14,printOutput=TRUE)
[Package QuantumOps version 3.0.1 Index]