Ask here about the “Steps and Speedups” Codebook topic from the “Grover’s Algorithm” module.
Hey Catalina,
I’m kinda stuck with he inner circuit code. I know we need to implement the Grover circuit which is superpositioning all the qubits, initializing the auxiliary qubit, applying the Oracle and then applying the Diffusion operator. I did the same but the output says “the circuit doesn’t seem quite right”. I’m not sure where I’m going wrong.
Please help.
Thank you!!
def inner_circuit():
##################
# YOUR CODE HERE #
##################
# IMPLEMENT THE GROVER CIRCUIT
# Initial superpositioning of the qubits
hadamard_transform(query_register)
# Initializing the auxillary qubit
qml.PauliX(wires=aux)
qml.Hadamard(wires=aux)
# Applying the Oracle
oracle(combo)
# Applying the Diffusion operator
diffusion(n_bits)
return qml.probs(wires=query_register)
Hey Catalina,
I got it. It struck to me after reading the second problem that we don’t just apply the U.D once, we need to apply it “num_steps” times to get the right amplification of the correct combo.
Anyways, thank you for creating such a wonderful and interactive way of learning quantum computing.
I’m glad you could solve it @Krishna_Bhatia !
The Codebook is the work of a lot of people. I’ll forward your Thank you to the team!
Hi there, I found a minor typo in Codercise G.4.1a
We are searching through a space of N=2^n possibilities. Let us assume that t required is proportional to a power of N.
I suggest the following correction:
We are searching through a space of N=2^n possibilities. Let us assume that S required is proportional to a power p of N.
Great suggestion @jhanschoo !
Hi, for G.4.1b, there seems to be an issue with the type of value for ‘combo’ the code accepts. It doesnt accept “000” even though the question is set up for that to be used. There were similar issues in the past exercises too. May I know what i should do?
Hi @cyyoung ,
Thank you for pointing this out!
It should work if you change combo to: combo = [0] * n_bits
I’ll make the fix now and it should be updated in the Codebook within a few hours. Thanks for helping us improve!
Let us know if you have any additional feedback.