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

Default Qutrit #2783

Merged
merged 217 commits into from Aug 2, 2022
Merged

Default Qutrit #2783

merged 217 commits into from Aug 2, 2022

Conversation

mudit2812
Copy link
Contributor

Context:
There are very few simulators available today that offer qudit simulation. One notable example is Google's Cirq, which includes support for qudit operations. However, the simulator is far from complete, and a key drawback is the lack of operations available, which creates a need for users to define operations themselves. Popular libraries such as Qiskit and QuTiP also include some qudit manipulation capabilities, but with few use cases. Beyond these libraries, qudit simulation solutions are quite limited. Moreover, qudit simulation is a feature that is already in demand, as seen in this issue on the PennyLane repository.

This PR adds a default.qutrit plugin to PennyLane to support pure state simulation of qutrits.

Description of the Change:

  • Added default.qutrit plugin to PennyLane to support pure state simulation of qutrits. The device currently supports the operation qml.QutritUnitary and measurements qml.probs() and qml.state().

Benefits:

  • Users can now easily perform pure state simulation of qutrits.

Possible Drawbacks:

Related GitHub Issues:
#2190

Copy link
Contributor

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @mudit2812 👌 Mostly questions in my review

Did I miss it or is there a test for the new qutrit unitary operation missing? Or would this fall into a separate PR?

The building of docs also failed when I was checking it, so I did not look at the documentation yet.

pennylane/devices/default_qutrit.py Show resolved Hide resolved
pennylane/devices/default_qutrit.py Show resolved Hide resolved
pennylane/devices/default_qutrit.py Show resolved Hide resolved
pennylane/devices/default_qutrit.py Show resolved Hide resolved
pennylane/devices/default_qutrit.py Show resolved Hide resolved
tests/conftest.py Show resolved Hide resolved
@mudit2812
Copy link
Contributor Author

I think I've accidentally merged changes from a different branch into this PR. I'm going to push a new commit with reverted changes for all files that shouldn't be here.

@mudit2812
Copy link
Contributor Author

Should be good for review again :)

Copy link
Contributor

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I completely missed the whole file test_default_qutrit.py in my first review as it was not automatically expanded in the files changed tab. I am bit confused what is going on here with include_verses_with_test_data function and the fixtures allowing to use qutrit_device_1_wire.

tests/devices/test_default_qutrit.py Show resolved Hide resolved
tests/devices/test_default_qutrit.py Outdated Show resolved Hide resolved
Copy link
Contributor

@antalszava antalszava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @mudit2812! 🎉 👏

No real blockers, would just like to make another pass once the comments have been addressed.

doc/releases/changelog-dev.md Show resolved Hide resolved
pennylane/_qutrit_device.py Outdated Show resolved Hide resolved
pennylane/devices/default_qutrit.py Show resolved Hide resolved
pennylane/devices/default_qutrit.py Show resolved Hide resolved
pennylane/devices/default_qutrit.py Show resolved Hide resolved
tests/devices/test_default_qutrit.py Show resolved Hide resolved
tests/devices/test_default_qutrit.py Outdated Show resolved Hide resolved
tests/devices/test_default_qutrit.py Outdated Show resolved Hide resolved
tests/devices/test_default_qutrit.py Outdated Show resolved Hide resolved
tests/devices/test_default_qutrit.py Show resolved Hide resolved
mudit2812 and others added 9 commits August 1, 2022 12:20
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
@mudit2812
Copy link
Contributor Author

I think all comments have been addressed. Assuming all checks pass, let me know if any other changes are needed 😄

Copy link
Contributor

@antalszava antalszava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🙂 🎉

One thing: it would be great to have the ADR explicitly reflect the decisions made in the PR w.r.t. the device class organization.

@glassnotes glassnotes merged commit f4cf779 into PennyLaneAI:master Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants