Ask here about the “Quantum Circuits” Codebook topic from the “Introduction to Quantum Computing” module.
Hi. I am trying to solve Codercise PF.4.2 - A strong entangler. My question is about the test_weights shape. In our special case, it should have a shape of (1, 4, 3), since we have one layer, four wires, and three parameters per wire. I have defined
test_weights = np.array([[
[0.1, 0.2, 0.3], # Qubit 1 parameters: α0, β0, δ0
[0.4, 0.5, 0.6], # Qubit 2 parameters: α1, β1, δ1
[0.7, 0.8, 0.9], # Qubit 3 parameters: α2, β2, δ2
[1.0, 1.1, 1.2] # Qubit 4 parameters: α3, β3, δ3
]])
but this error keeps being raised:
Error: Incorrect: Your test_weights array doesn’t have the right format!.
I do not understand why. I have even tried adding requires_grad = False, but still does not work. Any help would be appreciated.
Hi @marsiuniub!
Welcome to the forum and thanks for your question.
You are right, your test_weights
array has the right shape, (1, 4, 3).
This was an error on our code regarding validation tests (no need to worry about those).
We have corrected it now.
Give it another try and let me know if it works.
Now it works! Thank you very much