You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: notes/2025-02-27-linear-algebra-note-en.md
+58-61
Original file line number
Diff line number
Diff line change
@@ -5,59 +5,57 @@ layout: post
5
5
title: Linear Algebra Note
6
6
---
7
7
8
-
Let's break it down further with a concrete example to help clarify the concept of the canonical form of a quadratic form.
8
+
## Example
9
9
10
-
### Example
11
-
12
-
Consider the quadratic form in two variables \[x\] and \[y\]:
10
+
Consider the quadratic form in two variables \\( x \\) and \\(y\\):
13
11
14
12
\[ Q(x, y) = 2x^2 + 4xy + 3y^2 \]
15
13
16
-
####Step-by-Step Transformation to Canonical Form
14
+
### Step-by-Step Transformation to Canonical Form
17
15
18
16
1.**Matrix Representation:**
19
-
- Write the quadratic form as a matrix equation. The matrix \[A\] associated with this quadratic form is:
17
+
- Write the quadratic form as a matrix equation. The matrix \\(A\\) associated with this quadratic form is:
20
18
21
-
\[
22
-
A = \begin{pmatrix}
23
-
2 & 2 \\
24
-
2 & 3
25
-
\end{pmatrix}
26
-
\]
19
+
\[
20
+
A = \begin{pmatrix}
21
+
2 & 2 \\
22
+
2 & 3
23
+
\end{pmatrix}
24
+
\]
27
25
28
-
Note that the off-diagonal elements are half of the coefficient of the \[xy\] term.
26
+
Note that the off-diagonal elements are half of the coefficient of the \\(xy\\) term.
29
27
30
28
2.**Find Eigenvalues and Eigenvectors:**
31
-
- Compute the eigenvalues of \[A\] by solving the characteristic equation \[\det(A - \lambda I) = 0\].
29
+
- Compute the eigenvalues of \\(A\\) by solving the characteristic equation \\( \det(A - \lambda I) = 0\\).
32
30
- For each eigenvalue, find the corresponding eigenvector.
33
31
34
32
3.**Diagonalization:**
35
-
- Construct a matrix \[P\] whose columns are the eigenvectors of \[A\].
36
-
- Compute \[D = P^TAP\], which will be a diagonal matrix with the eigenvalues of \[A\] on the diagonal.
33
+
- Construct a matrix \\(P\\) whose columns are the eigenvectors of \\(A\\).
34
+
- Compute \\(D = P^TAP\\), which will be a diagonal matrix with the eigenvalues of \\(A\\) on the diagonal.
37
35
38
36
4.**Change of Variables:**
39
-
- Define new variables \[u\] and \[v\] such that:
37
+
- Define new variables \\(u\\) and \\(v\\) such that:
40
38
41
-
\[
42
-
\begin{pmatrix}
43
-
x \\
44
-
y
45
-
\end{pmatrix} = P \begin{pmatrix}
46
-
u \\
47
-
v
48
-
\end{pmatrix}
49
-
\]
39
+
\[
40
+
\begin{pmatrix}
41
+
x \\
42
+
y
43
+
\end{pmatrix} = P \begin{pmatrix}
44
+
u \\
45
+
v
46
+
\end{pmatrix}
47
+
\]
50
48
51
-
- Substitute these into the original quadratic form to get a new form in terms of \[u\] and \[v\].
49
+
- Substitute these into the original quadratic form to get a new form in terms of \\(u\\) and \\(v\\).
52
50
53
51
5.**Canonical Form:**
54
52
- The resulting quadratic form will be in the canonical form, which is a sum of squares:
55
53
56
-
\[
57
-
Q(u, v) = \lambda_1 u^2 + \lambda_2 v^2
58
-
\]
54
+
\[
55
+
Q(u, v) = \lambda_1 u^2 + \lambda_2 v^2
56
+
\]
59
57
60
-
where \[\lambda_1\] and \[\lambda_2\] are the eigenvalues of \[A\].
58
+
where \\(\lambda_1\\) and \\(\lambda_2\\) are the eigenvalues of \\(A\\).
61
59
62
60
### Interpretation
63
61
@@ -73,27 +71,27 @@ This process simplifies the quadratic form and makes it easier to analyze its pr
73
71
In the context of quadratic forms, the term "二次型的规范形" translates to "canonical form of a quadratic form" in English. Understanding this concept involves recognizing how a quadratic form can be simplified or transformed into a standard form through linear algebra techniques.
74
72
75
73
### Quadratic Forms
76
-
A quadratic form is a homogeneous polynomial of degree two in several variables. For example, in two variables \[x\] and \[y\], a quadratic form might look like:
74
+
A quadratic form is a homogeneous polynomial of degree two in several variables. For example, in two variables \\(x\\) and \\(y\\), a quadratic form might look like:
77
75
78
76
\[ Q(x, y) = ax^2 + bxy + cy^2 \]
79
77
80
78
### Canonical Form
81
79
The canonical form of a quadratic form is a simplified version that reveals essential properties, such as the rank and signature (the number of positive, negative, and zero eigenvalues). To achieve this form, we typically perform a change of variables, often through diagonalization or other orthogonal transformations.
82
80
83
81
#### Steps to Find the Canonical Form:
84
-
1.**Matrix Representation:** Represent the quadratic form as a symmetric matrix \[A\]. For the above example, the matrix would be:
85
-
\[
86
-
A = \begin{pmatrix}
87
-
a & \frac{b}{2} \\
88
-
\frac{b}{2} & c
89
-
\end{pmatrix}
90
-
\]
82
+
1.**Matrix Representation:** Represent the quadratic form as a symmetric matrix \\(A\\). For the above example, the matrix would be:
83
+
\[
84
+
A = \begin{pmatrix}
85
+
a & \frac{b}{2} \\
86
+
\frac{b}{2} & c
87
+
\end{pmatrix}
88
+
\]
91
89
92
-
2.**Diagonalization:** Find an orthogonal matrix \[P\] such that \[P^TAP\] is a diagonal matrix \[D\]. This process involves finding the eigenvalues and eigenvectors of \[A\].
90
+
2.**Diagonalization:** Find an orthogonal matrix \\(P\\) such that \\(P^TAP\\) is a diagonal matrix \\(D\\). This process involves finding the eigenvalues and eigenvectors of \\(A\\).
93
91
94
-
3.**Change of Variables:** Use the matrix \[P\] to change variables, transforming the original quadratic form into a sum of squares, each corresponding to an eigenvalue.
92
+
3.**Change of Variables:** Use the matrix \\(P\\) to change variables, transforming the original quadratic form into a sum of squares, each corresponding to an eigenvalue.
95
93
96
-
4.**Canonical Form:** The resulting diagonal matrix \[D\] represents the canonical form of the quadratic form, where each diagonal entry is an eigenvalue of \[A\].
94
+
4.**Canonical Form:** The resulting diagonal matrix \\(D\\) represents the canonical form of the quadratic form, where each diagonal entry is an eigenvalue of \\(A\\).
97
95
98
96
The canonical form helps in analyzing the properties of the quadratic form, such as determining whether it is positive definite, negative definite, or indefinite, which is crucial in optimization and other mathematical applications.
99
97
@@ -104,15 +102,15 @@ The **normal form of a quadratic form** refers to the simplified standard repres
104
102
---
105
103
106
104
### **1. Definition of a Quadratic Form**
107
-
A **quadratic form** in \[ n \] variables is a function of the form:
105
+
A **quadratic form** in \\( n \\) variables is a function of the form:
108
106
109
107
\[
110
108
Q(x) = x^T A x
111
109
\]
112
110
113
111
where:
114
-
-\[ x = (x_1, x_2, \dots, x_n)^T \] is an \[ n \]-dimensional column vector,
115
-
-\[ A \] is an \[ n \times n \] symmetric matrix.
112
+
-\\( x = (x_1, x_2, \dots, x_n)^T \\) is an \\( n \\)-dimensional column vector,
113
+
-\\( A \\) is an \\( n \times n \\) symmetric matrix.
116
114
117
115
The goal is to transform this quadratic form into a simpler, standardized form.
118
116
@@ -121,27 +119,27 @@ The goal is to transform this quadratic form into a simpler, standardized form.
121
119
### **2. Finding the Normal Form**
122
120
To simplify the quadratic form, we use an orthogonal change of variables:
123
121
124
-
1.**Find the Eigenvalues and Eigenvectors of \[ A \]:**
125
-
- Compute the eigenvalues \[ \lambda_1, \lambda_2, \dots, \lambda_n \].
122
+
1.**Find the Eigenvalues and Eigenvectors of \\( A \\):**
123
+
- Compute the eigenvalues \\( \lambda_1, \lambda_2, \dots, \lambda_n \\).
126
124
- Find an orthonormal basis of eigenvectors.
127
125
128
-
2.**Diagonalization of \[ A \]:**
129
-
- Since \[ A \] is symmetric, it can be diagonalized as \[ A = P D P^T \], where:
130
-
-\[ P \] is an orthogonal matrix (whose columns are eigenvectors of \[ A \]).
131
-
-\[ D \] is a diagonal matrix with eigenvalues \[ \lambda_1, \lambda_2, \dots, \lambda_n \] on the diagonal.
126
+
2.**Diagonalization of \\( A \\):**
127
+
- Since \\( A \\) is symmetric, it can be diagonalized as \\( A = P D P^T \\), where:
128
+
-\\( P \\) is an orthogonal matrix (whose columns are eigenvectors of \\( A \\)).
129
+
-\\( D \\) is a diagonal matrix with eigenvalues \\( \lambda_1, \lambda_2, \dots, \lambda_n \\) on the diagonal.
132
130
133
-
3.**Change of Variables:**
134
-
- Define a new variable \[ y = P^T x \], then:
131
+
3.**Change of Variables:**
132
+
- Define a new variable \\( y = P^T x \\), then:
135
133
136
-
\[
137
-
Q(x) = x^T A x = (P y)^T A (P y) = y^T (P^T A P) y = y^T D y
138
-
\]
134
+
\[
135
+
Q(x) = x^T A x = (P y)^T A (P y) = y^T (P^T A P) y = y^T D y
136
+
\]
139
137
140
-
- Since \[ D \] is diagonal, the quadratic form simplifies to:
138
+
- Since \\( D \\) is diagonal, the quadratic form simplifies to:
To manually download a `.vsix` file for a Visual Studio Code (VS Code) extension, you can use the Visual Studio Marketplace, which hosts all official extensions. The `.vsix` file is the packaged format for VS Code extensions, and while the Marketplace doesn’t always provide a direct download button, you can construct the download URL or use alternative methods. Here’s how to do it step-by-step:
11
+
12
+
### Steps to Manually Download a `.vsix` File
13
+
14
+
1.**Find the Extension on the Visual Studio Marketplace**
15
+
- Go to the [Visual Studio Marketplace](https://marketplace.visualstudio.com/vscode) in your web browser.
16
+
- Search for the extension you want (e.g., "Python" by Microsoft, "Prettier - Code formatter", etc.).
17
+
- Open the extension’s page. For example, the Python extension’s URL might look like:
- Paste this URL into your browser, and it will trigger the download of the `.vsix` file.
35
+
36
+
4. **Alternative: Use the Marketplace Page “Download Extension” Link (if available)**
37
+
- Some extension pages include a “Download Extension” link under the **Resources** section or elsewhere. If present, click it to download the `.vsix` file directly. However, this is less common, so the URL method is more reliable.
38
+
39
+
5. **Verify the Download**
40
+
- The downloaded file will have a `.vsix` extension (e.g., `ms-python.python-<version>.vsix`).
41
+
- Check the file size and name to ensure it matches the extension and version you expect.
42
+
43
+
6. **Install the `.vsix` File in VS Code (Optional)**
44
+
- Open VS Code.
45
+
- Go to the Extensions view (`Ctrl+Shift+X` or `Cmd+Shift+X` on macOS).
46
+
- Click the three-dot menu (`...`) at the top-right of the Extensions pane.
47
+
- Select **Install from VSIX**, then browse to and select the downloaded `.vsix` file.
48
+
49
+
### Example Walkthrough
50
+
Let’s say you want the **ESLint** extension by Dirk Baeumer:
- Open this URL in your browser, and the `.vsix` file (e.g., `dbaeumer.vscode-eslint-<version>.vsix`) will download.
59
+
60
+
### Notes
61
+
- **Version**: The `/latest/` part of the URL ensures you get the most recent version. If you need a specific version, you’d typically need access to the version number (visible on the Marketplace’s “Version History” tab) and might need to adjust the URL or use a tool like `ovsx` (see below), though the Marketplace API doesn’t always expose older versions easily via direct URL.
62
+
- **Blocked Downloads**: If the URL doesn’t work, the publisher might restrict direct access, or your browser/network might block it. In such cases, try a different browser or a download manager.
63
+
- **Alternative Tools**: You can use a command-line tool like `ovsx` (from the Open VSX Registry) to download extensions. Install it via npm (`npm install -g ovsx`), then run:
64
+
```
65
+
ovsx download ms-python.python
66
+
```
67
+
This downloads the `.vsix` file programmatically.
68
+
69
+
### Final Answer
70
+
To manually download a `.vsix` file for a VS Code extension:
71
+
1. Go to the extension’s page on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/vscode).
72
+
2. Identify the publisher and extension name (e.g., `ms-python.python`).
0 commit comments