Strange error in A.5.1

I have error Error: 'hoh_circuit'. when I submit code, which seems to be ok

challenge_code = '''n_bits = 4
dev = qml.device("default.qubit", wires=n_bits)

@qml.qnode(dev)
def hoh_circuit(combo):
    """A circuit which applies Hadamard-oracle-Hadamard and returns probabilities.
    
    Args:
        combo (list[int]): A list of bits representing a secret combination.

    Returns:
        list[float]: Measurement outcome probabilities.
    """

    ##################
    # YOUR CODE HERE #
    ##################
    qml.broadcast(qml.Hadamard, pattern='single', wires=range(n_bits))
    qml.QubitUnitary(oracle_matrix(combo), wires=range(n_bits))
    qml.broadcast(qml.Hadamard, pattern='single', wires=range(n_bits))
    return qml.probs(wires=range(n_bits))
'''

Try submit without the beginning challenge_code = ''' and trailing '''.

It seems there’s a issue when setup the input template for this problem, the text

The code template to supply to the front end. This is what the user will
be asked to complete and submit for grading.

seems not supposed seen by users. (The problem is with the new codebook, Hadamard Transform | PennyLane Codebook)

Hi @Hovnatan_Karapetyan, welcome to the forum!

That’s right @LdBeth ! It looks like forgot to change the template for this one when we moved to the new Codebook. Good catch!

Hi @Hovnatan_Karapetyan, this issue should be fixed now!
If you refresh and click on “Reset code” you should now only be seeing the correct part of the template.

1 Like