Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Closes #557, in-place implementation of expval for LightningQubit #565
base: master
Are you sure you want to change the base?
Closes #557, in-place implementation of expval for LightningQubit #565
Changes from 9 commits
364fc45
756033b
8c18563
edb97a5
44d8c17
200d5b1
93866d3
ba48a7f
a09e88b
803bc42
815faa1
d1a0e32
2013366
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 31 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L31
Check warning on line 37 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L35-L37
Check warning on line 39 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L39
Check warning on line 42 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L42
Check warning on line 48 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L48
Check warning on line 185 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L185
Check warning on line 194 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L187-L194
Check warning on line 196 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L196
Check warning on line 201 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L200-L201
Check warning on line 203 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L203
Check warning on line 217 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/ExpValFunctorsLQubit.hpp#L217
Check warning on line 211 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp#L211
Check warning on line 213 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp#L213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sbohloul , nice work there. If you have time, I'd like us to update and merge this PR. We should first merge
master
in this branch, update the CHANGELOG and fix conflicts accordingly. Next, I would like us to change the implementation to avoid the use of functors. This is too much boilerplate for host-only code (sometimes required for device-generic code as in Kokkos however). Could you have a look at the LM kernels'sapplyNC1
? Could we write a lambda-templated method that accumulates the expval of a generic gate? We could then simply write something likeCheck warning on line 223 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp#L223
Check warning on line 227 in pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp
Codecov / codecov/patch
pennylane_lightning/core/src/simulators/lightning_qubit/measurements/MeasurementsLQubit.hpp#L225-L227