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] Inconsistent qnode return behavior for list and tuple #6540

Open
1 task done
albi3ro opened this issue Nov 6, 2024 · 0 comments
Open
1 task done

[BUG] Inconsistent qnode return behavior for list and tuple #6540

albi3ro opened this issue Nov 6, 2024 · 0 comments
Labels
bug 🐛 Something isn't working

Comments

@albi3ro
Copy link
Contributor

albi3ro commented Nov 6, 2024

Expected behavior

I would expect identical behavior for both lists or tuples.

Actual behavior

If we return a measurement process in a list, we add back in a dimension. But if the measurement process is in a tuple, we do not add a tuple dimension back in.

Additional information

No response

Source code

@qml.qnode(qml.device('default.qubit'))
def circuit(t):
    return t([qml.expval(qml.Z(0))])
>>> circuit(tuple)
1.0
>>> circuit(list)
[1.0]

Existing GitHub issues

  • I have searched existing GitHub issues to make sure the issue does not already exist.
@albi3ro albi3ro added the bug 🐛 Something isn't working label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant