Arnold's cat map


Image:Arnoldcatmap.svg|thumb|Picture showing how the linear map stretches the unit square and how its pieces are rearranged when the modulo operation is performed. The lines with the arrows show the direction of the contracting and expanding eigenspaces
In mathematics, Arnold's cat map is a chaotic map from the torus into itself, named after Vladimir Arnold, who demonstrated its effects in the 1960s using an image of a cat, hence the name. It is a simple and pedagogical example for hyperbolic toral automorphisms.
Thinking of the torus as the quotient space, Arnold's cat map is the transformation given by the formula
Equivalently, in matrix notation, this is
That is, with a unit equal to the width of the square image, the image is sheared one unit up, then two units to the right, and all that lies outside that unit square is shifted back by the unit until it is within the square.

Name

The map receives its name from Arnold's 1967 manuscript with André Avez, Problèmes ergodiques de la mécanique classique, in which the outline of a cat was used to illustrate the action of the map on the torus. In the original book it was captioned by a humorous footnote,
In Arnold's native Russian, the map is known as "okroshka from a cat", in reference to the map's mixing properties, and which forms a play on words. Arnold later wrote that he found the name "Arnold's Cat" by which the map is known in English and other languages to be "strange".

Properties

The discrete cat map

[Image:Arnold cat.png|right|frame|From order to chaos and back. Sample mapping on a picture of 150x150 pixels. The number shows the iteration step; after 300 iterations, the original image returns.]
It is possible to define a discrete analogue of the cat map. One of this map's features is that image being apparently randomized by the transformation but returning to its original state after a number of steps. As can be seen in the adjacent picture, the original image of the cat is sheared and then wrapped around in the first iteration of the transformation. After some iterations, the resulting image appears rather random or disordered, yet after further iterations the image appears to have further order—ghost-like images of the cat, multiple smaller copies arranged in a repeating structure and even upside-down copies of the original image—and ultimately returns to the original image.
The discrete cat map describes the phase space flow corresponding to the discrete dynamics of a bead hopping from site '' to site on a circular ring with circumference, according to the second order equation:
Defining the momentum variable, the above second order dynamics can be re-written as a mapping of the square onto itself:
This Arnold cat mapping shows mixing behavior typical for chaotic systems. However, since the transformation has a determinant equal to unity, it is area-preserving and therefore invertible the inverse transformation being:
For real variables and, it is common to set. In that case a mapping of the unit square with periodic boundary conditions onto itself results.
When is set to an integer value, the position and momentum variables can be restricted to integers and the mapping becomes a mapping of a toroidial square grid of points onto itself. Such an integer cat map is commonly used to demonstrate mixing behavior with Poincaré recurrence utilising digital images. The number of iterations needed to restore the image can be shown never to exceed.
For an image, the relationship between iterations could be expressed as follows:

Models

Python code for Arnold's Cat Map


import os
from PIL.Image import open as load_pic, new as new_pic
def main:
"""
Params
path:str
path to photograph
iterations:int
number of iterations to compute
name:str
formattable string to use as template for file names
"""
title = os.path.splitext
counter = 0
while counter < iterations:
with load_pic as image:
dim = width, height = image.size
with new_pic as canvas:
for x in range:
for y in range:
nx = % width
ny = % height
canvas.putpixel, image.getpixel))
if counter > 0 and not keep_all:
os.remove
counter += 1
print
path = name.format
canvas.save
return canvas
if __name__ "__main__":
path = input
while not os.path.exists:
path = input
result = main
result.show