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

Ncontr add gens #555

Merged

Conversation

vincentmr
Copy link
Contributor

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:

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@vincentmr vincentmr added the ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request label Nov 9, 2023
Copy link
Contributor

github-actions bot commented Nov 9, 2023

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

codecov bot commented Nov 9, 2023

Codecov Report

Attention: 66 lines in your changes are missing coverage. Please review.

Comparison is base (9273fa4) 11.81% compared to head (8929210) 96.51%.
Report is 3 commits behind head on sc-39665-support-arbitrary-controlled-operations-in.

Additional details and impacted files
@@                                   Coverage Diff                                    @@
##           sc-39665-support-arbitrary-controlled-operations-in     #555       +/-   ##
========================================================================================
+ Coverage                                                11.81%   96.51%   +84.69%     
========================================================================================
  Files                                                       10      144      +134     
  Lines                                                     1151    17531    +16380     
========================================================================================
+ Hits                                                       136    16920    +16784     
+ Misses                                                    1015      611      -404     
Files Coverage Δ
pennylane_lightning/core/_version.py 100.00% <100.00%> (ø)
...ane_lightning/core/src/algorithms/JacobianData.hpp 100.00% <100.00%> (ø)
...core/src/algorithms/tests/Test_AdjointJacobian.cpp 100.00% <100.00%> (ø)
...it/algorithms/tests/Test_VectorJacobianProduct.cpp 100.00% <100.00%> (ø)
.../lightning_qubit/gates/AssignKernelMap_Default.cpp 100.00% <100.00%> (ø)
...src/simulators/lightning_qubit/gates/KernelMap.hpp 100.00% <ø> (ø)
...simulators/lightning_qubit/gates/KernelMap_X64.cpp 100.00% <100.00%> (ø)
...lators/lightning_qubit/gates/OpToMemberFuncPtr.hpp 60.00% <ø> (ø)
...imulators/lightning_qubit/gates/RegisterKernel.hpp 95.06% <100.00%> (ø)
...gates/cpu_kernels/GateImplementationsAVXCommon.hpp 100.00% <ø> (ø)
... and 10 more

... and 119 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vincentmr vincentmr marked this pull request as ready for review November 9, 2023 19:08
@vincentmr vincentmr merged commit aab2585 into sc-39665-support-arbitrary-controlled-operations-in Nov 9, 2023
@vincentmr vincentmr deleted the ncontr_add_gens branch November 9, 2023 19:18
vincentmr added a commit that referenced this pull request Dec 8, 2023
* Add failing tests.

* Add revWireParityN.

* Fix applyMultiQubitOp implementation.

* Auto update version

* Update changelog

* Refactor revWireParity overloads.

* WIP fix Kokkos too.

* Fix bug in multiQubitOpFunctor

* Refactor unitary/hermitian tests and fix L-Kokkos multiQubit kernels.

* Fix L-Qubit BitUtil.

* Include algorithm header in BitUtil (sort).

* Fix tidy issue. Fix failing test.

* Make wires2Parity inline.

* Update changelog.

* Update pennylane_lightning/core/src/utils/BitUtil.hpp

Co-authored-by: Amintor Dusko <[email protected]>

* Init implementation for ControlledQubitUnitary

* WIP

* WIP

* Move applyNQubitOp to LM kernels.

* Register NQubitOp and add inverse branch in applyNQubitOp.

* Auto update version

* Update changelog.

* Add test to improve controlled_matrix coverage.

* Fix tidy warning.

* Add doc [skip ci].

* Auto update version

* trigger CI

* WIP

* WIP

* Fix NCRZ kernel registration and add tests.

* Add NCRY.

* Add NCRX.

* Create generic entry point for n-controlled kernels.

* Add NC[X-Z]

* Special treatment for MultiControlledX.

* Add Hadamard, S, T, PhaseShift n-controlled gates.

* Auto update version

* Fix compiler warnings.

* Address some of Lee's comments about naming and PL_ABORT.

* Call NC kernels from non-NC ones.

* Further reduce LM kernel code.

* Template applyNC on has_controls.

* Fix nw_tot if not has_controls

* Branch template top level.

* Auto update version

* Ncontr add gens (#555)

* Add ControlledGeneratorOperation (compiles).

* Add applyNCGeneratorPhaseShift implementation.

* WIP

* Fix PhaseShift adjoint test.
Use generic names in controlled ops enums.
Fix applyOperation/Generator methods in StateVectorLQubit.
Add R[X-Z] n-controlled generators.
Properly register n-controlled generators in dynamic dispatcher.

* All C++ test passing. Add n-controls to phaseshift test.

* Simplify n-controlled generators.

* Fix Python bindings.

* Add n-controlled to _serialize. Add controlled adjoint diff example in tests.

* Add n-controlled 2-qubit gates.

* Formatting and doc.

* Fix GPU-MPI bindings & mpitests.

* Auto update version

* Add skipif guard.

* Fix noarch test

* Fix bug in applyNCGen and reuse in applyGenR[X-Z].

* Fix pytest.skipif in adjoint tests.

* Add n-controlled double-qubit gate generators.

* Test multicontrolled two-qubit gates.

---------

Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>

* Remove whitelines [skip ci]

* Fix codefactor warning.

* Auto update version

* Add tests for n-controlled kernels.

* Auto update version

* Fix tidy check.

* Add C++ tests for controlled gates.

* Remove whitespace.

* Fix clang-tidy warning.

* Fix ctrl adjoint diff c++ test.

* Add tests for n-controlled unitaries.

* Capture more n-controlled ops in L-Qubit.

* Fix GPU workflow names.

* Move controlled ops to private method.

* Add coverage and fix gpu trigger.

* Fix codecov uploads.

* Update .github/CHANGELOG.md [skip ci]

Co-authored-by: Amintor Dusko <[email protected]>

* Update pennylane_lightning/core/src/simulators/lightning_qubit/StateVectorLQubit.hpp [skip ci]

Co-authored-by: Amintor Dusko <[email protected]>

* Update pennylane_lightning/core/src/simulators/lightning_qubit/StateVectorLQubit.hpp [skip ci]

Co-authored-by: Amintor Dusko <[email protected]>

* Update pennylane_lightning/core/src/simulators/lightning_qubit/StateVectorLQubit.hpp [skip ci]

Co-authored-by: Amintor Dusko <[email protected]>

* Update pennylane_lightning/core/_serialize.py

Co-authored-by: Amintor Dusko <[email protected]>

* Reorder controlled routine gate < generator < matrix.

* Fix typos.

* Auto update version

* trigger ci

* Serialize unfound ops as controlled qubit unitaries.

* Update pennylane_lightning/core/src/simulators/lightning_qubit/algorithms/tests/Test_VectorJacobianProduct.cpp [skip ci]

Co-authored-by: Amintor Dusko <[email protected]>

* Update pennylane_lightning/core/src/simulators/lightning_qubit/algorithms/tests/Test_VectorJacobianProduct.cpp [skip ci]

Co-authored-by: Amintor Dusko <[email protected]>

* Fix wrong LCOV guards.

* Update pennylane_lightning/core/src/algorithms/JacobianData.hpp [skip ci]

Co-authored-by: Shuli Shu <[email protected]>

* Update pennylane_lightning/core/src/algorithms/JacobianData.hpp [skip ci]

Co-authored-by: Shuli Shu <[email protected]>

* Auto update version

* Address Shuli's comments.

* Address Lee's comments.

* WIP

* Add n-controlled DoubleExcitation gate.

* Add double excitation gates + cpp tests.

* Add python tests.

* Add adjoint diff support for double excitation gates.

* Use FD to compute jac on adjoint tests.

* Fix tidy warning.

* Update pennylane_lightning/core/src/simulators/lightning_kokkos/StateVectorKokkos.hpp [skip ci]

Co-authored-by: Amintor Dusko <[email protected]>

* Auto update version

* Refactor applyNCMultiQubitOp and add doc in GateImplLM.hpp.

* Add n-controlled 1- and 2-qubit unitaries.

* Refactor Constant.hpp according to Amintor's suggestions.

* Add single/twoqubit n-controlled ops.

* Move lightning_ops to conftest.

* Fix noarch import.

* Fix tidy warning

* Fix tidy warning.

* Small optim on parity2indices.

* Handle generic control_values in controlled ops at the Python layer.

* Auto update version

* trigger ci

* Apply 1-qubit 1-controlled gates as non-controlled 2-qubit gates.

* Fix maybe_unused.

* Remove comments.

---------

Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Amintor Dusko <[email protected]>
Co-authored-by: Shuli Shu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant