Skip to content

docs: part 1, part 2, conclusions and references report sections#84

Merged
niuqohn2510 merged 25 commits into
devfrom
docs/report
Apr 30, 2026
Merged

docs: part 1, part 2, conclusions and references report sections#84
niuqohn2510 merged 25 commits into
devfrom
docs/report

Conversation

@aFlyingSeal

@aFlyingSeal aFlyingSeal commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

Linked issue

Closes #29, #32

What this PR does

  • Drafted contents for part 1, part 2 and part 3.
  • Added conclusions and references sections as outlined in the title.
  • Ensured all technical sections are properly formatted for the final report.

Report (SM only — sprint-end export PRs)

  • report.tex exported from Prism and committed to report/
  • report.pdf compiled and committed to report/
  • No placeholder text remaining in exported sections

Summary by CodeRabbit

  • Documentation
    • Expanded Chapter 2 with SVD theory, geometric interpretation, figures, Jacobi and QR eigenvalue methods, spectral theorem, improved QR/G-S notes, and enhanced Manim visualization plan
    • Expanded Chapter 1 with theory on REF/RREF, Gaussian elimination (partial pivoting), determinants, inversion, subspaces, and experimental comparison tables
    • Added credits page and finalized conclusion; re-enabled credits inclusion and adjusted auxiliary includes affecting compiled content

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Chapters 1, 2, conclusion, and credits were expanded from placeholders into authored content: Chapter 1 adds linear-algebra theory and experimental tables; Chapter 2 adds SVD theory, geometric interpretation, Jacobi eigenvalue pseudocode, spectral/QR notes, and Manim visualization guidance; report includes credits and input adjustments. (50 words)

Changes

Cohort / File(s) Summary
Chapter 1: Theory & Experiments
report/chapters/chapter_01.tex
Replaced placeholders with "Cơ sở lý thuyết" (REF/RREF, Gauss elimination with partial pivoting, determinant via triangular form, Gauss–Jordan inversion, rank/column-row/null spaces) and added experimental results tables comparing outcomes to NumPy; added page break.
Chapter 2: SVD, Eigenmethods & Visualizations
report/chapters/chapter_02.tex
Inserted full SVD exposition (A = U Σ V^T, sizes/orthogonality, singular-value ordering, low-rank approx., σ_i = √λ_i(A^T A)), geometric decomposition with fig:svd_decomp_steps, Jacobi two-sided rotation derivation and jacobi_eigenvalues(A, ε, max_iter) pseudocode, spectral theorem/orthogonal diagonalization, QR eigenmethod notes (deflation, Wilkinson shift), improved Gram–Schmidt QR algorithm, and expanded Manim visualization outline.
Conclusion & Credits
report/chapters/conclusion.tex, report/chapters/credits.tex
Replaced placeholder conclusion sections with concrete summaries, difficulties, and lessons learned; added a credits page with a task-assignment table and GitHub/Manim links.
Document root changes
report/report.tex
Enabled inclusion of chapters/credits.tex and commented out utilities.tex input, altering compiled content.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nibble through matrices, neat and spry,
U turns, Σ stretches, V^T flutters by,
Jacobi twirls angles until eigenvalues peep,
QR and Gram–Schmidt help the vectors leap,
Credits hop in, and the chapter carrots pile high.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses most coding requirements from issue #29 but leaves key acceptance criteria incomplete: results tables for Part 1, references/links for Part 2, and .tex+.pdf export status remain pending. Complete remaining acceptance criteria: add Part 1 results table, add Part 2 references/video links, and verify .tex+.pdf export to report/ directory.
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope additions beyond issue #29 requirements: conclusion section, credits/team division table, Manim visualization content, and Jacobi eigenvalue algorithm—not mentioned in linked issue objectives. Clarify whether these additions (conclusion, credits, advanced eigenvalue content) are intentional enhancements or should be moved to a separate PR aligned with distinct requirements.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main changes: additions of Part 1 (chapter_01.tex with theory and experimental results), Part 2 (chapter_02.tex with SVD and eigenvalue algorithms), conclusions, and references (credits.tex) to the report.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@report/chapters/chapter_02.tex`:
- Around line 240-244: The \section{Phương pháp tìm trị riêng và vector riêng}
header is empty and must be completed or removed before export; either delete
this \section line if the topic won't be covered, or add a brief body under that
heading (e.g., an introduction plus paragraphs outlining the power method, QR
algorithm, and numeric considerations, or a short placeholder paragraph and TODO
note) so the compiled PDF doesn't show an unfinished section; locate the header
by searching for the exact string "\section{Phương pháp tìm trị riêng và vector
riêng}" and update the file accordingly.
- Around line 95-96: The characteristic polynomial is written for the wrong
matrix: replace the determinant det(A - λ I) with det(A^T A - λ I) so the
polynomial P(λ) correctly corresponds to eigenvalues of A^TA (keep the notation
P(λ)=det(A^T A - λ I)=0); update the sentence that references P(λ) to use A^T A
and ensure any subsequent mentions of the characteristic polynomial or
eigenvalue problem refer to A^T A rather than A.
- Around line 141-144: Fix the two LaTeX symbol mistakes in the Jacobi angle
paragraph: change the mistyped s{ii} to s_{ii}, and replace the incorrect
variable r in the quadratic t^2 + 2 r t - 1 = 0 with \tau so the equation reads
t^2 + 2\tau t - 1 = 0 (keeping t = \tan(\theta) and \tau =
\frac{s_{jj}-s_{ii}}{2s_{ij}} intact).
- Around line 190-200: Update the two incorrect equations in the diagonalization
subsection: change the diagonal matrix notation D from diag(\lambda_1,
\lambda_2, \dots, \lambda_i) to diag(\lambda_1, \lambda_2, \dots, \lambda_n)
(using D and lambda_i as referenced) and correct the eigenvector equation by
replacing the incomplete "(A - \lambda I) = 0" with the proper "(A - \lambda I)x
= 0" (referencing the eigenvector x and eigenvalue lambda).
- Around line 55-62: Sửa hướng ánh xạ tuyến tính: thay mọi chỗ nói "phép biến
đổi tuyến tính từ không gian \mathbb{R}^m sang \mathbb{R}^n" thành "từ
\mathbb{R}^n sang \mathbb{R}^m" để đúng với A\in\mathbb{R}^{m\times n}; điều
chỉnh mô tả vai trò của V^T, \Sigma và U cho phù hợp (V^T xoay hệ tọa độ ở không
gian miền vào \mathbb{R}^n, \Sigma co giãn theo các trục mới, U xoay ra
\mathbb{R}^m); và rõ ràng hóa điều kiện triệt tiêu bằng cách thay câu "Nếu
\sigma_i, chiều không gian..." bằng "Nếu \sigma_i = 0 thì chiều tương ứng bị
triệt tiêu (điều này cho thấy SVD xác định hạng và không gian null)".
- Around line 29-35: Fix the ordering and the sum notation: change the singular
values line to use the missing comparison operator and proper min notation
(e.g., \sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_p \ge 0 \text{ với } p =
\min(m,n)), and replace the incorrect \Sigma in the low-rank formula with a
lowercase summation so the approximation reads A_k = \sum_{i=1}^{k} \sigma_i u_i
v_i^T (ensure the symbols A_k, \sigma_i, u_i, v_i^T remain unchanged).
- Around line 153-169: The convergence loop in jacobi_eigenvalues is inverted
and never runs: change the loop condition to iterate while not converged and
respect the max_iter limit (e.g., while not is_converge and iter < max_iter or
use a for loop up to max_iter), compute max_val from off-diagonal s_{ij} each
iteration, set is_converge = True and break when max_val < epsilon, and
increment/track the iteration counter so max_iter is used as a termination
condition; update references to is_converge, max_iter, max_val, and the while
loop accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9102d836-d3cb-44e5-a011-0c21497b9b37

📥 Commits

Reviewing files that changed from the base of the PR and between d0ad745 and f54fc1e.

⛔ Files ignored due to path filters (4)
  • report/images/chapter_02/svd-1.png is excluded by !**/*.png
  • report/images/chapter_02/svd-2.png is excluded by !**/*.png
  • report/images/chapter_02/svd-3.png is excluded by !**/*.png
  • report/images/chapter_02/svd-4.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • report/chapters/chapter_02.tex

Comment thread report/chapters/chapter_02.tex Outdated
Comment thread report/chapters/chapter_02.tex Outdated
Comment thread report/chapters/chapter_02.tex Outdated
Comment thread report/chapters/chapter_02.tex
Comment thread report/chapters/chapter_02.tex
Comment thread report/chapters/chapter_02.tex
Comment thread report/chapters/chapter_02.tex

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (7)
report/chapters/chapter_02.tex (7)

55-62: ⚠️ Potential issue | 🟠 Major

Linear-map direction and nullspace condition need correction.

For (A \in \mathbb{R}^{m\times n}), the map is (\mathbb{R}^n \to \mathbb{R}^m), not (\mathbb{R}^m \to \mathbb{R}^n). Also Line 61 needs explicit condition (\sigma_i = 0).

Suggested fix
-SVD không chỉ đơn thuần là một công thức đại số, về mặt bản chất nó chính là một chuỗi các phép biến đổi hình học cơ bản. Bất kỳ ma trận $A$ nào cũng được đại diện cho một phép biến đổi tuyến tính từ không gian $\mathbb{R}^m$ sang không gian $\mathbb{R}^n$.
+SVD không chỉ đơn thuần là một công thức đại số, về mặt bản chất nó chính là một chuỗi các phép biến đổi hình học cơ bản. Bất kỳ ma trận $A \in \mathbb{R}^{m \times n}$ nào cũng biểu diễn một phép biến đổi tuyến tính từ không gian $\mathbb{R}^n$ sang không gian $\mathbb{R}^m$.
@@
-    \item Phép co giãn ($\Sigma$): Ma trận đường chéo $\Sigma$ thực hiện co giãn theo không gian dọc theo các trục tọa độ mới. Các vector sẽ được co giãn hoặc rút ngắn theo các hệ số $\sigma_i$. Nếu $\sigma_i$, chiều không gian tương ứng bị triệt tiêu, điều đó giải thích vì sao mà SVD có thể xác định được hạng (rank) và không gian null (nullspace).
+    \item Phép co giãn ($\Sigma$): Ma trận đường chéo $\Sigma$ thực hiện co giãn theo không gian dọc theo các trục tọa độ mới. Các vector sẽ được co giãn hoặc rút ngắn theo các hệ số $\sigma_i$. Nếu $\sigma_i = 0$, chiều không gian tương ứng bị triệt tiêu, điều đó giải thích vì sao SVD xác định được hạng (rank) và không gian null (nullspace).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 55 - 62, Correct the
domain/codomain of the linear map and make the nullspace condition explicit:
change the sentence describing A so it reads A ∈ R^{m×n} represents a linear map
from R^n to R^m (not R^m to R^n), and in the Sigma bullet replace the vague "Nếu
σ_i, chiều không gian..." with an explicit condition like "Nếu σ_i = 0, chiều
không gian tương ứng bị triệt tiêu," while keeping the references to V^T, Σ
(Sigma) and U unchanged.

156-167: ⚠️ Potential issue | 🟠 Major

Jacobi pseudocode convergence loop is inverted and max_iter is unused.

is_converge is initialized to False then looped with \While{$is\_converge$}, so body never runs. Also convergence check should use max_val, and iteration bound should be enforced.

Suggested fix
-    \State $is\_converge \gets False$
-
-    \While{$is\_converge$}
-        \State $max\_val \gets max(s_{ij}) \quad (i \neq j)$
-        \If{$|s_{ij}| < \epsilon$ (với $\epsilon$ là ngưỡng sai số cực nhỏ)}
-            \State $is\_converge \gets True$
+    \State $iter \gets 0$
+
+    \While{$iter < max\_iter$}
+        \State $max\_val \gets \max_{i \neq j}|s_{ij}|$
+        \If{$max\_val < \epsilon$}
             \State \textbf{break}
         \EndIf
         \State $cos(\theta), sin(\theta) \text{ được tính từ } s_{ii}, s_{jj}, s_{ij}$
         \State $S \gets G^T S G$ (ma trận $S$ dần trở thành ma trận đường chéo $\Sigma^2$)
         \State $V \gets V G$ (các cột của $V$ dần trở thành vector suy biến phải)
+        \State $iter \gets iter + 1$
     \EndWhile
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 156 - 167, The convergence loop
is inverted and never executes: change the loop to run while not converged and
enforce an iteration bound by using max_iter; initialize is_converge = False,
use While{not is_converge and iter < max_iter} (or equivalent) so the body
executes, compute max_val from s_{ij} (i ≠ j) each iteration, check if |max_val|
< epsilon to set is_converge = True and break, and increment an iteration
counter to stop at max_iter; update references in the loop that compute cos(θ),
sin(θ), and apply S ← G^T S G and V ← V G accordingly.

95-95: ⚠️ Potential issue | 🟠 Major

Characteristic polynomial is written for the wrong matrix.

Line 95 discusses eigenvalues of (A^TA) but writes ( \det(A-\lambda I)=0 ), which is inconsistent.

Suggested fix
-Trong quá trình tiến hành thuật toán SVD, chúng ta cần phải tìm các trị riêng của ma trận đối xứng $A^TA$. Việc tìm giá trị riêng tương đương với việc tìm nghiệm của đa thức đặc trưng $P(\lambda) = det(A - \lambda I) = 0$ nên đối với các ma trận có kích thước $\geq 5$, chúng ta không thể sử dụng các phương pháp đại số thông thường để giải quyết bài toán trên.
+Trong quá trình tiến hành thuật toán SVD, chúng ta cần phải tìm các trị riêng của ma trận đối xứng $A^TA$. Việc tìm giá trị riêng tương đương với việc tìm nghiệm của đa thức đặc trưng $P(\lambda) = \det(A^TA - \lambda I) = 0$ nên đối với các ma trận có kích thước $\geq 5$, chúng ta không thể sử dụng các phương pháp đại số thông thường để giải quyết bài toán trên.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` at line 95, The sentence incorrectly writes
the characteristic polynomial for A when discussing eigenvalues of A^T A; update
the formula and wording so the characteristic polynomial refers to A^T A (e.g.,
P(λ) = det(A^T A - λ I) = 0) and ensure any accompanying text mentions
eigenvalues of A^T A (not A) and the size caveat for matrices of dimension ≥ 5.

191-191: ⚠️ Potential issue | 🟠 Major

Two diagonalization equations are incomplete.

Line 191 should enumerate diagonal entries through (\lambda_n), and Line 199 must include eigenvector (x) in ((A-\lambda I)x=0).

Suggested fix
-    \item D là ma trận đường chéo $diag(\lambda_1, \lambda_2, \dots, \lambda_i)$ với $\lambda_i$ là các giá trị riêng của $A$.
+    \item $D$ là ma trận đường chéo $\operatorname{diag}(\lambda_1, \lambda_2, \dots, \lambda_n)$ với $\lambda_i$ là các giá trị riêng của $A$.
@@
-    \item \textbf{Vector riêng} $x$: Vector riêng tương ứng là nghiệm của hệ $(A - \lambda I) = 0$. Nó đại diện cho hướng mà tại đó phép biến đổi tuyến tính chỉ đóng vai trò như phép nhân vô hướng.
+    \item \textbf{Vector riêng} $x$: Vector riêng tương ứng là nghiệm của hệ $(A - \lambda I)x = 0$. Nó đại diện cho hướng mà tại đó phép biến đổi tuyến tính chỉ đóng vai trò như phép nhân vô hướng.

Also applies to: 199-199

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` at line 191, The diagonalization statements
are incomplete: update the definition of D (the diagonal matrix D = diag(λ_1,
λ_2, ..., λ_n)) so the last index is λ_n (not λ_i), and correct the
eigen-equation to include the eigenvector x by writing (A - λ I) x = 0; modify
the occurrences that currently read D = diag(λ_1, λ_2, …, λ_i) and (A - λ I) = 0
to the precise forms D = diag(λ_1, λ_2, …, λ_n) and (A - λ I) x = 0
respectively.

29-35: ⚠️ Potential issue | 🟠 Major

Fix singular-value chain and low-rank approximation notation.

Line 30 is missing one comparison operator and uses min without LaTeX operator formatting; Line 35 uses \Sigma (matrix symbol) instead of summation \sum.

Suggested fix
-    \sigma_1 \geq \sigma_2 \geq \dots \sigma_p \geq 0 \text{ với } p = min(m, n)
+    \sigma_1 \geq \sigma_2 \geq \dots \geq \sigma_p \geq 0 \text{ với } p = \min(m, n)
@@
-\textbf{Xấp xỉ hạng thấp}: SVD cung cấp xấp xỉ tốt nhất cho ma trận ở hạng $k$ thấp hơn qua công thức $A_k = \Sigma_{i = 1}^{k} \sigma_i u_i v_i^T$, ứng dụng trong nén ảnh và khử nhiều.
+\textbf{Xấp xỉ hạng thấp}: SVD cung cấp xấp xỉ tốt nhất hạng $k$ qua công thức $A_k = \sum_{i=1}^{k}\sigma_i u_i v_i^T$, ứng dụng trong nén ảnh và khử nhiễu.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 29 - 35, Fix the singular-value
chain and low-rank approximation notation: ensure the ordered chain uses all
comparison operators as "\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_p \ge 0" and
format p with LaTeX operator as "p = \min(m,n)"; replace the incorrect matrix
symbol "\Sigma" in the rank-k approximation with a summation symbol and proper
summation syntax so the formula reads "A_k = \sum_{i=1}^{k} \sigma_i u_i v_i^T".

143-143: ⚠️ Potential issue | 🟠 Major

Jacobi angle line contains broken symbols.

Line 143 has s{ii} instead of s_{ii}, tan should be \tan, and the quadratic uses r instead of \tau.

Suggested fix
-    \item Nếu $s{ii} \neq s_{jj}$, ta tính $\theta$ thông qua giá trị $\tau = \frac{s_{jj} - s_{ii}}{2s_{ij}}$, sau đó tìm $t = tan(\theta)$ là nghiệm của phương trình $t^2 + 2rt - 1 = 0$.
+    \item Nếu $s_{ii} \neq s_{jj}$, ta tính $\theta$ thông qua giá trị $\tau = \frac{s_{jj} - s_{ii}}{2s_{ij}}$, sau đó tìm $t = \tan(\theta)$ là nghiệm của phương trình $t^2 + 2\tau t - 1 = 0$.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` at line 143, Fix the broken LaTeX symbols in
the Jacobi angle sentence: change "s{ii}" to "s_{ii}", use the math function
"\tan" for t = \tan(\theta), ensure the definition of \tau is \tau =
\frac{s_{jj} - s_{ii}}{2 s_{ij}}, and correct the quadratic to use \tau (not r)
so the equation reads t^2 + 2\tau t - 1 = 0; keep references to s_{ii}, s_{jj},
s_{ij}, \tau, t, and \theta to locate and update the text accordingly.

240-244: ⚠️ Potential issue | 🟡 Minor

Complete or remove this empty section before export.

The section header is currently empty, which leaves an unfinished block in the compiled report.

I can draft a short subsection here (e.g., power method + QR overview + numerical notes) if you want.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 240 - 244, The \section{Phương
pháp tìm trị riêng và vector riêng} is empty—either remove this \section command
or populate it with content; to fix, add at least a brief subsection under that
section (e.g., \subsection{Phương pháp lũy thừa (Power method)} describing the
algorithm and convergence, \subsection{Thuật toán QR} giving an overview, and
\subsection{Ghi chú số học} with numerical stability/tolerance guidance) or
delete the \section line entirely if it’s not needed before export.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@report/chapters/chapter_02.tex`:
- Around line 85-87: Fix the missing wording in the sentence containing "đều có
thể một cặp cơ sở trực chuẩn ($V$ và $U$) để biến hình..." by inserting the
proper verb phrase so it reads e.g. "đều có thể được biểu diễn bằng một cặp cơ
sở trực chuẩn ($V$ và $U$) để biến hình..." and correct the typo "biển đổi" to
"biến đổi" wherever it appears (notably the occurrence at the reported second
location).
- Line 22: The current sentence incorrectly says the columns of V^T are the
right singular vectors; update the wording so it states that V^T ∈ ℝ^{n×n} is
orthogonal (V^T V = I_n) and that the columns of V are the right singular
vectors (equivalently, the rows of V^T). Replace the phrase "các cột của nó là
các vector suy biến phải" with a precise form mentioning "các cột của V là các
vector suy biến phải (tương đương các hàng của V^T)" while keeping the V^T
orthogonality statement.

---

Duplicate comments:
In `@report/chapters/chapter_02.tex`:
- Around line 55-62: Correct the domain/codomain of the linear map and make the
nullspace condition explicit: change the sentence describing A so it reads A ∈
R^{m×n} represents a linear map from R^n to R^m (not R^m to R^n), and in the
Sigma bullet replace the vague "Nếu σ_i, chiều không gian..." with an explicit
condition like "Nếu σ_i = 0, chiều không gian tương ứng bị triệt tiêu," while
keeping the references to V^T, Σ (Sigma) and U unchanged.
- Around line 156-167: The convergence loop is inverted and never executes:
change the loop to run while not converged and enforce an iteration bound by
using max_iter; initialize is_converge = False, use While{not is_converge and
iter < max_iter} (or equivalent) so the body executes, compute max_val from
s_{ij} (i ≠ j) each iteration, check if |max_val| < epsilon to set is_converge =
True and break, and increment an iteration counter to stop at max_iter; update
references in the loop that compute cos(θ), sin(θ), and apply S ← G^T S G and V
← V G accordingly.
- Line 95: The sentence incorrectly writes the characteristic polynomial for A
when discussing eigenvalues of A^T A; update the formula and wording so the
characteristic polynomial refers to A^T A (e.g., P(λ) = det(A^T A - λ I) = 0)
and ensure any accompanying text mentions eigenvalues of A^T A (not A) and the
size caveat for matrices of dimension ≥ 5.
- Line 191: The diagonalization statements are incomplete: update the definition
of D (the diagonal matrix D = diag(λ_1, λ_2, ..., λ_n)) so the last index is λ_n
(not λ_i), and correct the eigen-equation to include the eigenvector x by
writing (A - λ I) x = 0; modify the occurrences that currently read D =
diag(λ_1, λ_2, …, λ_i) and (A - λ I) = 0 to the precise forms D = diag(λ_1, λ_2,
…, λ_n) and (A - λ I) x = 0 respectively.
- Around line 29-35: Fix the singular-value chain and low-rank approximation
notation: ensure the ordered chain uses all comparison operators as "\sigma_1
\ge \sigma_2 \ge \dots \ge \sigma_p \ge 0" and format p with LaTeX operator as
"p = \min(m,n)"; replace the incorrect matrix symbol "\Sigma" in the rank-k
approximation with a summation symbol and proper summation syntax so the formula
reads "A_k = \sum_{i=1}^{k} \sigma_i u_i v_i^T".
- Line 143: Fix the broken LaTeX symbols in the Jacobi angle sentence: change
"s{ii}" to "s_{ii}", use the math function "\tan" for t = \tan(\theta), ensure
the definition of \tau is \tau = \frac{s_{jj} - s_{ii}}{2 s_{ij}}, and correct
the quadratic to use \tau (not r) so the equation reads t^2 + 2\tau t - 1 = 0;
keep references to s_{ii}, s_{jj}, s_{ij}, \tau, t, and \theta to locate and
update the text accordingly.
- Around line 240-244: The \section{Phương pháp tìm trị riêng và vector riêng}
is empty—either remove this \section command or populate it with content; to
fix, add at least a brief subsection under that section (e.g.,
\subsection{Phương pháp lũy thừa (Power method)} describing the algorithm and
convergence, \subsection{Thuật toán QR} giving an overview, and \subsection{Ghi
chú số học} with numerical stability/tolerance guidance) or delete the \section
line entirely if it’s not needed before export.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 78522861-3584-4031-a81e-401715cde463

📥 Commits

Reviewing files that changed from the base of the PR and between f54fc1e and 3d18b38.

⛔ Files ignored due to path filters (5)
  • report/images/chapter_02/svd-1.png is excluded by !**/*.png
  • report/images/chapter_02/svd-2.png is excluded by !**/*.png
  • report/images/chapter_02/svd-3.png is excluded by !**/*.png
  • report/images/chapter_02/svd-4.png is excluded by !**/*.png
  • report/report.pdf is excluded by !**/*.pdf
📒 Files selected for processing (1)
  • report/chapters/chapter_02.tex

Comment thread report/chapters/chapter_02.tex Outdated
Comment thread report/chapters/chapter_02.tex Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (7)
report/chapters/chapter_02.tex (7)

95-95: ⚠️ Potential issue | 🟠 Major

Use A^TA in the characteristic polynomial.

This paragraph says Jacobi is finding eigenvalues of A^TA, but then switches to \det(A - \lambda I) = 0. That changes the matrix under discussion; it should stay as the characteristic polynomial of A^TA.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` at line 95, Đoạn văn đang chuyển từ xét ma
trận A^TA sang biểu thức P(λ)=det(A-λI)=0 làm thay đổi ma trận cần tìm trị
riêng; sửa thành biểu thức đặc trưng của A^TA, ví dụ đổi P(λ)=det(A^TA - λI)=0
(giữ các ký hiệu A^TA và λ) để nhất quán trong câu nói về việc tìm trị riêng của
A^TA.

204-213: ⚠️ Potential issue | 🟠 Major

Two diagonalization equations are incomplete.

Line 205 should enumerate the diagonal entries through \lambda_n, not \lambda_i, and Line 213 needs the eigenvector variable: (A - \lambda I)x = 0.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 204 - 213, Fix the two
incomplete diagonalization equations: in the D definition replace the terminal
index so the diagonal is diag(λ_1, λ_2, …, λ_n) (not diag(λ_1, λ_2, …, λ_i)),
and in the eigenvector equation for vector x update the displayed equation from
(A - λ I) = 0 to (A - λ I)x = 0 so the eigenvector variable x is present; ensure
these corrections appear where D, P, λ (lambda) and the eigenvector equation are
defined.

154-168: ⚠️ Potential issue | 🟠 Major

The Jacobi pseudocode loop never executes.

is_converge is initialized to False, then reused directly as the \While condition, so the loop body is skipped immediately. max_iter is also never consumed. This diverges from part2/decomposition.py:24-85, where jacobi_eigenvalues iterates up to max_iterations and breaks once the max off-diagonal entry is below the tolerance.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 154 - 168, The loop in
jacobi_eigenvalues never runs because is_converge is initialized False and used
directly as the \While condition and max_iter is unused; change the control to
iterate until convergence or until max_iter is reached (e.g., loop with an
iteration counter or a for loop from 1..max_iter), compute max_val as the
largest off-diagonal |s_{ij}| each iteration, compare max_val to epsilon and set
is_converge True and break when below tolerance, and otherwise perform the
Givens rotation updates S <- G^T S G and V <- V G; ensure max_iter is consumed
and s_{ij}, max_val, is_converge, and max_iter are referenced in the updated
loop condition.

143-145: ⚠️ Potential issue | 🟠 Major

The Jacobi angle formula still has broken symbols.

Line 144 typesets s{ii} instead of s_{ii} and uses r even though the variable introduced is \tau. tan(\theta) should also be typeset as \tan(\theta).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 143 - 145, Fix the malformed
LaTeX symbols in the Jacobi angle paragraph: change any occurrence of s{ii} to
s_{ii} (and similarly ensure s_{jj}, s_{ij} use subscripts), replace the
incorrect variable r in the quadratic t^2 + 2 r t - 1 = 0 with the introduced
\tau so it reads t^2 + 2 \tau t - 1 = 0, and typeset the tangent as \tan(\theta)
instead of tan(\theta); update the text around \tau and t to consistently refer
to \tau when forming the quadratic and solving for t.

27-35: ⚠️ Potential issue | 🟠 Major

Two SVD formulas are still mathematically wrong.

Line 30 is missing the comparison operator before \sigma_p and should use \min(m,n). Line 35 needs a lowercase summation \sum, not \Sigma_{i=1}^k, otherwise the rank-k approximation formula is incorrect.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 27 - 35, Fix the two SVD formula
issues: in the singular values line, add the missing comparison operator so it
reads "\sigma_1 \geq \sigma_2 \geq \dots \geq \sigma_p \geq 0" and use the
proper min notation "p = \min(m,n)"; in the low-rank approximation line replace
the uppercase Sigma with a lowercase summation symbol so the formula reads "A_k
= \sum_{i=1}^{k} \sigma_i u_i v_i^T" (ensure the summation index and the product
\sigma_i u_i v_i^T are written exactly as shown).

55-62: ⚠️ Potential issue | 🟠 Major

Fix the linear-map direction in the geometric interpretation.

For A \in \mathbb{R}^{m \times n}, the induced linear map is \mathbb{R}^n \to \mathbb{R}^m, not \mathbb{R}^m \to \mathbb{R}^n. Line 61 also needs the explicit \sigma_i = 0 condition.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 55 - 62, Update the geometric
interpretation to state that for A ∈ R^{m×n} the induced linear map is R^n → R^m
(not R^m → R^n), and adjust the text around V^T, Σ and U to reflect that V^T
rotates the input/domain R^n, Σ scales those domain directions by σ_i, and U
places results in the output/codomain R^m. Also make the σ_i statement explicit:
replace "If σ_i, chiều không gian tương ứng bị triệt tiêu" with an explicit
condition like "If σ_i = 0, the corresponding dimension is annihilated" so
readers see the exact criterion for rank/nullspace.

20-22: ⚠️ Potential issue | 🟠 Major

Correct the right-singular-vector description.

Line 22 says the columns of V^T are the right singular vectors. They are the columns of V instead; equivalently, the rows of V^T. This also contradicts part2/decomposition.py:88-199, which documents V^T correctly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` around lines 20 - 22, The description of
right singular vectors is wrong: update the text for V^T and V to state that V^T
∈ R^{n×n} is orthogonal and its rows are the right singular vectors
(equivalently, V's columns are the right singular vectors), and replace the
phrase "các cột của nó là các vector suy biến phải" for V^T with the correct
wording; ensure the entry for V (or V^T) consistently says V's columns are the
right singular vectors and that V^TV=I_n.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@report/chapters/chapter_02.tex`:
- Around line 320-328: The definition of μ is incorrect: it currently takes the
smaller distance |\lambda_1 - d| vs |\lambda_2 - d|, but μ must be the
eigenvalue (either \lambda_1 or \lambda_2) closest to d. Update the sentence and
any notation so μ := \lambda_1 if |\lambda_1 - d| < |\lambda_2 - d| (otherwise μ
:= \lambda_2), referencing \lambda_1, \lambda_2, d and B so the Wilkinson shift
selects the nearer eigenvalue rather than the distance.
- Around line 282-288: The deflation condition must use the absolute value of
the subdiagonal entry: change occurrences of A[n - 1][n - 2] < ε to |A[n - 1][n
- 2]| < ε (and similarly render as |A_{n-1,n-2}| < \epsilon in math mode) so
large negative values don't falsely trigger deflation; also fix the summary
sentence that currently places absolute bars around the whole inequality to
instead surround only the subdiagonal entry.
- Around line 393-415: The chapter is incomplete: add the missing video
reference and the decomposition-verification links required by Part 2 and fill
the empty subsection \subsection{Quy trình sản xuất}; specifically, insert a
concrete video reference (YouTube/Vimeo ID or local file path and duration), add
links to the decomposition-verification artifacts (e.g., SVD_demo.ipynb,
verify_decomposition.py or a URL to the repo/tests showing U, Sigma, V^T
reconstruction and error metrics), and replace the empty \subsection{Quy trình
sản xuất} with a brief production workflow listing assets, Manim scene names
(e.g., SVDScene, BasisTransformScene), rendering commands, required
environments/dependencies, and file output locations so reviewers can reproduce
the video and verify the decomposition.

---

Duplicate comments:
In `@report/chapters/chapter_02.tex`:
- Line 95: Đoạn văn đang chuyển từ xét ma trận A^TA sang biểu thức
P(λ)=det(A-λI)=0 làm thay đổi ma trận cần tìm trị riêng; sửa thành biểu thức đặc
trưng của A^TA, ví dụ đổi P(λ)=det(A^TA - λI)=0 (giữ các ký hiệu A^TA và λ) để
nhất quán trong câu nói về việc tìm trị riêng của A^TA.
- Around line 204-213: Fix the two incomplete diagonalization equations: in the
D definition replace the terminal index so the diagonal is diag(λ_1, λ_2, …,
λ_n) (not diag(λ_1, λ_2, …, λ_i)), and in the eigenvector equation for vector x
update the displayed equation from (A - λ I) = 0 to (A - λ I)x = 0 so the
eigenvector variable x is present; ensure these corrections appear where D, P, λ
(lambda) and the eigenvector equation are defined.
- Around line 154-168: The loop in jacobi_eigenvalues never runs because
is_converge is initialized False and used directly as the \While condition and
max_iter is unused; change the control to iterate until convergence or until
max_iter is reached (e.g., loop with an iteration counter or a for loop from
1..max_iter), compute max_val as the largest off-diagonal |s_{ij}| each
iteration, compare max_val to epsilon and set is_converge True and break when
below tolerance, and otherwise perform the Givens rotation updates S <- G^T S G
and V <- V G; ensure max_iter is consumed and s_{ij}, max_val, is_converge, and
max_iter are referenced in the updated loop condition.
- Around line 143-145: Fix the malformed LaTeX symbols in the Jacobi angle
paragraph: change any occurrence of s{ii} to s_{ii} (and similarly ensure
s_{jj}, s_{ij} use subscripts), replace the incorrect variable r in the
quadratic t^2 + 2 r t - 1 = 0 with the introduced \tau so it reads t^2 + 2 \tau
t - 1 = 0, and typeset the tangent as \tan(\theta) instead of tan(\theta);
update the text around \tau and t to consistently refer to \tau when forming the
quadratic and solving for t.
- Around line 27-35: Fix the two SVD formula issues: in the singular values
line, add the missing comparison operator so it reads "\sigma_1 \geq \sigma_2
\geq \dots \geq \sigma_p \geq 0" and use the proper min notation "p =
\min(m,n)"; in the low-rank approximation line replace the uppercase Sigma with
a lowercase summation symbol so the formula reads "A_k = \sum_{i=1}^{k} \sigma_i
u_i v_i^T" (ensure the summation index and the product \sigma_i u_i v_i^T are
written exactly as shown).
- Around line 55-62: Update the geometric interpretation to state that for A ∈
R^{m×n} the induced linear map is R^n → R^m (not R^m → R^n), and adjust the text
around V^T, Σ and U to reflect that V^T rotates the input/domain R^n, Σ scales
those domain directions by σ_i, and U places results in the output/codomain R^m.
Also make the σ_i statement explicit: replace "If σ_i, chiều không gian tương
ứng bị triệt tiêu" with an explicit condition like "If σ_i = 0, the
corresponding dimension is annihilated" so readers see the exact criterion for
rank/nullspace.
- Around line 20-22: The description of right singular vectors is wrong: update
the text for V^T and V to state that V^T ∈ R^{n×n} is orthogonal and its rows
are the right singular vectors (equivalently, V's columns are the right singular
vectors), and replace the phrase "các cột của nó là các vector suy biến phải"
for V^T with the correct wording; ensure the entry for V (or V^T) consistently
says V's columns are the right singular vectors and that V^TV=I_n.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e74efe21-3963-4a99-b3ab-2182e1e1ec25

📥 Commits

Reviewing files that changed from the base of the PR and between 3d18b38 and e81c3d6.

📒 Files selected for processing (2)
  • report/chapters/chapter_01.tex
  • report/chapters/chapter_02.tex
✅ Files skipped from review due to trivial changes (1)
  • report/chapters/chapter_01.tex

Comment thread report/chapters/chapter_02.tex
Comment thread report/chapters/chapter_02.tex Outdated
Comment thread report/chapters/chapter_02.tex Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
report/chapters/chapter_02.tex (1)

212-212: Use \det LaTeX operator for proper formatting.

Line 212 uses det(A - \lambda I) but should use the LaTeX operator \det for correct typesetting (upright font, proper spacing).

Proposed fix
-    \item \textbf{Trị riêng} $\lambda$: Trị riêng được xác định từ phương trình đặc trưng $det(A - \lambda I) = 0$. Đây là giá trị vô hướng thể hiện mức độ co giãn của ma trận theo một hướng nhất định.
+    \item \textbf{Trị riêng} $\lambda$: Trị riêng được xác định từ phương trình đặc trưng $\det(A - \lambda I) = 0$. Đây là giá trị vô hướng thể hiện mức độ co giãn của ma trận theo một hướng nhất định.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report/chapters/chapter_02.tex` at line 212, Replace the plain "det" in the
characteristic equation inside chapter_02.tex (the inline math expression det(A
- \lambda I)) with the LaTeX operator \det to ensure correct typesetting;
specifically update the expression in the "Trị riêng" item so it reads \det(A -
\lambda I) within the existing $...$ math delimiters.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@report/chapters/chapter_02.tex`:
- Line 212: Replace the plain "det" in the characteristic equation inside
chapter_02.tex (the inline math expression det(A - \lambda I)) with the LaTeX
operator \det to ensure correct typesetting; specifically update the expression
in the "Trị riêng" item so it reads \det(A - \lambda I) within the existing
$...$ math delimiters.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 891da252-645e-4b0f-9852-7636475936e1

📥 Commits

Reviewing files that changed from the base of the PR and between e81c3d6 and 1d19432.

⛔ Files ignored due to path filters (1)
  • report/report.pdf is excluded by !**/*.pdf
📒 Files selected for processing (1)
  • report/chapters/chapter_02.tex

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@report/chapters/chapter_02.tex`:
- Around line 415-434: The subsection \subsection{Quy trình xây dựng video}
currently describes process stages but lacks the concrete video references and
decomposition-verification links required by the PR acceptance criteria; update
the text (within \subsubsection{Kịch bản video}, \subsubsection{Mã nguồn},
\subsubsection{Thuyết minh}, and \subsubsection{Chỉnh sửa video}) to list exact
video filenames/IDs and timestamps for each scene, embed or link the cue-sheet
mapping that ties script lines to timestamps, and add verification links (e.g.,
QA checklists, render logs, unit/behavioral test results, or CI artifacts) that
demonstrate decomposition→verification for each deliverable before export.

In `@report/chapters/conclusion.tex`:
- Around line 5-14: The conclusion contains an unfinished placeholder "Ở phần
3..." under the \section{Tóm tắt kết quả đạt được}; either replace that
placeholder with a concise completed summary of Part 3 (describe the aims,
methods and key results of Part 3 in 1–3 sentences consistent with Parts 1 and
2) or remove the placeholder entirely if Part 3 does not exist, then re-run
export/checklist to ensure no placeholder text remains.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8300a82c-c65b-455c-ae0d-5c0773129768

📥 Commits

Reviewing files that changed from the base of the PR and between 1d19432 and ca86500.

⛔ Files ignored due to path filters (1)
  • report/report.pdf is excluded by !**/*.pdf
📒 Files selected for processing (4)
  • report/chapters/chapter_02.tex
  • report/chapters/conclusion.tex
  • report/chapters/credits.tex
  • report/report.tex
✅ Files skipped from review due to trivial changes (2)
  • report/chapters/credits.tex
  • report/report.tex

Comment thread report/chapters/chapter_02.tex
Comment thread report/chapters/conclusion.tex
@aFlyingSeal aFlyingSeal changed the title docs: part 1 and part 2 report sections docs: part 1, part 2, conclusions and references report sections Apr 19, 2026
niuqohn2510
niuqohn2510 previously approved these changes Apr 30, 2026

@niuqohn2510 niuqohn2510 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done

@niuqohn2510 niuqohn2510 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done

@niuqohn2510 niuqohn2510 merged commit 13a34b1 into dev Apr 30, 2026
3 checks passed
@niuqohn2510 niuqohn2510 deleted the docs/report branch April 30, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3pts] Write Part 1 and Part 2 report sections

2 participants