Description Usage Arguments Value Examples
View source: R/GroversAlgorithm.R
Applies Grover's search algorithm to a uniform ket to simulate a quantum search
1 | GroversAlgorithm(n,w,iterations=n,printOutput=FALSE,plotOutput=FALSE,tag="")
|
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 |
Ket after a Grover search has been applied to it
1 2 | GroversAlgorithm(7,0,14)
GroversAlgorithm(7,0,14,printOutput=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.