Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .translate/state/qr_decomp.md.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source-sha: ffc4eaf681b12e70faaf3b9b935802b5a7efe41e
synced-at: "2026-07-18"
model: claude-sonnet-5
mode: RESYNC
section-count: 7
tool-version: 0.17.0
24 changes: 21 additions & 3 deletions lectures/qr_decomp.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ kernelspec:
display_name: Python 3
language: python
name: python3
translation:
title: QR分解
headings:
Overview: 概述
Matrix Factorization: 矩阵分解
Gram-Schmidt process: 格拉姆-施密特正交化
Gram-Schmidt process::Gram-Schmidt process for square $A$: 方阵$A$的格拉姆-施密特正交化
Gram-Schmidt process::$A$ not square: $A$ 非方阵
Some Code: 一些代码
Example: 示例
Using QR Decomposition to Compute Eigenvalues: 使用QR分解计算特征值
$QR$ and PCA: $QR$ 分解与主成分分析(PCA)
---

# QR分解
Expand Down Expand Up @@ -51,10 +63,10 @@ $$

如果方阵$A$是非奇异的,那么$QR$分解是唯一的。

实际上,我们的算法也适用于非方阵的矩形矩阵$A$。

我们稍后会处理矩形矩阵$A$。

实际上,我们的算法也适用于非方阵的矩形矩阵$A$。

### 方阵$A$的格拉姆-施密特正交化

这里我们对矩阵$A$的**列**运用格拉姆-施密特正交化。
Expand Down Expand Up @@ -232,6 +244,9 @@ def adjust_sign(Q, R):

```{code-cell} ipython3
A = np.array([[1.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 1.0]])
# A = np.array([[1.0, 0.5, 0.2], [0.5, 0.5, 1.0], [0.0, 1.0, 1.0]])
# A = np.array([[1.0, 0.5, 0.2], [0.5, 0.5, 1.0]])

A
```

Expand Down Expand Up @@ -303,6 +318,10 @@ Q_scipy, R_scipy

6. 计算 $A$ 的特征值,并将其与从该过程得到的极限 $A_n$ 的对角线值进行比较。

```{todo}
@mmcky 将此迁移为使用 [sphinx-proof](https://sphinx-proof.readthedocs.io/en/latest/syntax.html#algorithms)
```

**注意:** 这个算法实际上非常接近计算特征值最高效的方法!

让我们编写一些Python代码来尝试这个算法
Expand Down Expand Up @@ -444,4 +463,3 @@ QPΛPQ = Q @ P_tilde @ Λ @ P_tilde.T @ Q.T
```{code-cell} ipython3
np.abs(QPΛPQ - XX).max()
```

Loading