{ "cells": [ { "cell_type": "code", "execution_count": 9, "id": "349bd8d2-2bc8-45e3-9f8a-7d60f7dedd39", "metadata": { "tags": [] }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 12, "id": "885fccca-d36b-4d94-ba40-03eb06df2c57", "metadata": {}, "outputs": [], "source": [ "def getA(n):\n", " A = np.zeros((n, n))\n", " for i in range(n):\n", " if i-1>=0:\n", " A[i,i-1] = 1\n", " A[i,i] = 2\n", " if i+1" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A = getA(100)\n", "\n", "n = np.arange(0,100,1)\n", "\n", "D = algoQR(A)\n", "D = np.diag(D)\n", "sorted(D)\n", "\n", "plt.scatter(n, D, s=2)\n", "\n", "plt.title(\"Les 100 valeurs propres\")\n", "\n", "plt.plot()" ] }, { "cell_type": "code", "execution_count": null, "id": "3acd9be1-2873-4969-aa8c-4fe6d021df4e", "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.11.5" } }, "nbformat": 4, "nbformat_minor": 5 }