-
Notifications
You must be signed in to change notification settings - Fork 39
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
Divide Util.hpp and fix some bugs there #228
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #228 +/- ##
=======================================
Coverage 99.71% 99.71%
=======================================
Files 4 4
Lines 351 351
=======================================
Hits 350 350
Misses 1 1
Continue to review full report at Codecov.
|
} else if constexpr (std::is_same_v<T, double>) { | ||
cblas_zgemm(CblasRowMajor, CblasNoTrans, tr, m, n, k, &co, m_left, | ||
k, m_right, transpose ? n : k, &cz, m_out, n); | ||
} |
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.
FYI, the previous code was
pennylane-lightning/pennylane_lightning/src/util/Util.hpp
Lines 973 to 979 in 8b9d412
if constexpr (std::is_same_v<T, float>) { | |
cblas_cgemm(CblasRowMajor, tr, CblasNoTrans, m, n, k, &co, m_left, | |
k, m_right, n, &cz, m_out, n); | |
} else if constexpr (std::is_same_v<T, double>) { | |
cblas_zgemm(CblasRowMajor, tr, CblasNoTrans, m, n, k, &co, m_left, | |
k, m_right, n, &cz, m_out, n); | |
} |
res[i] = std::get<1>(arr[i]); | ||
} | ||
return res; | ||
} |
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.
FYI, this function was the same as fist_elts_of
previously. Besides these two functions, every other functions are the same.
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.
Great job on this @chaeyeunpark
That refactor was definitely needed (and nice work on the bug fixes too!)
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! Also, thanks for fixing those bugs 🙂
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: After several recent commits,
Util.hpp
file becomes >1000 lines, and some hidden bugs are found. This PR (1) divides this file into smaller files and (2) fix bugs.Description of the Change: Divide
Util.hpp
intoLinearAlgebra.hpp
,ConstantUtil.hpp
, andBitUtil.hpp
. Also fixes bugs insecond_elts_of
andmatrixMatProd
. Also changedCMakeLists.txt
andMakefile
.Benefits: Slightly better compile time.
Possible Drawbacks:
Related GitHub Issues:
Closes #227