Skip to content

Add Doxygen documentation for R(θ, φ) gate matrix implementation#1284

Merged
burgholzer merged 5 commits into
support-r-gatefrom
copilot/sub-pr-1283
Nov 1, 2025
Merged

Add Doxygen documentation for R(θ, φ) gate matrix implementation#1284
burgholzer merged 5 commits into
support-r-gatefrom
copilot/sub-pr-1283

Conversation

Copilot AI commented Nov 1, 2025

Copy link
Copy Markdown
Contributor

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.

/**
 * @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
}

💡 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 in the docs.

Co-authored-by: burgholzer <6358767+burgholzer@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on native support for R(theta, phi) gate Add documentation for R(θ, φ) gate matrix implementation Nov 1, 2025
Copilot AI requested a review from burgholzer November 1, 2025 16:15
@burgholzer

Copy link
Copy Markdown
Member

@copilot turn this into a proper doxygen-style function docstring, with a @brief, a @details section, and the parameter descriptions.

@return, and @details

Co-authored-by: burgholzer <6358767+burgholzer@users.noreply.github.com>

Copilot AI commented Nov 1, 2025

Copy link
Copy Markdown
Contributor Author

@copilot turn this into a proper doxygen-style function docstring, with a @brief, a @details section, and the parameter descriptions.

Converted to proper Doxygen-style documentation with @brief, @param, @return, and @details sections in commit fb137fc.

Copilot AI changed the title Add documentation for R(θ, φ) gate matrix implementation Add Doxygen documentation for R(θ, φ) gate matrix implementation Nov 1, 2025
@burgholzer burgholzer marked this pull request as ready for review November 1, 2025 16:25
@burgholzer

Copy link
Copy Markdown
Member

pre-commit.ci autofix

@burgholzer burgholzer added the documentation Improvements or additions to documentation label Nov 1, 2025
@burgholzer burgholzer merged commit c189c20 into support-r-gate Nov 1, 2025
34 checks passed
@burgholzer burgholzer deleted the copilot/sub-pr-1283 branch November 1, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants