-
Notifications
You must be signed in to change notification settings - Fork 40
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 C++ unit tests for Exact Tensor Network backends #998
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## add_exatn_cpp #998 +/- ##
==================================================
+ Coverage 39.15% 88.93% +49.78%
==================================================
Files 43 108 +65
Lines 2955 16524 +13569
==================================================
+ Hits 1157 14696 +13539
- Misses 1798 1828 +30 ☔ View full report in Codecov by Sentry. |
pennylane_lightning/core/src/simulators/lightning_tensor/CMakeLists.txt
Outdated
Show resolved
Hide resolved
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.
Few comments, but overall good.
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/CMakeLists.txt
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/CMakeLists.txt
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/CMakeLists.txt
Outdated
Show resolved
Hide resolved
...ightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_ExaTNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/tests/CMakeLists.txt
Outdated
Show resolved
Hide resolved
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.
Nice work @LuisAlfredoNu! Just a few suggestions:
- Update changelog,
- Merge ETN and MPS C++ unit tests, and
- Include your PL script as code comments to C++ tests files
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...ing/core/src/simulators/lightning_tensor/tncuda/measurements/tests/Test_ExaTNCuda_Expval.cpp
Outdated
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...e_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_NonParam.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_Param.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_Param.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_Param.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_Param.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_Param.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_Param.cpp
Outdated
Show resolved
Hide resolved
...lane_lightning/core/src/simulators/lightning_tensor/tncuda/gates/tests/Test_TNCuda_Param.cpp
Outdated
Show resolved
Hide resolved
|
||
template <typename TNDevice_T> | ||
inline void | ||
tn_state_append_mps_final_state(std::unique_ptr<TNDevice_T> const &tn_state) { |
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.
Why not applying this method across all the tests, instead of measurements only?
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.
We are applying this method on measurements and gates. Would you like to use this method on observables test too?
TEMPLATE_LIST_TEST_CASE("TNCuda::applyMPO::2+_wires", "[TNCuda_Nonparam]", | ||
TestMPSBackends) { |
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.
TypeList only with MPS backends
|
||
using TNDevice_T = TestType; | ||
using cp_t = typename TNDevice_T::ComplexT; | ||
// using Precision_T = typename TNDevice_T::PrecisionT; |
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.
Please remove this commented line. Thanks
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.
Done!
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.
Thanks @LuisAlfredoNu . One final comment and happy to approve after resolving it.
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.
Thanks @LuisAlfredoNu ! Nice work! Happy to approve.
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
tests
directory!All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
.github/CHANGELOG.md
file, summarizing thechange, and including a link back to the PR.
Ensure that code is properly formatted by running
make format
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
Lightning.tensor device adding TN backend
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues:
[sc-77835]