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

Add simulate of analytic case for DefaultMixedNewAPI #6618

Merged
merged 83 commits into from
Dec 4, 2024

Conversation

JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Nov 20, 2024

Context:
The implementation of method simulate is the most important one under the architecture of new API standard. The point of simulate, is basically abstract both the analytic version (controlled by shots=None, or infinite shots in a fancier way) and the MC version (finite shots). Meanwhile, the functionality of such method should not truly depend on our details of qml implementationi; they better only rely on either the fundamental computation libs, e.g. math lib and qnp, or the most essential infras, e.g. Tape/Scripts and Operations.

Description of the Change:

  • Added qml.devices.qubit_mixed.simulate
  • Added the analytic branch of simulate
  • Added the corresponding test suites

Benefits:
Implementation of this submodule is necessary to several other PR's

Possible Drawbacks:
finite-shot branch not yet implemneted

Related GitHub Issues:
[sc-73320]

JerryChen97 and others added 30 commits November 19, 2024 10:00
Mimicing the qutrit mixed one.
@JerryChen97 JerryChen97 requested a review from astralcai December 2, 2024 22:07
pennylane/devices/qubit_mixed/measure.py Outdated Show resolved Hide resolved
pennylane/devices/qubit_mixed/simulate.py Outdated Show resolved Hide resolved
pennylane/devices/qubit_mixed/simulate.py Show resolved Hide resolved
@JerryChen97 JerryChen97 requested a review from astralcai December 4, 2024 16:25
Copy link
Contributor

@astralcai astralcai left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

I have a few comments about tidying up the tests a little bit, but looking good 🚀

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

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Thanks! 🎉

@JerryChen97 JerryChen97 enabled auto-merge (squash) December 4, 2024 21:35
@JerryChen97 JerryChen97 merged commit 06ccb60 into master Dec 4, 2024
46 checks passed
@JerryChen97 JerryChen97 deleted the add-analytic-simulate-for-mixed-new-api branch December 4, 2024 22:50
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

Successfully merging this pull request may close these issues.

3 participants