Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error in grader #20

Closed
1 task done
p-j-r opened this issue Nov 19, 2021 · 5 comments
Closed
1 task done

[BUG] Error in grader #20

p-j-r opened this issue Nov 19, 2021 · 5 comments

Comments

@p-j-r
Copy link

p-j-r commented Nov 19, 2021

Node number

Codercise I.14.2

Expected behavior

IMPLEMENT THE MULTIPLEXER
IF STATE OF FIRST TWO QUBITS IS 01, APPLY X TO THIRD QUBIT

qml.MultiControlledX(control_wires=[0,1], wires=2, control_values='01')
The above code should result in the desired behaviour, that is, give the correct output.

Actual behavior

Incorrect: your circuit does not have the correct action on |01>.

Is however, the error being raised!

Additional information

No response

Source code

No response

Tracebacks

No response

  • I have searched existing GitHub issues to make sure the issue does not already exist.
@p-j-r p-j-r changed the title [BUG] [BUG] Error in grader Nov 19, 2021
@glassnotes
Copy link
Collaborator

Hi @p-j-r , thanks for bringing this up! Would you be able to post your full solution code for this problem so I can investigate?

@p-j-r
Copy link
Author

p-j-r commented Nov 19, 2021

image

@glassnotes
Copy link
Collaborator

Hi @p-j-r, the first MultiControlledX has the correct effect on the |01> state, but if you check further down, qml.CRZ(np.pi, wires=[1, 2]) also affects the case where the first two qubits are in |01> since it is a control from wire 1 in state |1> to wire 2; this is why it's saying the results for the |01> case are not correct. If you have any conceptual questions about this, please feel free to ask them on the PennyLane forum and we can discuss in more detail! 🙂

@p-j-r
Copy link
Author

p-j-r commented Nov 20, 2021

Alright, got it. Will work around that. Thank you!

@glassnotes
Copy link
Collaborator

No problem, I will close this issue then, feel free to open another if needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants