{ "nbformat_minor": 2, "nbformat": 4, "cells": [ { "source": [ "$$\n", "\\def\\CC{\\bf C}\n", "\\def\\QQ{\\bf Q}\n", "\\def\\RR{\\bf R}\n", "\\def\\ZZ{\\bf Z}\n", "\\def\\NN{\\bf N}\n", "$$\n", "# Dynamics of a linear maps\n", "\n", "In this worksheet we study the dynamics of a very simple linear map\n", "\n", "$$A = \\begin{pmatrix}\n", "2 & 1 \\\\\n", "1 & 1\n", "\\end{pmatrix}.$$\n", "\n", "## Action on $\\mathbb{R}^2$\n", "\n", "Create a variable `A` initialized to be the above matrix (check the command `matrix`):" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Create a variable `v` that contains the vector $(1, 1)$ (check the command `vector`):" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "To compute the image of a vector under a matrix you need to use the multiplication `*`. Compute the image `A * v` :" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Write a function `draw_orbit(A, v0, n)` that draw the `n`-th first iterate of the orbit of `v0` under `A`. That is the sequence of vectors $v_0$, $A v_0$, $A^2 v_0$, ..., $A^{n-1} v_0$ (you can use the graphics primitives `point2d` or `line2d`):" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "On the same graphics, draw several of these orbits:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "What is happening to them?\n", "\n", "The object `AA` in Sage stands for \"real algebraic numbers\". It is one way to consider exact numbers beyond integers and rationals.:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "AA" ], "outputs": [], "metadata": {} }, { "source": [ "In the following cell, we create the algebraic number $\\sqrt{5}$ and the golden ratio $\\phi = \\frac{1 + \\sqrt{5}}{2}$ :" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "a = AA(5).sqrt()\n", "phi = (1 + a) / 2" ], "outputs": [], "metadata": {} }, { "source": [ "Check with Sage that the vectors $u_+ = (1, -\\phi)$ and $u_- = (1, \\phi-1)$ are eigenvectors of the matrix $A$ :" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "up = vector([1, -phi])\n", "um = vector([1, phi-1])" ], "outputs": [], "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Create a graphics with several orbits together with the lines $\\mathbb{R} u_+$ and $\\mathbb{R} u_-$ :" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "## Action on $\\mathbb{R}^2 / \\mathbb{Z}^2$\n", "\n", "Show that the linear action of $A$ on $\\mathbb{R}^2$ gives a well defined map $\\overline{A}$ on the quotient $\\mathbb{R}^2 / \\mathbb{Z}^2$. Show that it is a bijection.\n", "\n", "Let us consider the fundamental domain $T = [0,1] \\times [0,1]$. Write a function `toral_map(v)` that applies the map $\\overline{A}$ to a vector $v$ in $T$.:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Let $v = (1/2,0)$. Show that $\\overline{A}^3 v = v$ but $\\overline{A}^n v \\not=\n", "v$ for $n = 1,2$.:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "We say that $v = (1/2,0)$ is a *periodic point of period 3*.\n", "\n", "Show more generally that any vector in $T$ with rational entries is a *periodic point*, that is, there exists an integer $n$ so that $\\overline{A}^n v = v$. Given a periodic point $v$ the smallest positive integer $n$ so that $\\overline{A}^n v = v$ is called the *period*.\n", "\n", "Write a function `compute_period(v)` that given a rational vector in $T$ compute its period.:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Let\n", "\n", "$$T_q = \\left\\{\\left(\\frac{a}{q}, \\frac{b}{q}\\right): a,b \\in \\{0,1,\\ldots,q-1\\} \\text{ and } \\gcd(a,b,q) = 1\\right\\}.$$\n", "\n", "Show that $T_q$ is preserved by $\\overline{A}$. What is the cardinality of $T_q$?\n", "\n", "Write a function `classify_periods(q)` that given a positive integer $q$ compute all possible periods of points in $T_q$ and their multiplicities:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "By looking at small values of $q$, find the number of points of periods 1, 2, 3, 4, 5, 6, 7, 8 and 9.\n", "\n", "Can you make a conjecture about the number of periodic points of period $n$?\n", "\n", "Could you write a function `periodic_points(n)` that return the set of points whose period is $n$?:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} } ], "metadata": { "kernelspec": { "display_name": "sagemath", "name": "sagemath" } } }