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] Samples on qutrit device are floats instead of integers #5467

Closed
1 task done
dwierichs opened this issue Apr 3, 2024 · 1 comment
Closed
1 task done

[BUG] Samples on qutrit device are floats instead of integers #5467

dwierichs opened this issue Apr 3, 2024 · 1 comment
Labels
bug 🐛 Something isn't working

Comments

@dwierichs
Copy link
Contributor

Expected behavior

The basis state indices sampled by qml.sample are integers.

Actual behavior

The basis state indices sampled by qml.sample are converted to floats within _qubit_device.py::QubitDevice.statistics because the _asarray method is called on them.

Additional information

No response

Source code

dev = qml.device("default.qutrit", wires=1, shots=1)
@qml.qnode(dev)
def circ():
    return qml.sample(wires=0)

circ()

Tracebacks

tensor(0., requires_grad=True)

System information

pl dev

Existing GitHub issues

  • I have searched existing GitHub issues to make sure the issue does not already exist.
@dwierichs dwierichs added the bug 🐛 Something isn't working label Apr 3, 2024
@mudit2812
Copy link
Contributor

This is not impacting correctness in any way, and is an artifact of the strategy we use to track execution for backprop differentiation. So, I'm closing this issue.

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

2 participants