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 mcmc sampler #384

Merged
merged 58 commits into from
Mar 17, 2023
Merged

Add mcmc sampler #384

merged 58 commits into from
Mar 17, 2023

Conversation

trevor-vincent
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Just a quick one for the failures. Will do a more in-depth review later.

pennylane_lightning/src/simulator/Measures.hpp Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Merging #384 (f51d1d5) into master (08dfbe0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           master     #384    +/-   ##
========================================
  Coverage   99.82%   99.82%            
========================================
  Files          49       50     +1     
  Lines        4517     4624   +107     
========================================
+ Hits         4509     4616   +107     
  Misses          8        8            
Impacted Files Coverage Δ
pennylane_lightning/_version.py 100.00% <100.00%> (ø)
pennylane_lightning/lightning_qubit.py 99.10% <100.00%> (+0.02%) ⬆️
pennylane_lightning/src/simulator/Measures.hpp 99.52% <100.00%> (+0.14%) ⬆️
...lane_lightning/src/simulator/TransitionKernels.hpp 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks @trevor-vincent
Some suggestions regarding the test coverage. Also, can we add a docstring to each class and associated method?

pennylane_lightning/src/simulator/Measures.hpp Outdated Show resolved Hide resolved
pennylane_lightning/src/simulator/TransitionKernels.hpp Outdated Show resolved Hide resolved
pennylane_lightning/src/simulator/TransitionKernels.hpp Outdated Show resolved Hide resolved
pennylane_lightning/src/simulator/TransitionKernels.hpp Outdated Show resolved Hide resolved
pennylane_lightning/src/simulator/TransitionKernels.hpp Outdated Show resolved Hide resolved
@multiphaseCFD multiphaseCFD requested a review from mlxd November 16, 2022 14:26
@multiphaseCFD multiphaseCFD requested a review from trbromley March 10, 2023 16:17
Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @multiphaseCFD @trevor-vincent!

This looks great! How will a PL user enable the MCMC sampling mode? Aside from directly calling the device methods (which may not be known to non-expert users), it would be nice for users to be able to opt-in to MCMC sampling easily. For example, when instantiating the device qml.device("lightning.qubit", shots=100, mcmc=True) - though I'm curious if there has been any prior discussion on this?

pennylane_lightning/lightning_qubit.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_qubit.py Outdated Show resolved Hide resolved
@multiphaseCFD
Copy link
Member

multiphaseCFD commented Mar 14, 2023

Thanks @multiphaseCFD @trevor-vincent!

This looks great! How will a PL user enable the MCMC sampling mode? Aside from directly calling the device methods (which may not be known to non-expert users), it would be nice for users to be able to opt-in to MCMC sampling easily. For example, when instantiating the device qml.device("lightning.qubit", shots=100, mcmc=True) - though I'm curious if there has been any prior discussion on this?

Hi @trbromley , That's a good point! We didn't discuss that before. Let me discuss with @mlxd , then get back to you.

@multiphaseCFD multiphaseCFD requested a review from trbromley March 14, 2023 20:35
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Nothing more from me --- thanks for the work everybody!

@multiphaseCFD multiphaseCFD requested a review from vincentmr March 16, 2023 20:49
Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

Just made a couple suggestions. Happy to approve!

tests/test_measures.py Outdated Show resolved Hide resolved
Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com>
@mlxd mlxd dismissed AmintorDusko’s stale review March 17, 2023 17:16

Outdated from Nov 2022

Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @multiphaseCFD! I've left a few suggestions on the documentation side, but otherwise looks great to me!

doc/devices.rst Outdated Show resolved Hide resolved
doc/devices.rst Outdated Show resolved Hide resolved
doc/devices.rst Outdated Show resolved Hide resolved
pennylane_lightning/lightning_qubit.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_qubit.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_qubit.py Outdated Show resolved Hide resolved
multiphaseCFD and others added 6 commits March 17, 2023 15:52
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
@multiphaseCFD multiphaseCFD merged commit 1668103 into master Mar 17, 2023
@multiphaseCFD multiphaseCFD deleted the add-mcmc-sampler branch March 17, 2023 20:18
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.

6 participants