Skip to main content

Symmetric Chaos

The script symchaos.py generates chaotic images with translational (wallpaper) or rotational symmetry, as pioneered by Field and Golubitsky [1].

Installation:

First, install the package with pip:

pip3 install symchaos

Next, find the location where the installed files are:

pip3 show -f symchaos

Copy the whole symchaos directory to a place where you have read and write access. Now you can change into this directory and start the script symchaos.py.

Dependencies:

Symchaos needs the python modules argparse, ast, configparser, datetime, math, matplotlib.pyplot, numpy, os, pylab, random, re, shutil, and sys.

The pure python version is fine for testing but very slow. To speed up the calculations, it is strongly recommended to use the Fortran90 code symchaos.f90 and use the fortran to python interface generator f2py from numpy (https://numpy.org/doc/stable/f2py).

Usage:

Execute symchaos.py and provide a config file from the ini/ directory, for example:

symchaos.py ini/example.ini

For a quick test without installing a Fortran90 compiler, type:

symchaos.py ini/nof90.ini

If f2py is available, the Fortran90 code can be compiled with:

f2py -c symchaos.f90 -m symchaos_f90

Now, all config files from the ini/ directory can be used, e.g., clifford.ini, fern.ini, mondrian.ini, quilt.ini, rot9.ini etc.

The images are saved inside the output directory.

Configuration:

Generation of the images is controlled via a config (*.ini) file. The keys are:

  • method: The method determines which formula is used by symchaos.f90. Available methods are:
    • clifford: Clifford attractor
    • fern: Barnsley fern
    • hopalong: Hopalong attractor by Barry Martin
    • mondrian: images reminding me of Piet Mondrian
    • quilt*: several quilts (wallpapers)
    • rot_sym: images with rotational C_n symmetry
    • triangle: images looking a bit like triangles
  • a, b, c, d, e, n: These parameters are part of the formulas of the methods.
  • vary_steps: If vary_steps > 1, then several images are created, using different parameters a, b, c, d, e.
  • vary_type: If vary_steps > 1, then vary_type determines how the parameters are varied:
    • cyclic: starting and ending at the initial parameters
    • neighborhood: random values in the neighborhood of the initial parameters
    • random: random values
    • random_walk: a random walk, starting at the initial parameters
  • vary_value: The magnitude of the parameter variation
  • palette: The matplotlib color palette [3] used to create an image. The default is the rainbow palette, setting palette = * uses all palettes.
  • resolution: A tuple defining the x,y resolution of the image, e.g., resolution = (100,100).
  • MAKETILES: If set to True, a tiled image is also created. This is only useful for wallpapers with translational symmetry.
  • USE_FORTRAN: If set to True, use the fast Fortran90 code symchaos.f90.

Further explanations can be found in the comments of the example.ini config file.

References:

[1] Symmetric Chaos, Mike Field, and Martin Golubitsky, Computers in Physics 4, 470 (1990), https://doi.org/10.1063/1.4822939

[2] Christmas in the House of Chaos, Scientific American, Dec 1992, JSTOR 24939340

[3] List of matplotlib palettes: https://matplotlib.org/stable/gallery/color/colormap_reference.html

Metadata

Release files for symchaos 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for symchaos 0.9.0
File Size Uploaded
symchaos-0.9.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for symchaos 0.9.0
File Interpreter ABI Platform
symchaos-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.5 kB

Release files / symchaos-0.9.0.tar.gz

Download URL symchaos-0.9.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
435ed5bb9b59f40731e5546322ebd3f3969a705a7e40178017b9ff99878d21a4
BLAKE2b-256 checksum
How to use checksums
3f83c256e55d2ea87d9756be95fecad4afd6c8622686bef16d9a4dddc848d9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.9

Release files / symchaos-0.9.0-py3-none-any.whl

Download URL symchaos-0.9.0-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75ba277c03e080f02edd9534d0509ee1ccb39e21e8864e9b4af4c4a6dac770f7
BLAKE2b-256 checksum
How to use checksums
0156aa7650e27b1e9eeea4cc39cfe510935b61615471413a86e3627ad5a69d2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page