math and physics play

Vector gradients in dyadic notation and geometric algebra.

March 5, 2022 math and physics play , , , ,

[If mathjax doesn’t display properly for you, click here for a PDF of this post]

This is an exploration of the dyadic representation of the gradient acting on a vector in \(\mathbb{R}^3\), where we determine a tensor product formulation of a vector differential. Such a tensor product formulation can be split into symmetric and antisymmetric components. The geometric algebra (GA) equivalents of such a split are determined.

There is an error in part of the analysis below, which is addressed in a followup post made the next day.

GA gradient of a vector.

In GA we are free to express the product of the gradient and a vector field by adjacency. In coordinates (summation over repeated indexes assumed), such a product has the form
\begin{equation}\label{eqn:dyadicVsGa:20}
\spacegrad \Bv
= \lr{ \Be_i \partial_i } \lr{ v_j \Be_j }
= \lr{ \partial_i v_j } \Be_i \Be_j.
\end{equation}
In this sum, any terms with \( i = j \) are scalars since \( \Be_i^2 = 1 \), and the remaining terms are bivectors. This can be written compactly as
\begin{equation}\label{eqn:dyadicVsGa:40}
\spacegrad \Bv = \spacegrad \cdot \Bv + \spacegrad \wedge \Bv,
\end{equation}
or for \(\mathbb{R}^3\)
\begin{equation}\label{eqn:dyadicVsGa:60}
\spacegrad \Bv = \spacegrad \cdot \Bv + I \lr{ \spacegrad \cross \Bv},
\end{equation}
either of which breaks the gradient into into divergence and curl components. In \ref{eqn:dyadicVsGa:40} this vector gradient is expressed using the bivector valued curl operator \( (\spacegrad \wedge \Bv) \), whereas \ref{eqn:dyadicVsGa:60} is expressed using the vector valued dual form of the curl \( (\spacegrad \cross \Bv) \) from convential vector algebra.

It is worth noting that order matters in the GA coordinate expansion of \ref{eqn:dyadicVsGa:20}. It is not correct to write
\begin{equation}\label{eqn:dyadicVsGa:80}
\spacegrad \Bv
= \lr{ \partial_i v_j } \Be_j \Be_i,
\end{equation}
which is only true when the curl, \( \spacegrad \wedge \Bv = 0 \), is zero.

Dyadic representation.

Given a vector field \( \Bv = \Bv(\Bx) \), the differential of that field can be computed by chain rule
\begin{equation}\label{eqn:dyadicVsGa:100}
d\Bv = \PD{x_i}{\Bv} dx_i = \lr{ d\Bx \cdot \spacegrad} \Bv,
\end{equation}
where \( d\Bx = \Be_i dx_i \). This is a representation invariant form of the differential, where we have a scalar operator \( d\Bx \cdot \spacegrad \) acting on the vector field \( \Bv \). The matrix representation of this differential can be written as
\begin{equation}\label{eqn:dyadicVsGa:120}
d\Bv = \lr{
{\begin{bmatrix}
d\Bx
\end{bmatrix}}^\dagger
\begin{bmatrix}
\spacegrad
\end{bmatrix}
}
\begin{bmatrix}
\Bv
\end{bmatrix}
,
\end{equation}
where we are using the dagger to designate transposition, and each of the terms on the right are the coordinate matrixes of the vectors with respect to the standard basis
\begin{equation}\label{eqn:dyadicVsGa:140}
\begin{bmatrix}
d\Bx
\end{bmatrix}
=
\begin{bmatrix}
dx_1 \\
dx_2 \\
dx_3
\end{bmatrix},\quad
\begin{bmatrix}
\Bv
\end{bmatrix}
=
\begin{bmatrix}
v_1 \\
v_2 \\
v_3
\end{bmatrix},\quad
\begin{bmatrix}
\spacegrad
\end{bmatrix}
=
\begin{bmatrix}
\partial_1 \\
\partial_2 \\
\partial_3
\end{bmatrix}.
\end{equation}

In \ref{eqn:dyadicVsGa:120} the parens are very important, as the expression is meaningless without them. With the parens we have a \((1 \times 3)(3 \times 1)\) matrix (i.e. a scalar) multiplied with a \(3\times 1\) matrix. That becomes ill-formed if we drop the parens since we are left with an incompatible product of a \((3\times1)(3\times1)\) matrix on the right. The dyadic notation, which introducing a tensor product into the mix, is a mechanism to make sense of the possibility of such a product. Can we make sense of an expression like \( \spacegrad \Bv \) without the geometric product in our toolbox?

Stepping towards that question, let’s examine the coordinate expansion of our vector differential \ref{eqn:dyadicVsGa:100}, which is
\begin{equation}\label{eqn:dyadicVsGa:160}
d\Bv = dx_i \lr{ \partial_i v_j } \Be_j.
\end{equation}
If we allow a matrix of vectors, this has a block matrix form
\begin{equation}\label{eqn:dyadicVsGa:180}
d\Bv =
{\begin{bmatrix}
d\Bx
\end{bmatrix}}^\dagger
\begin{bmatrix}
\spacegrad \otimes \Bv
\end{bmatrix}
\begin{bmatrix}
\Be_1 \\
\Be_2 \\
\Be_3
\end{bmatrix}
.
\end{equation}
Here we introduce the tensor product
\begin{equation}\label{eqn:dyadicVsGa:200}
\spacegrad \otimes \Bv
= \partial_i v_j \, \Be_i \otimes \Be_j,
\end{equation}
and designate the matrix of coordinates \( \partial_i v_j \), a second order tensor, by \(
\begin{bmatrix}
\spacegrad \otimes \Bv
\end{bmatrix}
\).

We have succeeded in factoring out a vector gradient. We can introduce dot product between vectors and a direct product of vectors, by observing that \ref{eqn:dyadicVsGa:180} has the structure of a quadradic form, and define
\begin{equation}\label{eqn:dyadicVsGa:220}
\Bx \cdot (\Ba \otimes \Bb) \equiv
{\begin{bmatrix}
\Bx
\end{bmatrix}}^\dagger
\begin{bmatrix}
\Ba \otimes \Bb
\end{bmatrix}
\begin{bmatrix}
\Be_1 \\
\Be_2 \\
\Be_3
\end{bmatrix},
\end{equation}
so that \ref{eqn:dyadicVsGa:180} takes the form
\begin{equation}\label{eqn:dyadicVsGa:240}
d\Bv = d\Bx \cdot \lr{ \spacegrad \otimes \Bv }.
\end{equation}
Such a dot product gives operational meaning to the gradient-vector tensor product.

Symmetrization and antisymmetrization of the vector differential in GA.

Using the dyadic notation, it’s possible to split a vector derivative into symmetric and antisymmetric components with respect to the gradient-vector direct product
\begin{equation}\label{eqn:dyadicVsGa:260}
d\Bv
= d\Bx \cdot
\lr{
\inv{2} \lr{ \spacegrad \otimes \Bv + \lr{ \spacegrad \otimes \Bv }^\dagger }
+
\inv{2} \lr{ \spacegrad \otimes \Bv – \lr{ \spacegrad \otimes \Bv }^\dagger }
},
\end{equation}
or \( d\Bv = d\Bx \cdot \lr{ \Bd + \BOmega } \), where \( \Bd \) is a symmetric tensor, and \( \BOmega \) is a traceless antisymmetric tensor.

A question of potential interest is “what GA equvivalent of this expression?”. There are two identities that are helpful for extracting this equivalence, the first of which is the k-blade vector product identities. Given a k-blade \( B_k \) (i.e.: a product of \( k \) orthogonal vectors, or the wedge of \( k \) vectors), and a vector \( \Ba \), the dot product of the two is
\begin{equation}\label{eqn:dyadicVsGa:280}
B_k \cdot \Ba = \inv{2} \lr{ B_k \Ba + (-1)^{k+1} \Ba B_k }
\end{equation}
Specifically, given two vectors \( \Ba, \Bb \), the vector dot product can be written as a symmetric sum
\begin{equation}\label{eqn:dyadicVsGa:300}
\Ba \cdot \Bb = \inv{2} \lr{ \Ba \Bb + \Bb \Ba } = \Bb \cdot \Ba,
\end{equation}
and given a bivector \( B \) and a vector \( \Ba \), the bivector-vector dot product can be written as an antisymmetric sum
\begin{equation}\label{eqn:dyadicVsGa:320}
B \cdot \Ba = \inv{2} \lr{ B \Ba – \Ba B } = – \Ba \cdot B.
\end{equation}

We may apply these to expressions where one of the vector terms is the gradient, but must allow for the gradient to act bidirectionally. That is, given multivectors \( M, N \)
\begin{equation}\label{eqn:dyadicVsGa:340}
M \spacegrad N
=
\partial_i (M \Be_i N)
=
(\partial_i M) \Be_i N + M \Be_i (\partial_i N),
\end{equation}
where parens have been used to indicate the scope of applicibility of the partials. In particular, this means that we may write the divergence as a GA symmetric sum
\begin{equation}\label{eqn:dyadicVsGa:360}
\spacegrad \cdot \Bv = \inv{2} \lr{
\spacegrad \Bv + \Bv \spacegrad },
\end{equation}
which clearly corresponds to the symmetric term \( \Bd = (1/2) \lr{ \spacegrad \otimes \Bv + \lr{ \spacegrad \otimes \Bv }^\dagger } \) from \ref{eqn:dyadicVsGa:260}.

Let’s assume that we can write our vector differential in terms of a divergence term isomorphic to the symmetric sum in \ref{eqn:dyadicVsGa:260}, and a “something else”, \(\BX\). That is
\begin{equation}\label{eqn:dyadicVsGa:380}
\begin{aligned}
d\Bv
&= \lr{ d\Bx \cdot \spacegrad } \Bv \\
&= d\Bx (\spacegrad \cdot \Bv) + \BX,
\end{aligned}
\end{equation}
where
\begin{equation}\label{eqn:dyadicVsGa:400}
\BX = \lr{ d\Bx \cdot \spacegrad } \Bv – d\Bx (\spacegrad \cdot \Bv),
\end{equation}
is a vector expression to be reduced to something simpler. That reduction is possible using the distribution identity
\begin{equation}\label{eqn:dyadicVsGa:420}
\Bc \cdot (\Ba \wedge \Bb)
=
(\Bc \cdot \Ba) \Bb
– (\Bc \cdot \Bb) \Ba,
\end{equation}
so we find
\begin{equation}\label{eqn:dyadicVsGa:440}
\BX = \spacegrad \cdot \lr{ d\Bx \wedge \Bv }.
\end{equation}

We find the following GA split of the vector differential into symmetric and antisymmetric terms
\begin{equation}\label{eqn:dyadicVsGa:460}
\boxed{
d\Bv
= (d\Bx \cdot \spacegrad) \Bv
= d\Bx (\spacegrad \cdot \Bv)
+
\spacegrad \cdot \lr{ d\Bx \wedge \Bv }.
}
\end{equation}
Such a split avoids the indeterminant nature of the tensor product, which we only give meaning by introducing the quadratic form based dot product given by \ref{eqn:dyadicVsGa:220}.

Hardcover physics class notes.

March 13, 2021 math and physics play , , , , , , , , , , , , , ,

Amazon’s kindle direct publishing invited me to their hardcover trial program, and I’ve now made hardcover versions available of most of my interesting physics notes compilations:

Instead of making hardover versions of my classical mechanics, antenna theory, and electromagnetic theory notes, I have unpublished the paperback versions. These are low quality notes, and I don’t want more people to waste money on them (some have.) The free PDFs of all those notes are still available.

My geometric algebra book is also available in both paperback and hardcover (black and white). I’ve unpublished the color version, as it has a much higher print cost, and I thought it was too confusing to have all the permutations of black-and-white/color and paperback/hardcover.

A better 3D generalization of the Mandelbrot set.

February 9, 2021 math and physics play , , , , , , ,

I’ve been exploring 3D generalizations of the Mandelbrot set:

The iterative equation for the Mandelbrot set can be written in vector form ([1]) as:
\begin{equation}
\begin{aligned}
\Bz
&\rightarrow
\Bz \Be_1 \Bz + \Bc \\
&=
\Bz \lr{ \Be_1 \cdot \Bz }
+
\Bz \cdot \lr{ \Be_1 \wedge \Bz }
+ \Bc \\
&=
2 \Bz \lr{ \Be_1 \cdot \Bz }

\Bz^2\, \Be_1
+ \Bc
\end{aligned}
\end{equation}
Plotting this in 3D was an interesting challenge, but showed that the Mandelbrot set expressed above has rotational symmetry about the x-axis, which is kind of boring.

If all we require for a 3D fractal is to iterate a vector equation that is (presumably) at least quadratic, then we have lots of options. Here’s the first one that comes to mind:
\begin{equation}
\begin{aligned}
\Bz
&\rightarrow
\gpgradeone{ \Ba \Bz \Bb \Bz \Bc } + \Bd \\
&=
\lr{ \Ba \cdot \Bz } \lr{ \Bz \cross \lr{ \Bc \cross \Bz } }
+
\lr{ \Ba \cross \Bz } \lr{ \Bz \cdot \lr{ \Bc \cross \Bz } }
+ \Bd
.
\end{aligned}
\end{equation}
where we iterate starting, as usual with \( \Bz = 0 \) where \( \Bd \) is the point of interest to test for inclusion in the set. I tried this with
\begin{equation}\label{eqn:mandel3:n}
\begin{aligned}
\Ba &= (1,1,1) \\
\Bb &= (1,0,0) \\
\Bc &= (1,-1,0).
\end{aligned}
\end{equation}
Here are some slice plots at various values of z

and an animation of the slices with respect to the z-axis:

Here are a couple snapshots from a 3D Paraview rendering of a netCDF dataset of all the escape time values

Data collection and image creation used commit b042acf6ab7a5ba09865490b3f1fedaf0bd6e773 from my Mandelbrot generalization experimentation repository.

References

[1] L. Dorst, D. Fontijne, and S. Mann. Geometric Algebra for Computer Science. Morgan Kaufmann, San Francisco, 2007.

Slicing of the 3D Mandelbrot set, and analysis.

February 8, 2021 math and physics play , , , , , , ,

Some slices.

As followup to:

here is a bit more experimentation with Paraview slice filtering. This time I saved all the point data with the escape time counts, and rendered it with a few different contours

The default slice filter places the plane in the x-y orientation:

but we can also tilt it in the Paraview render UI

and suppress the contour view to see just the slice

As a very GUI challenged user, I don’t find the interface particularly intuitive, but have at least figured out this one particular slicing task, which is kind of cool.  It’s impressive that the UI can drive interesting computational tasks without having to regenerate or reload any of the raw data itself.  This time I was using the MacOSX Paraview client, which is nicer looking than the Windows version, but has some weird glitches in the file dialogues.

Analysis.

The graphing play above shows some apparent rotational symmetry our vector equivalent to the Mandelbrot equation
\begin{equation}
\Bx \rightarrow \Bx \Be_1 \Bx + \Bc.
\end{equation}
It was not clear to me if this symmetry existed, as there were artifacts in the plots that made it appear that there was irregularity. However, some thought shows that this irregularity is strictly due to sampling error, and perhaps also due to limitations in the plotting software, as such an uneven surface is probably tricky to deal with.

To see this, here are the first few iterations of the Mandlebrot sequence for an arbitary starting vector \( \Bc \).
\begin{equation}
\begin{aligned}
\Bx_0 &= \Bc \\
\Bx_1 &= \Bc \Be_1 \Bc + \Bc \\
\Bx_2 &= \lr{ \Bc \Be_1 \Bc + \Bc } \Be_1 \lr{ \Bc \Be_1 \Bc + \Bc } + \Bc \Be_1 \Bc + \Bc.
\end{aligned}
\end{equation}

Now, what happens when we rotate the starting vector \( \Bc \) in the \( y-z \) plane. The rotor for such a rotation is
\begin{equation}
R = \exp\lr{ e_{23} \theta/2 },
\end{equation}
where
\begin{equation}
\Bc \rightarrow R \Bc \tilde{R}.
\end{equation}
Observe that if \( \Bc \) is parallel to the x-axis, then this rotation leaves the starting point invariant, as \( \Be_1 \) commutes with \( R \). That is
\begin{equation}
R \Be_1 \tilde{R} =
\Be_1 R \tilde{R} = \Be_1.
\end{equation}
Let \( \Bc’ = R \Bc \tilde{R} \), so that
\begin{equation}
\Bx_0′ = R \Bc \tilde{R} = R \Bx_0 \tilde{R} .
\end{equation}
\begin{equation}
\begin{aligned}
\Bx_1′
&= R \Bc \tilde{R} \Be_1 R \Bc \tilde{R} + R \Bc \tilde{R} \\
&= R \Bc \Be_1 \Bc \tilde{R} + R \Bc \tilde{R} \\
&= R \lr{ \Bc \Be_1 \Bc R + \Bc } \tilde{R} \\
&= R \Bx_1 \tilde{R}.
\end{aligned}
\end{equation}
\begin{equation}\label{eqn:m2:n}
\begin{aligned}
\Bx_2′
&= \Bx_1′ \Be_1 \Bx_1′ + \Bc’ \\
&= R \Bx_1 \tilde{R} \Be_1 R \Bx_1 \tilde{R} + R \Bc \tilde{R} \\
&= R \Bx_1 \Be_1 \Bx_1 \tilde{R} + R \Bc \tilde{R} \\
&= R \lr{ \Bx_1 \Be_1 \Bx_1 + \Bc } \tilde{R} \\
&= R \Bx_2 \tilde{R}.
\end{aligned}
\end{equation}

The pattern is clear. If we rotate the starting point in the y-z plane, iterating the Mandelbrot sequence results in precisely the same rotation of the x-y plane Mandelbrot sequence. So the apparent rotational symmetry in the 3D iteration of the Mandelbrot vector equation is exactly that. This is an unfortunately boring 3D fractal. All of the interesting fractal nature occurs in the 2D plane, and the rest is just a consequence of rotating that image around the x-axis. We get some interesting fractal artifacts if we slice the rotated Mandelbrot image.

Some 3D renderings of the Mandelbrot set.

February 7, 2021 math and physics play , , , , ,

As mentioned previously, using geometric algebra we can convert the iterative equation for the Mandelbrot set from complex number form
\begin{equation}
z \rightarrow z^2 + c,
\end{equation}
to an equivalent vector form
\begin{equation}
\mathbf{x} \rightarrow \mathbf{x} \mathbf{e} \mathbf{x} + \mathbf{c},
\end{equation}
where \( \mathbf{e} \) represents the x-axis (say). Geometrically, each iteration takes \( \mathbf{e} \) and reflects it about the direction of \( \mathbf{x} \), then scales that by \( \mathbf{x}^2 \) and adds \( \mathbf{c} \).

To get the usual 2D Mandelbrot set, one iterates with vectors that lie only in the x-y plane, but we can treat the Mandelbrot set as a 3D solid if we remove the x-y plane restriction.

Last time I animated slices of the 3D set, but after a whole lot of messing around I managed to save the data for all the interior points of the 3D set in netCDF format, and render the solid using Paraview. Paraview has tons of filters available, and experimenting with them is pretty time consuming, but here are some initial screenshots of the 3D Mandelbrot set:

It’s interesting that much of the characteristic detail of the Mandelbrot set is not visible in the 3D volume, but if we slice that volume, you can then you can see it again.  Here’s a slice taken close to the z=0 plane (but far enough that the “CN tower” portion of the set is not visible)

You can also see some of that detail if the opacity of the rendering is turned way down:

If you look carefully at the images above, you’ll see that the axis labels are wrong.  I think that I’ve screwed up one of the stride related parameters to my putVar call, and I end up with x+z transposed in the axes labels when visualized.