The QRD and Weight Back Substitution (QRD+WBS) - 2025.1 English - XD261

Vitis Tutorials: Vitis HLS (XD261)

Document ID
XD261
Release Date
2025-06-17
Version
2025.1 English

The QRD converts the complex matrix \(A\) into:

Equation 2:

\[A = QR\]

Where:

  • \(Q\), size $[m,n]$, is an orthogonal matrix, which yields the identity matrix when:

Equation 3:

\[Q^H Q = I\]

Where:

  • \(Q^H\) is the complex conjugate transpose for complex systems

  • \(Q^T\) is the transpose for real systems.

\(R\), size $[n,n]\(, is an upper triangular matrix, or right triangular matrix, meaning the lower triangle is all zeros. This makes for fast arithmetic when solving for \)x$. Equation 4 follows from substituting the QR relationship back into Equation 1.

Equation 4:

\[QRx = b\]
\[Q^HQRx = Q^Hb\]
\[IRx = Q^Hb\]
\[Rx = Q^Hb\]

The last step is to solve for \(x\) using back-substitution. Let \(c = Q^Hb\).

Equation 5:

\[x_j = \frac{1}{R_{j,j}} \left(c_j - \sum_{k=j+1}^{n} R_{j,k} \cdot x_k\right)\]

From this equation, we develop the HLS C code that implements the QR decomposition algorithm. The HLS C code is provided in the reference files: mgs_qrd_wbs.cpp, mgs_qrd_wbs.h, and mgs_qrd_wbs_tb.cpp