Sunday, May 28, 2023

Disk Cluster 2

 In a previous post I was making cluster fractals because these are quite rarely found in fractal examples. Moreover, I was making clusters that are nowhere differentiable (from the outside), which is the purest sort of fractal boundary because everywhere has the same fractal property, with no smooth regions. 

The only problem with these clusters is that they were a little too heavily constructed, and so don't transfer to 3D in any obvious or simple way. 

This post however constructs the cluster based on a very small number of symmetries. It uses two different sphere inversions, octagonal symmetry and a single scale factor k. As such, it makes a proper Kleinian group limit set. To describe it I borrow from figure 6 of this Kajino paper:

We define the outer green circle as radius 1, and the offset green circle l2 is at a distance L=sqrt(1+R^2) where R is its radius: R=2/sqrt(-4 + cosec^2(pi/n)), and n is the polygon number of sides, here it is n=8. The inner red circle has radius r=L-R.

To test if a point is inside or outside the cluster, first you invert the point around the purple circle then:

  1. rotate the point to the first octant (in line with the circle l2)
  2. if it is inside l2 you invert it around l2
  3. if its magnitude is less than rk then divide by rk and then invert around l4 = sqrt(r), sending the red circle to the outer green unit circle
repeat until its magnitude is > 1 (black) or you run out of repetitions (white).

For k=0.9 we get:
For k=1 we get:

and for k=1.1 we get:
Actually this last picture uses slightly less than 1.1 as we need to tweak the value for circles to match properly. I don't have the exact analytic value for k here, but it is very close to k=1.0985.

In terms of fractal classes these are a cluster, a cluster-sponge and a cluster-foam respectively. The first differs from the previous cluster in that the subclusters closer to the centre don't form a uniform pattern, and because it is a proper Kleinian group it generalises cleanly to the two other structures pictured above.

The value of n doesn't have to be 8 but it needs to be more than 6, so here are clusters for n=7 and n=9, both for k=0.8:

Here are the cluster-sponge versions (k=1):

One thing to note about these cluster-sponges it that they are very spikey. That is because the sub-cluster orientation lines up with its parent, causing a cascade of disks all in a row. 

We can avoid that by rotating each point by pi/n in step 3, here for n=8 for comparison with the first three images:

This latter image is again slightly away from k=1.1, at approximately k=1.096. Here's a high resolution close up:


Notice that these are all less spikey, and the k=1 case is no longer a cluster-sponge, so can have larger sub-clusters before touching. In the n=7 case the touch point happens around k=1.064:

For fun here's the prior n=8 image coloured by iteration depth:


The next step is to bring this formulation across to three dimensions. I cover this in the next post, but as a quick preview:

There are basically two ways to do this, we can use a hyperbolic tiling of an icosahedron or a dodecahedron. Here I'm using an icosahedron, which give 20 subclusters (one for each face).

The above image is a sphere at each icosahedron in a hyperbolic tiling, only the tiling has been sphere inverted, sending all radii r to 1/r. We use a value of k of roughly 0.5 above.

We then need to recurse inside each sphere, like so:


For larger k, around 0.8:
and k=1

Here's close up around k=0.8:












Saturday, March 18, 2023

Mean Clusters

Imagine you dropped some pebbles on the ground or threw several darts at a bullseye, what shape do they form on average?

If we model this 'cluster' of pebbles or darts as a Gaussian distribution then we can estimate the average shape of the cluster. 

I run it as a tournament, so each set of 2D points is averaged with one other, all the way down to one mean cluster.

In order to get the average of two clusters we have to match them up. Not only does this mean translating and rotating one cluster to be as close as possible to the other cluster, but it also means considering all permutations of the cluster order, in order to find the mapping that produces the closest Euclidean transformation between the two point sets. 

If we do this then we get shapes emerging. Obviously for 2 darts they just form a point pair. For 3 darts we get this:



For 4 darts we get this shape:


And for 5 points, we get:
For 6 we get:

Putting them in a line with 1 and 2 for completion we get:

Or rendered a bit bigger:

You might imagine a 'mean dice' using these patterns as its spots for 1 to 6, since they are the most average shape that a cluster of that size would be found in. 
 
In each case the result has to have bilateral symmetry, but if we allow reflections when comparing shapes then we get asymmetric results:
and for 4:

and for 5:

I have rotated them so the closest points are horizontal, this makes it look like the result is a spiral that grows. Does the pattern continue for 6 points?:
It looks like the pattern breaks at 6, though it is a bit hard to see because it could be this or its mirror image.


A different definition of a cluster is a set of points that are closer to each other than to any other points. Such clusters can be generated from any uniformly randomly placed set of points. It would be interesting to see whether this produces a different set of shapes. I doubt they would be very different as the distribution of such a cluster is surely fairly close to a radial Gaussian. 



Wednesday, February 1, 2023

Mean Islands

 What does the average island look like?

To answer that, we need a very general model for generating islands. The model I am using is the Gaussian Free Field. This is the 2D equivalent of Brownian noise, and it has the property that it is conformal / scale symmetric. In other words, it is a fractal height field very similar to the old plasma fractals used to make fractal landscapes:

In fact the Gaussian Free Field is the mathematically simplest and most invariant such landscape.

All we need to do is set a water level and the result is a set of islands. So what does the average such island look like?

It wouldn't be circular because it is a shape, and shapes are invariant to Euclidean transforms, in other words you need to rotate and pair of islands to best fit, before taking the average of the height field. This is therefore part of my series on mean shapes under symmetries. The first attempt at a mean island looks like this:

The greyscale is the island, with height shown from 50% grey up to white, and the blue is water, showing the depth. It looks like an inverted ellipsoidal paraboloid, i.e. oval shapes, with a length to width ratio of something close to 2  (1.97 above, which merges 2^16 islands).

In order to generate the mean island, I generate a large number of Gaussian Free Fields (2^18) in a fixed square region, then for each pair of fields I find their peak and lower the water level until I get an island of specified area (I'm using 1/20 the area of the GFF). It doesn't matter that I use the highest peak, or what area I choose because the GFF is conformal and all peaks have the same statistical properties. I just can't make the area too large compared to the GFF region. 



Examples of GFF islands. Brightness is height, blue is below water, yellow is the floodfilled island from the highest peak in the map. Red is the centroid and dark red is the centroid plus the eigenvector corresponding to the smallest eigenvalue of the island's covariance matrix.


I then must align the two islands. A smart way would be to use the Fourier-Mellin transform to find the closest transformation between the two islands. However this is complex and slow and didn't work after several attempts including using a 3rd party library, so I use a simpler method: I take the centroid of each island, and find the covariance around each one, then I use the eigenvectors of this covariance to align the two islands, so that the smallest eigenvectors are either parallel or anti-parallel. I test both transformations by looking at the sum of the product of all the heights above water.

It is a bit surprising that the result is such a uniform ellipse, which has 180 degree rotational symmetry. I thought that the ability to rotate would allow more of an egg-like shape with 360 degree rotational symmetry. I think the reason why is that aligning the centres of mass is not the same as finding the cross-correlation peak. 

So instead, I cross correlate the translations by using the 'FFT->multiply by conjugate->IFFT->find peak real part' technique, and I check the value of the peak for both 180 degree rotations, making sure to interpolate the peak using a quadratic interpolation with the two neighbours along each axis. The result is what I expected, the mean island is an egg-like shape:


If I allow reflection symmetry when finding the closest correlation then the result is (surprisingly) unaffected:
This is a bit suspicious. It could be that reflective symmetry is where a full Fourier-Mellin cross-correlation is required, to see the asymmetry in the island, or the asymmetry maybe just be subtle. 

Anyway, here is another run at twice the resolution, just to show that it is repeatable and smooth: 

Sunday, January 22, 2023

Mean Repeating Continuous Function

It a previous post I looked at the mean path of Brownian motion in 2D. Here I look at something similar in 1D: for a repeated continuous function. 

Again, the question arises as to what the space of all continuous repeating functions are. I think the answer that makes the least assumptions is a Brownian bridge from 0 to 0. It is therefore repeated Brownian motion. 

If we took the mean function of all such Brownian bridges, the result would be y=0, which is rather boring. 

However, this series of 'mean things' is including symmetries, or rather, making certain parameters non-absolute. In this case we make the x position of the function non-absolute, and we give it scale symmetry in its range, so we look at the mean function only relative to its own variance in y, and without any absolute x values. 

We can make a Brownian bridge from 0 to 0 by noting that the power spectrum of Brownian noise is 1/f^2 where f is the spatial frequency. We can therefore generate this spectrum with random phase values per wavelength, and take the inverse Fourier transform to get the resulting Brownian bridge.

The algorithm is as follows:

For each pair of repeating functions, cross correlate (Fourier transform, element-wise multiply, inverse Fourier transform) to get the x offset where they are closest, then average the two using this x offset.

The resulting function looks like this:

In other words a sine wave. At least it appears to be a sine wave, and it probably is exactly that. 

We can also give the range vertical symmetry, so we pick the closest correlation between the two functions from either the two positive functions, or with the second function negated. This removes the symmetry in the repeating function, giving a slightly leaning sine wave:
Noting that it is this function, and its negative, which are the mean repeating functions.

It is probably not right for our samples to have an exact 1/f magnitude for each wave frequency f, a better sample would have its magnitude taken from a normal distribution with standard deviation f. This takes longer to converge but seems to give the same results. Without reflection symmetry:

With reflection symmetry:

We could extend this idea to 2D, for example finding the mean Brownian drum (0 in a unit circle) under rotation symmetry, but I think it is likely to be a simple smooth Bessel function. We could also make a Brownian surface on a sphere (using spherical harmonics presumably) under spherical rotation symmetry, but I also imagine that the result would be very smooth and simple.


Thursday, September 15, 2022

Vortices and Octonions

Complex numbers, quaternions and octonions can be equated with three types of rotations: general rotations SO(n), simple rotations (rotations in a single plane), and isoclinic rotations Is(n). I also showed how SO(n) and simple rotations are built from Is(n). What's more, isoclinic rotations can also be used to generate reflections, e.g. qvq reflects v around 3D normal n when q is the isoclinic rotation defined (0,n). All of this suggests that isoclinic rotations are really the fundamental rotation type.

It also appears that these isoclinic rotations Is(2), Is(4) and Is(8) have a representation in 3D, giving a generalisation of the standard idea of rotations:

The complex rotations are in a single plane, which is also our standard idea of rotations in 3D. The quaternion Is(4) rotations can be represented in a couple of ways in 3D. The first is as a 'Hopf vortex' consisting of a rotation around one axis and an equal angled rotation around the orthogonal unit circle. The second is the so-called anti-twister mechanism, which is a rotation around a S-shaped curve which itself is rotating at the same rate. In both cases the rotation is around a curve which itself is rotating; a sort of vortex.

It is tempting therefore to consider whether the 8D isoclinic rotations associated with Octonions have a representation as a sort of vortex. I can think of two possibilities, which are all close I think:

  1. Two anti-twister mechanisms that orbit each other at the same speed that they do their rotation. This can be configured to be equivalent to two spinorial balls rotating around a ball 3 times larger, which is equivalent to one spinorial ball rotating on a projective ball 3 times larger. This unusual sounding system describes the algebra of split-octonions, more specifically imaginary split octonions with normalised temporal and spatial components. The vortex is rotating by an angle in 3 different ways, unlike the 4 planes that Is(8) rotates in, on the other hand the split-octonions remove one of those planes of rotation, replacing it with the Lorentzian transformation. So its a well-founded vortex, but only represents a sort of split-octonion, which is close to but not the same as standard octonions.
  2. It is possible to make an anti-twister mechanism in 4D. If I is an isoclinic rotation with increasing angle theta, and T is a a rotation around one plane in 4D, modulated by radius (180 degrees at r=0 and 0 degrees at r=1) then ITI^-1 is the anti-twister transformation of 4D space. For theta 0 to 2pi the centre is an isoclinic rotation of 4pi, so it has spin 1/2, and theta is basically applied 4 times, since it double covers an isoclinic rotation. That is like the 4-angle isoclinic rotation of octonions.
If we use the axes of a radial tetrahedron as the four spatial axes, then there are two fixed planes (equivalent to the curved line pair in the 3D anti-twister), drawing these planes with lots of radial lines gives this motion:
We know these are fixed planes because we can watch their behaviour when the camera is following the rotation I, this is equivalent to yawing the camera by theta in the 3D anti-twister, and seeing the curved line pair as fixed. So we're viewing TI^-1:

 https://vimeo.com/759745828

So if the camera follows the motion of I, all points in the space rotate around these fixed planes. In 4D you rotate around a plane. In a fixed camera this is a rotation around a rotating plane, giving a similar mechanism to two rolling balls, which is also a rotation around an orbiting thing (ball). 

If you take a 3D cross-section of the 4D space, again using the camera that follows I, you get this:

https://vimeo.com/759745699 

The inner and outer circles are the cross section of the fixed planes, they are the equivalent of the two fixed points that space circles around in the 3D anti-twister. Here it shows that the nearby points rotate about these circles, and the circles themselves are rotating. So these fixed curves are going a sort of isoclinic rotation as they also rotate with I. Suggestive of the 'fermionic ball' around another ball used to describe unit imaginary split-octonions. More info about 4D anti-twisters here, and a summary of Octonion multiplications is here.

  

Presuming that we can represent octonions with vortices in 3D too, it has an interesting connection with string theory. String theory treats particles as repeating motions of strings. But vortices are fundamentally described by their curves (or strings), these are the invariant shapes of the motion, and vortices are repeating motions, just like oscillations. String theory also seems to describe physics with 8 dimensions for the string oscillations plus 1 for the string length and 1 for time, making it a 10 dimensional theory.

Saturday, August 6, 2022

Octonions

I'm trying to learn about octonions. Rather than standard descriptions, these are some of my own thoughts, not all will necessarily be accurate as they're quite complicated beasts. I have added a more thorough set of information here

It is helpful to describe them in terms of the other division algebras:

  1. The complex numbers describe rotation in one plane (2D) plus scale. That is two degrees of freedom, so one complex number is applied in the multiply, giving a binary operator: 
  2. The quaternions describe rotations in two planes (4D) plus scale. That requires two quaternions to apply in the multiply, so fundamentally it is a trinary operator. q1 and q2 together rotate q:
  3. The octonions describe rotations in 4 planes (8D) plus scale. That requires four octonions to apply in the multiply, so fundamentally it is a 5-ary operator:

People don't use the multiply syntax quite as above, but I think that is a clearer way to describe what is happening, because using those operators each one is describing a full rotation in 2D, 4D and 8D respectively. The usual description is that it requires 7 octonion multiplies to generate a full 8D rotation, but that is when all multiplies work the same way. In On Quaternions and Octonions (A.K. Peters 2003) they get down to SO(8) from 5 multiplications as long as they aren't all left, all right or all bimultiplies (a left and right by the same octonion). The '5-ary' multiply above is four multiplications, but we pull from more than just left and right multiplies, so it seems reasonable that it could represent SO(8). I'll explain using the quaternions as an example.

A single quaternion left-multiply rotates in one plane that contains the (1,0,0,0) vector, and by an equal angle in the orthogonal plane. The right multiply does the same thing but rotates about the negative angle in the orthogonal plane. This combination of a ++ with a +- by a different angle value allow any combination of two angles, giving a full rotation. 

For octonions there are four planes that the rotation angle can be positive or negative on. This doesn't leave enough room with just left and right multiplies for all of the combinations. We want to rotate using ++++, ++--, +-+- and +--+ by different angles for each, which achieves the full set of rotations. That would require an "up multiply" and "down multiply" or some such label. In the 5-ary operator above o1,o2,o3 and o4 would each use a different one of these multiplies.

You can of course still define the usual quaternion or octonion multiply, and these single binary operations both apply a 'special rotation' by which I mean a subset of the full set of rotations. For quaternions that is a self-dual or isoclinic rotation, which means by the same angle on two orthogonal planes, and for octonions it is by the same angle on four orthogonal planes. 

You can also negate the extra rotation planes to leave a 'simple rotation' meaning a rotation around a single plane. For quaternions that is or in usual syntax:. For octonions it is:or something similar. The idea is that the ++++, ++--, +-+-, +--+ sum together to give 4,0,0,0 times whatever the rotation angle was. This means that octonions would be a quadruple cover of the space, when used for simple rotations.

Note that octonion multiplication only rotates 8D vectors, not 8D rotations. While the above complex number and quaternion multiplications are equivalent to vector transformation  and matrix (SO(n)) transformation , octonions are only equivalent to the vector transformation. That is because 8D rotations are SO(8) which can be represented by an 8x8 orthonormal matrix, and matrix multiplication is associative, unlike for octonions.

In summary:

  • Complex, Quaternion and Octonion numbers all support three types of rotation:
    • a 'full rotation' (binary, trinary and 5-ary operators), by different angles for each plane
    • a 'special rotation' (isoclinic), which is the standard binary product operator
    • a 'simple rotation' which is in a single plane
  • It is just that for complex numbers, the three are the same.
  • while quaternion (and complex number) multiplication rotates both vectors and other isoclinic rotations, octonion multiplication only rotates (8D) vectors, it cannot be thought of as an 8D isoclinic rotation under multiplication. 

If we define Is(n) to be the set of isoclinic rotations from SO(n) then this is a better way to summarise:


The - at the bottom indicates that 8D isoclinic rotations do not form a group under octonion multiplication. Indeed, it is true that 8D (and any higher order) isoclinic rotations are not a group. So they do not form a subgroup of SO(8).