# Appendix B.2 $\quad$ Complex Numbers in Linear Algebra

### Example 1

Solve the following linear system
\begin{eqnarray*}
% \nonumber to remove numbering (before each equation)
  (1+i)x_1 + (2+i)x_2 &=& 5, \\
  (2-2i)x_1 +ix_2 &=& 1+2i.
\end{eqnarray*}


```python
from sympy import *

x1, x2 = symbols('x1 x2');
Eq1 = (1+1j)*x1 + (2+1j)*x2 - 5;
Eq2 = (2-2j)*x1 + 1j*x2 - (1+2j);

solve([Eq1, Eq2], (x1, x2))
```




    {x2: 2.0 - 1.0*I, x1: 0.0}



### Example 2

Find the determinant of the coefficient matrix in Example 1.


```python
from sympy import *

A = Matrix([[1+1j, 2+1j], [2-2j, 1j]]);

A.det()
```




    -7.0 + 3.0*I



### Example 3

Find the eigenvalues and eigenvector of
\begin{equation*}
  A =
  \left[
    \begin{array}{cc}
      1 & 1 \\
      -1 & 1 \\
    \end{array}
  \right]
\end{equation*}


```python
from sympy import *

A = Matrix([[1, 1], [-1, 1]]);

A.eigenvects()
```




    [(1 - I, 1, [Matrix([
       [I],
       [1]])]), (1 + I, 1, [Matrix([
       [-I],
       [ 1]])])]



### Example 4

Find the eigenvalues and eigenvector of
\begin{equation*}
  A = \left[
        \begin{array}{ccc}
          2 & 0 & 0\\
          0 & 2 & i \\
          0 & -i & 2\\
        \end{array}
      \right]
\end{equation*}


```python
from sympy import *

A = Matrix([[2, 0, 0], [0, 2, 1j], [0, -1j, 2]]);

A.eigenvects()
```




    [(1.00000000000000, 1, [Matrix([
       [     0],
       [-1.0*I],
       [   1.0]])]), (2.00000000000000, 1, [Matrix([
       [1.0],
       [  0],
       [  0]])]), (3.00000000000000, 1, [Matrix([
       [    0],
       [1.0*I],
       [  1.0]])])]



**Remark:** If $A$ is a Hermitian matrix (i.e., $\overline{A^T} = A$), then <br /><br /><br /><br />

5893464555eaccfe3a277aa1182b7c2c027d9ebe
ipynb
Jupyter Notebook
Jupyter_Notes/Lecture37_Appdx-B2_ComplexNumbersLinearAlgebra.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture37_Appdx-B2_ComplexNumbersLinearAlgebra.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture37_Appdx-B2_ComplexNumbersLinearAlgebra.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Qwen/Qwen-72B
1. YES
2. YES