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 clang-tidy checks, runtime and compile time information, a C++ kernel test #253

Merged
merged 48 commits into from
Mar 21, 2022

Conversation

chaeyeunpark
Copy link
Contributor

@chaeyeunpark chaeyeunpark commented Mar 10, 2022

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 the
    change, 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: As PR #245 becomes too huge, splitting is required. This is the first part of it.

Description of the Change: There are miscellaneous changes. Some are listed below:

  • Update .clang-tidy and source code accordingly.
  • Documents now only use header files to suppress lots of clutters.
  • Python files in doc are formatted.
  • Add support to obtain compiled and runtime information through a binary file
  • Add a test comparing gate operations between different kernels (Test_GateImplementations_CompareKernels.cpp)
  • Fix a bug in tests/test_measure.py (a single qubit state is provided but dev.probability is called with two wires)

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@github-actions
Copy link
Contributor

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.

@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #253 (b0c17a5) into master (35a7403) will not change coverage.
The diff coverage is 100.00%.

❗ Current head b0c17a5 differs from pull request most recent head dcb9a95. Consider uploading reports for the commit dcb9a95 to get more accurate results

@@            Coverage Diff            @@
##            master      #253   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          379       379           
=========================================
  Hits           379       379           
Impacted Files Coverage Δ
pennylane_lightning/_version.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35a7403...dcb9a95. Read the comment docs.

option_spec = {'name': directives.unchanged,
'description': directives.unchanged,
'link': directives.unchanged}
option_spec = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is just formatted using black

@@ -8,19 +8,20 @@
import warnings
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is also just formatted with black

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2022

Test Report (C++) on Ubuntu

           1 files  ±           0             1 suites  ±0   0s ⏱️ ±0s
       660 tests +         99         660 ✔️ +         99  0 💤 ±0  0 ±0 
228 174 runs  +225 875  228 174 ✔️ +225 875  0 💤 ±0  0 ±0 

Results for commit dcb9a95. ± Comparison against base commit 35a7403.

♻️ This comment has been updated with latest results.

@chaeyeunpark chaeyeunpark requested review from mlxd and maliasadi and removed request for mlxd March 10, 2022 02:02
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Nice work @chaeyeunpark! Looking forward to review the followup PRs 🚀

bin/utils.py Show resolved Hide resolved
bin/utils.py Show resolved Hide resolved
cmake/process_options.cmake Show resolved Hide resolved
bin/utils.py Outdated Show resolved Hide resolved
doc/conf.py Outdated Show resolved Hide resolved
pennylane_lightning/src/util/CMakeLists.txt Show resolved Hide resolved
pennylane_lightning/src/util/RuntimeInfo.hpp Show resolved Hide resolved
pennylane_lightning/src/util/RuntimeInfo.cpp Outdated Show resolved Hide resolved
chaeyeunpark and others added 2 commits March 14, 2022 16:09
Co-authored-by: Ali Asadi <ali@xanadu.ai>
Co-authored-by: Ali Asadi <ali@xanadu.ai>
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.

Nice work @chaeyeunpark
I have a few comments and suggestions.

.github/workflows/format.yml Show resolved Hide resolved
pennylane_lightning/src/.clang-tidy Show resolved Hide resolved
pennylane_lightning/src/bindings/Bindings.hpp Outdated Show resolved Hide resolved
pennylane_lightning/src/bindings/Bindings.hpp Show resolved Hide resolved
pennylane_lightning/src/util/LinearAlgebra.hpp Outdated Show resolved Hide resolved
pennylane_lightning/src/util/Macros.hpp Outdated Show resolved Hide resolved
pennylane_lightning/src/util/Macros.hpp Show resolved Hide resolved
pennylane_lightning/src/util/Macros.hpp Show resolved Hide resolved
pennylane_lightning/src/util/Macros.hpp Outdated Show resolved Hide resolved
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.

This is fantasic @chaeyeunpark

I have a few questions:

@@ -68,7 +72,7 @@ def __getattr__(cls, name):
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.6'
needs_sphinx = "3.3"
Copy link
Member

Choose a reason for hiding this comment

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

I assume this matches the other PL repo sphinx versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is from Ali's request. #253 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

@@ -231,22 +231,22 @@ def __getattr__(cls, name):
"download_button": "#19b37b",
}

edit_on_github_project = 'XanaduAI/pennylane-lightning'
edit_on_github_branch = 'master/doc'
edit_on_github_project = "PennyLaneAI/pennylane-lightning"
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, but is it from Ali 😄

@chaeyeunpark chaeyeunpark changed the title Pre better kernel dispatch (miscellaneous) Add clang-tidy checks, support for runtime and compile time information, C++ kernel test Mar 19, 2022
@chaeyeunpark chaeyeunpark changed the title Add clang-tidy checks, support for runtime and compile time information, C++ kernel test Add clang-tidy checks, runtime and compile time information, C++ kernel test Mar 20, 2022
@chaeyeunpark chaeyeunpark changed the title Add clang-tidy checks, runtime and compile time information, C++ kernel test Add clang-tidy checks, runtime and compile time information, a C++ kernel test Mar 20, 2022
@chaeyeunpark
Copy link
Contributor Author

Hi @mlxd, I have cleared documents and renamed the PR. The documentation for adding kernel remains the same in this PR but will be changed in a subsequent PR.

@chaeyeunpark chaeyeunpark requested a review from mlxd March 21, 2022 13:39
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Great work @chaeyeunpark! I couldn't find anything else to add.

@chaeyeunpark chaeyeunpark merged commit 92a819b into master Mar 21, 2022
@chaeyeunpark chaeyeunpark deleted the pre_better_kernel_dispatch branch March 21, 2022 19:35
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