```python
import numpy as np
import sympy as sp
from sympy import Matrix, Eq
from sympy.physics.quantum import TensorProduct

a, b, c, d, e, f, g, h, i = sp.symbols('a b c d e f g h i')
A = Matrix([[a, b, c], [d, e, f], [g, h, i]])
A_T = A.transpose()
```

$A + A'$ is symmetric**  

$(A + A')' \equiv A + A'$


```python
Eq((A + A_T).transpose(), A + A_T)
```




$\displaystyle \text{True}$



$A - A'$ is skew-symmetric  

$(A - A')' \equiv -(A - A')$


```python
Eq((A - A_T).transpose(), A_T - A)
```




$\displaystyle \text{True}$



**Square matrix = Symmetric matrix + Anti-symmetric matrix**
$A = \frac{1}{2} (A + A') + \frac{1}{2} (A - A')$


```python
Eq(A, 1/2 * (A + A_T) + 1/2 * (A - A_T))
```




$\displaystyle \text{True}$




```python

```


```python
a = np.array([[9/2, 3], [15/2, 6]])

np.linalg.det(a)
```




    4.4999999999999964




```python
a, b, c, d, e, f, g, h, i = sp.symbols('a b c d e f g h i')
m1 = Matrix([[a,b],[c,d]])
m2 = Matrix([[e,f],[g,h]])
P = TensorProduct(m1, m2)
```


```python
m1
```




$\displaystyle \left[\begin{matrix}a & b\\c & d\end{matrix}\right]$




```python
m2
```




$\displaystyle \left[\begin{matrix}e & f\\g & h\end{matrix}\right]$




```python
P
```




$\displaystyle \left[\begin{matrix}a e & a f & b e & b f\\a g & a h & b g & b h\\c e & c f & d e & d f\\c g & c h & d g & d h\end{matrix}\right]$




```python
a, b, c, d, e, f, g, h, i = sp.symbols('a b c d e f g h i')
m1 = Matrix([[a],[b]])
m2 = Matrix([[c],[d]])
P = TensorProduct(m1, m2)
```


```python
m1
```




$\displaystyle \left[\begin{matrix}a\\b\end{matrix}\right]$




```python
m2
```




$\displaystyle \left[\begin{matrix}c\\d\end{matrix}\right]$




```python
P
```




$\displaystyle \left[\begin{matrix}a c\\a d\\b c\\b d\end{matrix}\right]$




```python
a, b, c, d, e, f, g, h, i = sp.symbols('a b c d e f g h i')
m1 = Matrix([a, b])
m2 = Matrix([c,d])
P = TensorProduct(m1, m2)
```


```python
m1
```




$\displaystyle \left[\begin{matrix}a\\b\end{matrix}\right]$




```python
m2
```




$\displaystyle \left[\begin{matrix}c\\d\end{matrix}\right]$




```python
P
```




$\displaystyle \left[\begin{matrix}a c\\a d\\b c\\b d\end{matrix}\right]$




```python

```

ipynb
43d40fe4690edac65b2ff7c4cdbded97a394051a
Jupyter Notebook
91a1d98354a270d214316eba21e4a435b3e17f5d
MIT
Valentine-Efagene/Jupyter-Notebooks
Matrices.ipynb
91a1d98354a270d214316eba21e4a435b3e17f5d
MIT
Valentine-Efagene/Jupyter-Notebooks
Matrices.ipynb
91a1d98354a270d214316eba21e4a435b3e17f5d
MIT
Valentine-Efagene/Jupyter-Notebooks
Matrices.ipynb