Add support for controlled phase gate (ControlledPhaseShift/CPhase)
Closed this issue · 2 comments
Important notes to double-check before a pull request:
1. Named this new gate CPhaseShiftGate
, to keep the name consistency of derived gates;
2. Added a bulk of comments describing this new gate at Gates.hpp:362
;
3. Matched all functionalities of this new gate with the implemented ones, however, in comparison with the Python implm., there are _eigvals
(returning eigenvalues), and decomposition methods that I wasn't sure about implementing them. Let me know if they are required too; and
4. Utilized gtest suites of lightning_gates_unittest.cpp
to test new routines.
- Named this new gate
CPhaseShiftGate
, to keep the name consistency of derived gates;
Yep, that is fine.
- Added a bulk of comments describing this new gate at
Gates.hpp:362
;
Comments are usually a good call
- Matched all functionalities of this new gate with the implemented ones, however, in comparison with the Python implm., there are
_eigvals
(returning eigenvalues), and decomposition methods that I wasn't sure about implementing them. Let me know if they are required too; and
There should be no hard requirement for these, if they are not implemented for other existing C++ methods.
- Utilized gtest suites of
lightning_gates_unittest.cpp
to test new routines.
👍
We will do a review of the PR, and can make suggestions once it is created. Feel free to create it and tag people as needed.