{ "cells": [ { "cell_type": "code", "execution_count": 16, "id": "be0281ec", "metadata": {}, "outputs": [], "source": [ "from sympy import *\n", "init_printing()" ] }, { "cell_type": "code", "execution_count": 2, "id": "97edff56", "metadata": {}, "outputs": [], "source": [ "a,b = symbols (\"a b\", real=True)" ] }, { "cell_type": "code", "execution_count": 13, "id": "030b64fa", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}b & a\\\\a & b\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[b, a],\n", "[a, b]])" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m = Matrix([[b,a],[a,b]])\n", "m" ] }, { "cell_type": "code", "execution_count": 14, "id": "dce34bae", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}- \\frac{b}{a^{2} - b^{2}} & \\frac{a}{a^{2} - b^{2}}\\\\- \\frac{a}{- a^{2} + b^{2}} & \\frac{b}{- a^{2} + b^{2}}\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ -b/(a**2 - b**2), a/(a**2 - b**2)],\n", "[-a/(-a**2 + b**2), b/(-a**2 + b**2)]])" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m**-1" ] }, { "cell_type": "code", "execution_count": 17, "id": "e2c1d1eb", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[ \\left( - a + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}-1\\\\1\\end{matrix}\\right]\\right]\\right), \\ \\left( a + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}1\\\\1\\end{matrix}\\right]\\right]\\right)\\right]$" ], "text/plain": [ "⎡⎛ ⎡⎡-1⎤⎤⎞ ⎛ ⎡⎡1⎤⎤⎞⎤\n", "⎢⎜-a + b, 1, ⎢⎢ ⎥⎥⎟, ⎜a + b, 1, ⎢⎢ ⎥⎥⎟⎥\n", "⎣⎝ ⎣⎣1 ⎦⎦⎠ ⎝ ⎣⎣1⎦⎦⎠⎦" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.eigenvects()" ] }, { "cell_type": "code", "execution_count": 18, "id": "c63c0321", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}b & a & 0\\\\a & b & a\\\\0 & a & b\\end{matrix}\\right]$" ], "text/plain": [ "⎡b a 0⎤\n", "⎢ ⎥\n", "⎢a b a⎥\n", "⎢ ⎥\n", "⎣0 a b⎦" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m = Matrix([[b, a, 0],[a, b,a], [0, a,b]])\n", "m" ] }, { "cell_type": "code", "execution_count": 19, "id": "d3b95f9f", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}\\frac{a^{2} - b^{2}}{2 a^{2} b - b^{3}} & \\frac{a}{2 a^{2} - b^{2}} & - \\frac{a^{2}}{2 a^{2} b - b^{3}}\\\\\\frac{a}{2 a^{2} - b^{2}} & - \\frac{b}{2 a^{2} - b^{2}} & \\frac{a}{2 a^{2} - b^{2}}\\\\- \\frac{a^{2}}{2 a^{2} b - b^{3}} & \\frac{a}{2 a^{2} - b^{2}} & \\frac{a^{2} - b^{2}}{2 a^{2} b - b^{3}}\\end{matrix}\\right]$" ], "text/plain": [ "⎡ 2 2 2 ⎤\n", "⎢ a - b a -a ⎥\n", "⎢─────────── ───────── ───────────⎥\n", "⎢ 2 3 2 2 2 3⎥\n", "⎢2⋅a ⋅b - b 2⋅a - b 2⋅a ⋅b - b ⎥\n", "⎢ ⎥\n", "⎢ a -b a ⎥\n", "⎢ ───────── ───────── ───────── ⎥\n", "⎢ 2 2 2 2 2 2 ⎥\n", "⎢ 2⋅a - b 2⋅a - b 2⋅a - b ⎥\n", "⎢ ⎥\n", "⎢ 2 2 2 ⎥\n", "⎢ -a a a - b ⎥\n", "⎢─────────── ───────── ───────────⎥\n", "⎢ 2 3 2 2 2 3⎥\n", "⎣2⋅a ⋅b - b 2⋅a - b 2⋅a ⋅b - b ⎦" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m**-1" ] }, { "cell_type": "code", "execution_count": 20, "id": "dcb7977d", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[ \\left( b, \\ 1, \\ \\left[ \\left[\\begin{matrix}-1\\\\0\\\\1\\end{matrix}\\right]\\right]\\right), \\ \\left( - \\sqrt{2} a + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}1\\\\- \\frac{b}{a} + \\frac{- \\sqrt{2} a + b}{a}\\\\1\\end{matrix}\\right]\\right]\\right), \\ \\left( \\sqrt{2} a + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}1\\\\- \\frac{b}{a} + \\frac{\\sqrt{2} a + b}{a}\\\\1\\end{matrix}\\right]\\right]\\right)\\right]$" ], "text/plain": [ "⎡ ⎛ ⎡⎡ 1 ⎤⎤⎞ ⎛ ⎡⎡ 1 \n", "⎢⎛ ⎡⎡-1⎤⎤⎞ ⎜ ⎢⎢ ⎥⎥⎟ ⎜ ⎢⎢ \n", "⎢⎜ ⎢⎢ ⎥⎥⎟ ⎜ ⎢⎢ b -√2⋅a + b⎥⎥⎟ ⎜ ⎢⎢ b √2\n", "⎢⎜b, 1, ⎢⎢0 ⎥⎥⎟, ⎜-√2⋅a + b, 1, ⎢⎢- ─ + ─────────⎥⎥⎟, ⎜√2⋅a + b, 1, ⎢⎢- ─ + ──\n", "⎢⎜ ⎢⎢ ⎥⎥⎟ ⎜ ⎢⎢ a a ⎥⎥⎟ ⎜ ⎢⎢ a \n", "⎢⎝ ⎣⎣1 ⎦⎦⎠ ⎜ ⎢⎢ ⎥⎥⎟ ⎜ ⎢⎢ \n", "⎣ ⎝ ⎣⎣ 1 ⎦⎦⎠ ⎝ ⎣⎣ 1 \n", "\n", " ⎤⎤⎞⎤\n", " ⎥⎥⎟⎥\n", "⋅a + b⎥⎥⎟⎥\n", "──────⎥⎥⎟⎥\n", " a ⎥⎥⎟⎥\n", " ⎥⎥⎟⎥\n", " ⎦⎦⎠⎦" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.eigenvects()" ] }, { "cell_type": "code", "execution_count": 21, "id": "5839e29d", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}b & a & 0 & 0\\\\a & b & a & 0\\\\0 & a & b & a\\\\0 & 0 & a & b\\end{matrix}\\right]$" ], "text/plain": [ "⎡b a 0 0⎤\n", "⎢ ⎥\n", "⎢a b a 0⎥\n", "⎢ ⎥\n", "⎢0 a b a⎥\n", "⎢ ⎥\n", "⎣0 0 a b⎦" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m = Matrix([[b, a, 0, 0],[a, b,a, 0], [0,a,b,a], [0, 0, a,b]])\n", "m" ] }, { "cell_type": "code", "execution_count": 22, "id": "7ec1b660", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}\\frac{- 2 a^{2} b + b^{3}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{a^{3} - a b^{2}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{a^{2} b}{a^{4} - 3 a^{2} b^{2} + b^{4}} & - \\frac{a^{3}}{a^{4} - 3 a^{2} b^{2} + b^{4}}\\\\\\frac{a^{3} - a b^{2}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{- a^{2} b + b^{3}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & - \\frac{a b^{2}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{a^{2} b}{a^{4} - 3 a^{2} b^{2} + b^{4}}\\\\\\frac{a^{2} b}{a^{4} - 3 a^{2} b^{2} + b^{4}} & - \\frac{a b^{2}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{- a^{2} b + b^{3}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{a^{3} - a b^{2}}{a^{4} - 3 a^{2} b^{2} + b^{4}}\\\\- \\frac{a^{3}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{a^{2} b}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{a^{3} - a b^{2}}{a^{4} - 3 a^{2} b^{2} + b^{4}} & \\frac{- 2 a^{2} b + b^{3}}{a^{4} - 3 a^{2} b^{2} + b^{4}}\\end{matrix}\\right]$" ], "text/plain": [ "⎡ 2 3 3 2 2 3 ⎤\n", "⎢ - 2⋅a ⋅b + b a - a⋅b a ⋅b -a ⎥\n", "⎢───────────────── ───────────────── ───────────────── ─────────────────⎥\n", "⎢ 4 2 2 4 4 2 2 4 4 2 2 4 4 2 2 4⎥\n", "⎢a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b ⎥\n", "⎢ ⎥\n", "⎢ 3 2 2 3 2 2 ⎥\n", "⎢ a - a⋅b - a ⋅b + b -a⋅b a ⋅b ⎥\n", "⎢───────────────── ───────────────── ───────────────── ─────────────────⎥\n", "⎢ 4 2 2 4 4 2 2 4 4 2 2 4 4 2 2 4⎥\n", "⎢a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b ⎥\n", "⎢ ⎥\n", "⎢ 2 2 2 3 3 2 ⎥\n", "⎢ a ⋅b -a⋅b - a ⋅b + b a - a⋅b ⎥\n", "⎢───────────────── ───────────────── ───────────────── ─────────────────⎥\n", "⎢ 4 2 2 4 4 2 2 4 4 2 2 4 4 2 2 4⎥\n", "⎢a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b ⎥\n", "⎢ ⎥\n", "⎢ 3 2 3 2 2 3 ⎥\n", "⎢ -a a ⋅b a - a⋅b - 2⋅a ⋅b + b ⎥\n", "⎢───────────────── ───────────────── ───────────────── ─────────────────⎥\n", "⎢ 4 2 2 4 4 2 2 4 4 2 2 4 4 2 2 4⎥\n", "⎣a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b a - 3⋅a ⋅b + b ⎦" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m**-1" ] }, { "cell_type": "code", "execution_count": 23, "id": "42545146", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[ \\left( - \\frac{a}{2} + \\frac{\\sqrt{5} a}{2} + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}-1\\\\\\frac{b}{a} - \\frac{- \\frac{a}{2} + \\frac{\\sqrt{5} a}{2} + b}{a}\\\\- \\frac{b}{a} + \\frac{- \\frac{a}{2} + \\frac{\\sqrt{5} a}{2} + b}{a}\\\\1\\end{matrix}\\right]\\right]\\right), \\ \\left( \\frac{a}{2} + \\frac{\\sqrt{5} a}{2} + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}1\\\\- \\frac{b}{a} + \\frac{\\frac{a}{2} + \\frac{\\sqrt{5} a}{2} + b}{a}\\\\- \\frac{b}{a} + \\frac{\\frac{a}{2} + \\frac{\\sqrt{5} a}{2} + b}{a}\\\\1\\end{matrix}\\right]\\right]\\right), \\ \\left( - \\frac{\\sqrt{5} a}{2} - \\frac{a}{2} + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}-1\\\\\\frac{b}{a} - \\frac{- \\frac{\\sqrt{5} a}{2} - \\frac{a}{2} + b}{a}\\\\- \\frac{b}{a} + \\frac{- \\frac{\\sqrt{5} a}{2} - \\frac{a}{2} + b}{a}\\\\1\\end{matrix}\\right]\\right]\\right), \\ \\left( - \\frac{\\sqrt{5} a}{2} + \\frac{a}{2} + b, \\ 1, \\ \\left[ \\left[\\begin{matrix}1\\\\- \\frac{b}{a} + \\frac{- \\frac{\\sqrt{5} a}{2} + \\frac{a}{2} + b}{a}\\\\- \\frac{b}{a} + \\frac{- \\frac{\\sqrt{5} a}{2} + \\frac{a}{2} + b}{a}\\\\1\\end{matrix}\\right]\\right]\\right)\\right]$" ], "text/plain": [ "⎡⎛ ⎡⎡ -1 ⎤⎤⎞ ⎛ ⎡⎡ 1 \n", "⎢⎜ ⎢⎢ ⎥⎥⎟ ⎜ ⎢⎢ \n", "⎢⎜ ⎢⎢ a √5⋅a ⎥⎥⎟ ⎜ ⎢⎢ a \n", "⎢⎜ ⎢⎢ - ─ + ──── + b ⎥⎥⎟ ⎜ ⎢⎢ ─ + \n", "⎢⎜ ⎢⎢ b 2 2 ⎥⎥⎟ ⎜ ⎢⎢ b 2 \n", "⎢⎜ ⎢⎢ ─ - ────────────── ⎥⎥⎟ ⎜ ⎢⎢- ─ + ────\n", "⎢⎜ a √5⋅a ⎢⎢ a a ⎥⎥⎟ ⎜a √5⋅a ⎢⎢ a \n", "⎢⎜- ─ + ──── + b, 1, ⎢⎢ ⎥⎥⎟, ⎜─ + ──── + b, 1, ⎢⎢ \n", "⎢⎜ 2 2 ⎢⎢ a √5⋅a ⎥⎥⎟ ⎜2 2 ⎢⎢ a \n", "⎢⎜ ⎢⎢ - ─ + ──── + b⎥⎥⎟ ⎜ ⎢⎢ ─ + \n", "⎢⎜ ⎢⎢ b 2 2 ⎥⎥⎟ ⎜ ⎢⎢ b 2 \n", "⎢⎜ ⎢⎢- ─ + ──────────────⎥⎥⎟ ⎜ ⎢⎢- ─ + ────\n", "⎢⎜ ⎢⎢ a a ⎥⎥⎟ ⎜ ⎢⎢ a \n", "⎢⎜ ⎢⎢ ⎥⎥⎟ ⎜ ⎢⎢ \n", "⎣⎝ ⎣⎣ 1 ⎦⎦⎠ ⎝ ⎣⎣ 1 \n", "\n", " ⎤⎤⎞ ⎛ ⎡⎡ -1 ⎤⎤⎞ ⎛ \n", " ⎥⎥⎟ ⎜ ⎢⎢ ⎥⎥⎟ ⎜ \n", "√5⋅a ⎥⎥⎟ ⎜ ⎢⎢ √5⋅a a ⎥⎥⎟ ⎜ \n", "──── + b⎥⎥⎟ ⎜ ⎢⎢ - ──── - ─ + b ⎥⎥⎟ ⎜ \n", " 2 ⎥⎥⎟ ⎜ ⎢⎢ b 2 2 ⎥⎥⎟ ⎜ \n", "────────⎥⎥⎟ ⎜ ⎢⎢ ─ - ────────────── ⎥⎥⎟ ⎜ \n", " a ⎥⎥⎟ ⎜ √5⋅a a ⎢⎢ a a ⎥⎥⎟ ⎜ √5⋅a a \n", " ⎥⎥⎟, ⎜- ──── - ─ + b, 1, ⎢⎢ ⎥⎥⎟, ⎜- ──── + ─ + b, 1\n", "√5⋅a ⎥⎥⎟ ⎜ 2 2 ⎢⎢ √5⋅a a ⎥⎥⎟ ⎜ 2 2 \n", "──── + b⎥⎥⎟ ⎜ ⎢⎢ - ──── - ─ + b⎥⎥⎟ ⎜ \n", " 2 ⎥⎥⎟ ⎜ ⎢⎢ b 2 2 ⎥⎥⎟ ⎜ \n", "────────⎥⎥⎟ ⎜ ⎢⎢- ─ + ──────────────⎥⎥⎟ ⎜ \n", " a ⎥⎥⎟ ⎜ ⎢⎢ a a ⎥⎥⎟ ⎜ \n", " ⎥⎥⎟ ⎜ ⎢⎢ ⎥⎥⎟ ⎜ \n", " ⎦⎦⎠ ⎝ ⎣⎣ 1 ⎦⎦⎠ ⎝ \n", "\n", " ⎡⎡ 1 ⎤⎤⎞⎤\n", " ⎢⎢ ⎥⎥⎟⎥\n", " ⎢⎢ √5⋅a a ⎥⎥⎟⎥\n", " ⎢⎢ - ──── + ─ + b⎥⎥⎟⎥\n", " ⎢⎢ b 2 2 ⎥⎥⎟⎥\n", " ⎢⎢- ─ + ──────────────⎥⎥⎟⎥\n", " ⎢⎢ a a ⎥⎥⎟⎥\n", ", ⎢⎢ ⎥⎥⎟⎥\n", " ⎢⎢ √5⋅a a ⎥⎥⎟⎥\n", " ⎢⎢ - ──── + ─ + b⎥⎥⎟⎥\n", " ⎢⎢ b 2 2 ⎥⎥⎟⎥\n", " ⎢⎢- ─ + ──────────────⎥⎥⎟⎥\n", " ⎢⎢ a a ⎥⎥⎟⎥\n", " ⎢⎢ ⎥⎥⎟⎥\n", " ⎣⎣ 1 ⎦⎦⎠⎦" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.eigenvects()" ] }, { "cell_type": "code", "execution_count": 26, "id": "c5ec9626", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}b & a & 0 & 0\\\\a & b & a & 0\\\\0 & a & b & a\\\\0 & 0 & a & b\\end{matrix}\\right]$" ], "text/plain": [ "⎡b a 0 0⎤\n", "⎢ ⎥\n", "⎢a b a 0⎥\n", "⎢ ⎥\n", "⎢0 a b a⎥\n", "⎢ ⎥\n", "⎣0 0 a b⎦" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m = Matrix([[b, a, 0, 0],[a, b,a, 0], [0,a,b,a], [0, 0, a,b]])\n", "m" ] }, { "cell_type": "code", "execution_count": 27, "id": "6733b015", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAJsAAAAUCAYAAACah0+BAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAABJ0AAASdAHeZh94AAAFAklEQVR4nO2aW2wVVRSGv1YQIreqaMHQGFDhgYuNaLw1im3UGDUovoARUzVeaIhBUjU1mOVvosKLUkN5MBGkhkSN0Sa8GARL4jUGaEVA47V9AYxyMdYIWlIf9oyZTs85zMyZmdakf3Iyp3vv+ddas//utfc6UzEwMMAoRpEHxqRFJKkFeBFoM7OVafGOJHgxLgHmAKeAL4AWM9s/krnzRjEtVKZEfg3wCLAvDb4RjEXARuA6oB7oB3ZIOm+Ec+eGUlooe2WTNAXYCjwIWLl8Ixlmdmvwb0nLgd+B64Ftob4VOPE8ZGab0uTOA3H99+4pqY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E+KYksZmfnv71H8lDbLy9k++fnA28AMXIrpjmsgD0ia7f0uF26v9Iq6FwKfmdlxso/VP8ktkzQhwD8Rl8rHAY8nKfbmhMz8r/DfZ5O0E/e2QRewA1fkvA3oxL36st/MLi8jiMwgaRXwEvAJ8DNu/1UN3Iirox0BGszsoDc+k1gljQH+AL4BzsEVNjtwE7QEt8KuMrNXk0Uay5dGYv6CkLX/wdPXUtxepgZYAVwCrMbVUipJab+WEXbgio4X4B7Kk8A9wDFAwFxfaB6yinUu7pS2G2gAvsalnUbcb4z1eQitDGTqf8Xom7qjyAupvDw5ilFEwb9Oc2F4N+e/TAAAAABJRU5ErkJggg==\n", "text/latex": [ "$\\displaystyle a^{4} - 3 a^{2} b^{2} + b^{4}$" ], "text/plain": [ " 4 2 2 4\n", "a - 3⋅a ⋅b + b " ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.det()" ] }, { "cell_type": "code", "execution_count": 71, "id": "a3cad99a", "metadata": {}, "outputs": [], "source": [ "from scipy import pi\n", "from scipy.sparse import diags\n", "from scipy.sparse.linalg import eigs\n", "from scipy.linalg import eig, det, norm" ] }, { "cell_type": "code", "execution_count": 75, "id": "354b8a80", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<5x5 sparse matrix of type ''\n", "\twith 13 stored elements (3 diagonals) in DIAgonal format>" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d = diags([1,-2,1], [-1,0,1], shape=(5,5))\n", "d" ] }, { "cell_type": "code", "execution_count": 76, "id": "1af4b59e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[-2., 1., 0., 0., 0.],\n", " [ 1., -2., 1., 0., 0.],\n", " [ 0., 1., -2., 1., 0.],\n", " [ 0., 0., 1., -2., 1.],\n", " [ 0., 0., 0., 1., -2.]])" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d.toarray()" ] }, { "cell_type": "code", "execution_count": 77, "id": "5693e5a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$" ], "text/plain": [ "-6.0" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "det(d.toarray())" ] }, { "cell_type": "code", "execution_count": 78, "id": "2c8972d8", "metadata": {}, "outputs": [], "source": [ "u,v = eig(d.toarray())" ] }, { "cell_type": "code", "execution_count": 79, "id": "4de3e85f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([-3.73205081+0.j, -3. +0.j, -2. +0.j, -0.26794919+0.j,\n", " -1. +0.j])" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "u" ] }, { "cell_type": "code", "execution_count": 80, "id": "2e9cb38f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[-2.88675135e-01, -5.00000000e-01, 5.77350269e-01,\n", " 2.88675135e-01, -5.00000000e-01],\n", " [ 5.00000000e-01, 5.00000000e-01, -8.85199041e-17,\n", " 5.00000000e-01, -5.00000000e-01],\n", " [-5.77350269e-01, -1.92938494e-15, -5.77350269e-01,\n", " 5.77350269e-01, 1.09260986e-16],\n", " [ 5.00000000e-01, -5.00000000e-01, -3.97217852e-16,\n", " 5.00000000e-01, 5.00000000e-01],\n", " [-2.88675135e-01, 5.00000000e-01, 5.77350269e-01,\n", " 2.88675135e-01, 5.00000000e-01]])" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v" ] }, { "cell_type": "code", "execution_count": 81, "id": "adeeae51", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMQAAAAQCAYAAABJCdBSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAABJ0AAASdAHeZh94AAAHIklEQVR4nO2af6yWZR3GPwdpyMiwicSyEjuLUtSWmWIWckZhiVla1tY0dSU5dWACZbZ2ebm5tBVCUsPKQZn/mA4XCfgDWYSSboJDh6ULj2lLSghHE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uYeaZK2jZMJQIxuxBh03actia8x6X0MCJEq4rfpWWDNLOeSkQZTiecwl7CGZ9W0enWE3dfeoEvA9cSg3QjcAlwbovT2LZ50sHaOcR1i21ENGY+sSVZDZwtaUknHGXUbJfa+iW9TERulhK+zDzixsAq4ExJ92bla+vvtk3PyPXvEYzg//gvAZ7FFv8phkQAAAAASUVORK5CYII=\n", "text/latex": [ "$\\displaystyle 3.73205080756888$" ], "text/plain": [ "3.732050807568877" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "norm(d @ v[:,0])" ] }, { "cell_type": "code", "execution_count": 82, "id": "bd49e23d", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAACEAAAAQCAYAAACYwhZnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAABJ0AAASdAHeZh94AAACE0lEQVR4nM3VS4iOYRQH8N+IjduocZlEQsbCToqiJCUpG9aKhRJFwgKL49CEDTEoCyVlY8NSLtm4paQsyGhcVkhuyaVcxuJ9v3rnMx/vrDibf89zLs//Oc9zzmnr7+/3r2V4dZGZBzEPXRiPL3iOCzgWEW+GEjwzp2AvlqMDL8pYGRHvGnbDmvy2YhQu4wjO4jv24H5mTh0CgZm4i3W4g8N4gi24lZkdDdvhTb5jI+LrIAG7sQs7sbEmjxOYiM0R0VOJdUhx2W5soCkTgxEo5VyJs+qcXmZhGZ7heJM68AlrMnPUbyT+ICtLvF/TfkmJlyLi5wAGER9xAyOxgN+fA2TmdoxGu+KjLioJHKhJYnaJvS30jxWZ6sLVQUlgOyZV1hexNiJe1yTRXuKHFvrG/jhaPEdEdEZEGzqxCjNwLzPn1iQxJPnjn4iIVxFxXpG6DpypGbdx0/YW+sb++7+SqJB5jgeYk5nja7g8KrGrhb5RZb21SZQyucQfNWyvlbgsMweckZljsBCfcZtKdWRmF15FxIcmp2HYp2g8N6vttuwHI9AXEd8a+xHRl5mXFM+4CT3VkIqufDIiPg0ggRXYn5nX8RRvFBWyWPExX2J9042vYhqmKxpTVTbiJo5m5lI8xHxFD+nF7oZhNVVXcAoTFBWxA6vxtmQ/JyIeqCkR0afoMafLw7dhpmImLagOw7b/YZT/Aq08n7klxTdrAAAAAElFTkSuQmCC\n", "text/latex": [ "$\\displaystyle 3.0$" ], "text/plain": [ "3.0000000000000004" ] }, "execution_count": 82, "metadata": {}, "output_type": "execute_result" } ], "source": [ "norm(d @ v[:,1])" ] }, { "cell_type": "code", "execution_count": 83, "id": "fddafbb9", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAACEAAAAQCAYAAACYwhZnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAABJ0AAASdAHeZh94AAAB/UlEQVR4nMXVS6hOURQH8N/1mJAoZUKhm8eAmaKMbkqiFDJEZvK4yECRVkspI1xkQlFmSpkQSpI8SynyuB6ZkeSRGHhdg7O/fPdzP843kP/kf/Zea6/9X+ess1bXwMCA/40RjYfMHI9lWILZmIgvuIfjOB4RPzoJnpmTsBuLMB4vcQYZEe8afsOazqzEUczFLRzAaczCMZzKzK4OBHTjDtbiNvbjOTbjRkkaTW8C/ViKs80ZZ+aOEmQFlhdhdXAEE9AbEYea4u3DVuzBOuiqUxNFyB4cjohNNfy78RQv0N2S1BjVZ+nChIj4NGzIKL/ja+FvNf17Cl9sraOI+IhrGIV5DK6JIZGZI7C6LM/XFDGjcH8b+5PC02uJwF5VcZ6LiAs1RYwt/KGNvbE/7q8iMrMX2/AIq2oK6BhtRWTmRvThAXoi4m0HcRuZjm1jb+y/bysiM7fgEO4XAa86EACPC09vY59WuH9IEZm5XdVY7hYBrzsUAJcLL8zMQXeUX3Q+PuPmbyIyc5eqEO9gQUS8+dNNmdmdmTMzc2TzfkQ8w0VMwYbWYxiNkxHxicGzY42qz3/HVfRmZuu9LyLiRNP6EiZjqqoxNWM9ruNgZi7AQ9VI6FF9hp0Nx+a2PbXwcGwZInG4ghNtbIMQEc8yc45fA2yxqlP2aRlgtdr2v8ZPs8impa2oY0IAAAAASUVORK5CYII=\n", "text/latex": [ "$\\displaystyle 2.0$" ], "text/plain": [ "2.0" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "norm(d @ v[:,2])" ] }, { "cell_type": "code", "execution_count": 72, "id": "e9d3abcf", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAALcAAAAQCAYAAABUd+7JAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAABJ0AAASdAHeZh94AAAHqklEQVR4nO2ae7BXVRXHP1cRdRDRMKWXqRRlZsJoCPlAJck0GCippoHEGWAcZRATp6Jo8a1xxEoTtQc+BpSamkrTSCSMGIm0YSYvow0iZDzCVIRCASET6I+1D3fffc/53XPO796acfjO/Gafc/Zee62zzvqtvdbau2X//v0cxEG8FdEjvpF0OTAMGAicAfQGfmJm46pOLGkD8N6C7pfNrF8YNwGY18l0+8zs0Bwe7wa+CVwC9AVeBB4CZGb/isbV4iGpBZgYfqcBLcCzwD3AXWa2r2gyScOBKcBQ4FhgG/AMMMfMFkXjbgbOAgYAxwG7gY3hPe40s23JvH2BMcBlwOnAu4A3wtzzgHldJNcEKuqsGX1Fc4wDFoTbSWZ2T86YUnx6JHRfx416J7AZ+GBnwnSCV4Hbcp7vjK5XASqgPw+4CHg07ZDUH3gCOB54GFgDDAauBS6RdE5kGLV4AD8GvgBsAX4KvA5cDPwQ+BjwxbwJJX0buAHX4a+BrcDbgTOBC4BF0fDrgKeAxwKfXsAQYBYwWdIQM/t7NH5s4P8isAzYBJwAfBr/uJ+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count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pi/2" ] }, { "cell_type": "code", "execution_count": 73, "id": "49328e4a", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMQAAAAQCAYAAABJCdBSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAABJ0AAASdAHeZh94AAAHwElEQVR4nO2afbBWVRXGfxcRNVQoLOnLDyzKzIQZBynxu0xBSzLKacCPGSXHHEJlkCh6eGoMmNIU7QPUgUKnpjHFSiVQGYmsnFEZa9QgBPwoUEANBMKA/lj7xPFwDvec997rX/eZeWe/Z5+191p7n7X2Xmvt3bZr1y660Y1uBHrmH2x/ETgFGAQcBxwE3ClpdJ3ObF8MzGmHbKekfVqhT236ASOBEcCxwPuB7cBfU19zJO2sIetoYF56vEzSbSU0q4HDK7pYJ6l/gX4GcDwwEDgE2AqsAeYDt0jaUCHLCODrwMeAfsC/gMeBGyT9qaNy5dp9APgOcFaOz3zAkl4t0LYBl6bfMUAb8AxwGzC7ao6b8GhlLC3QN9KXtxgE8C3CEDYDLwIfrWBchWWAK96dBJwOPNABeoBRwE+IiV4MPA8cCnyB+Fhn2x4lqXLrs/1B4BZinAdWjibwOnBjSf3mkrqrgCeARcDLQG9gKDAVGGt7qKQXCrLMACYCGwjFWQ98CPg8cL7tCyXd0UG5sH0U8CjwHuBe4FlgCGGIZ9k+sWCwdwBfSeP4BbAF+Awx958CLuwEHi2NpSF9I30pGsRVhCH8g9gpFlcIVApJywgl3wO2s5Vudqv0CcuBzwH35S3b9mTgMeB8YrC/rui3jVgZNgB3AxMqBxR4TdLUdmgyHCxpWwnP64DJwDeAK3L1/RP/dcAnJL2ce3ca8DCx2pYZRBO5AH5MKOo4STfn+NxAfPfrgMtT3UjCGFYBQyStT/W9iHkdY3u+pLtb5dHBsTShb6QvPfItJS2W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Ud4dEOGs1xHfo6+tJlO0SauDFEcHx7F9BfSwxuGWHpZcYA8J/UX9nvyUSzND3XdaeGprKOkmZ4Xyrzhr5fKqtSq1n99or3deXKDO5M22/55rYPAk4kDt7+XIPHBUAv4rCuq3hA8zneK31dfenQDpFyz/sCK9OKkscoIuj6Xc3guDa97SnEgdXjRLC6sYo2BdCXVvQzlVh9f1a8upFStM9LeqNQfwTh60PuwMz2QOLqwOsF+h7Ad4kDq0cL1xf+QOTzx9qeJemlXLuzCSXaRpz+tiRXmoOVthcSrtvXgJvzTYlVdVa+T9sHS/p3gccg4PvAq+yZMWuFR9M5bjz29L62vhTvMp0HnJces1z0J23PTf/XS8qf7D5EHC4dSRzI5JG5P8WT5irUord9ETG4HYRCjStxg1ZLmlusbIgvE/77EuI+0iYiHToC2J+IcX6Qox8OTLO9lDjh3UBcETiFSE+uJbJIedwFPEgEq8/YvifRHU24U23ApMJ1h6ZyZbiCMKyZts8g7iWdQJwfLAe+WaBfZHsr4V5sSjKNIO5nnSvpn53Ao+lYGo+9qb4Ud4hBRPCUxwB2557X0P5Vh8ySh1E/mG5Cn+XG9yHSmmV4BJjbHt92sJjIrQ8mVureREC4lMiBzyuc6D9I3EEaltr0JQ6Nlif6mcWVSdJO28OJFfUCIl54B7CRmIeZkhZ2UK6M10rbx7P74t1w4n7PTZRfvLsryTQaOIAI8GcD0yS9WDZhLfBoOpZWxt5IX9q6r393oxu78T+kSRjoyMZNswAAAABJRU5ErkJggg==\n", "text/latex": [ "$\\displaystyle 1.77245385090552$" ], "text/plain": [ "1.77245385090552" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sqrt(pi)" ] }, { "cell_type": "code", "execution_count": 74, "id": "52b21824", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAANIAAAAQCAYAAABjuSH9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYX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bVFk2Qvqz+39oSzqiFm8ah6XsNhMDjyWHYhEtfI5qNknu3YkSRvNbCW+zV8N3BY1Mny2LpXUdR8Q7p4OBjbGOfWQ+twcy4b6E/FYHqKLwrAiPoJnm6YDP4jajMbPGzvwQzHhADsl48dhZvPwVfierFeEqsTv8DufaWa2VNLrUT+fwReXTvxtkJjD4ZL+laprBr6Hr2TzU8+qslcZbmY2GH8N5l3JpOAk38EP108reg2sxDjWY1wuwRMxjxZMMhSSb7RPppMNV+GGv9X8/aL1wOn4HdPLwDdS8qvwi8GT8IvcBF/E4/M1+LtcHXhadixwCB7Hfj+l62rc0AtDzr4t6L0IX22mpJ2gDMzsoqATuu98RpjZ8vD3NknJDfx9wFN4omC9mT2IH+hPxkOrJuD6jNemnjSz3fhhtiPIj8XfbRsv6W8p+TL2qpbbZ4GbzGwtvopuB47D3+4YGNpOrQOvWpGEaXlvJpSVb6hPvmvLkrQRv1dYjk+gWaGzxUBLhsPkYTXwaGh7KTATH7C1+MF7XPoyUtIW/P2lJfg5Yjr+LtMjwEhJ9xfs+0BopjsBMCbUDYzqJkac9uIOOANYh585ZuGhwGPAGEmLM/q4D0+VTsJ/+zB8oIdk3btQzl7VcnsKD32OwVPmc4CLgbfwiGOopHW18qoFYdc4g+JJhmrkG+qTTT3/RtGDHtSO/wNhapZovPuQIgAAAABJRU5ErkJggg==\n", "text/latex": [ "$\\displaystyle 0.564189583547756$" ], "text/plain": [ "0.564189583547756" ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "1/sqrt(pi)" ] }, { "cell_type": "code", "execution_count": null, "id": "17e42a79", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }