Commit c189c20
Add Doxygen documentation for R(θ, φ) gate matrix implementation (#1284)
Addresses review feedback on PR #1283 requesting documentation for the
`rMat` function implementation.
## Changes
- Added proper Doxygen-style function docstring with `@brief`, `@param`,
`@return`, and `@details` sections
- Documented the mathematical formula: `R(θ, φ) = exp(-i*θ/2*(cos(φ)X +
sin(φ)Y))`
- Documented the explicit matrix representation: `[[cos(θ/2),
-i*e^(-iφ)*sin(θ/2)], [-i*e^(iφ)*sin(θ/2), cos(θ/2)]]`
- Added parameter descriptions for `theta` (rotation angle) and `phi`
(rotation axis angle)
The documentation clarifies the relationship between the exponential
form and the matrix elements computed in the implementation, following
the standard Doxygen format used throughout the codebase.
```cpp
/**
* @brief Computes the matrix representation of the R(θ, φ) gate.
* @param theta The rotation angle θ.
* @param phi The rotation axis angle φ.
* @return The gate matrix for the R(θ, φ) rotation.
*
* @details The R(θ, φ) gate is defined as R(θ, φ) = exp(-i*θ/2*(cos(φ)X + sin(φ)Y)),
* which results in the matrix:
* [[cos(θ/2), -i*e^(-iφ)*sin(θ/2)],
* [-i*e^(iφ)*sin(θ/2), cos(θ/2)]]
*/
GateMatrix rMat(const fp theta, const fp phi) {
// ... implementation
}
```
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: burgholzer <6358767+burgholzer@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>1 parent f1cc80f commit c189c20
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
| |||
0 commit comments