Mobius transformation

2006-07
   Xah
   xah@xahlee.org
 ∑ http://xahlee.org/

Complex addition, multiplication, and multiplicative inverse

we define a complex number as a pair of numbers {a,b}.
We define their the addition and multiplication of complex numbers.

Clear[complexPlus, complexTimes]
complexPlus[{a_, b_}, {c_, d_}] := {a + c, 
        b + d}
complexTimes[{a_, b_}, {c_, d_}] := {a*c - b*d, b*c + a*d}

We also define what it means by 1/z. That is, the complex inversion, as a expression of its first and second components.

Clear[complexInversion]
complexInversion[{a_, b_}] := 1/(a^2 + b^2)*{a, -b}

This definition comes naturally because of the circle inversion. Suppose we have a circle of radius 1. Suppose there's a point A with length a1. The inversion of A with respect to the circle is a point B that is in the same direction as A, but with length 1/a1.
A complex inversion is the same with circle inversion, but followed by a reflection around the x-axis.

here we test the multiplicative inverse:

complexTimes[{a, b}, complexInversion[{a, b}]] // Together

Indeed, the result is the multiplicative identity {1,0}.

Mobius Transformation

A Möbius Transformation is defined by the function

f[z] := ((a z + b)/(c z + d))

Where all variables are complex numbers.

Clear[MobiusTransform];
MobiusTransform::usage = "MobiusTransform[a,b,c,d] returns a \
function that is the Mobius Transformation defined as f[z]:=(a*z + b)/(c*z + \
d), where all variables are complex numbers. MobiusTransform[a,b,c,d][z] will \
return a expression evaluated at z. For example: MobiusTransform[1 + 1*I, 2 + \
2*I, 3 + 3*I, 4 + 4*I][5 + 5*I] returns 104/293-(5*I)/293";

MobiusTransform[a_, b_, c_, d_] = 
      Function[(a*# + b)/(c*# + d)]

Example usage:

MobiusTransform[a, b, c, d][z]

we give actual values of complex number by the form a+b*I.
For examples:

MobiusTransform[a1 + a2*I, b1 + b2*I, c1 + c2*I, d1 + d2*I][
      z1 + z*I]

MobiusTransform[1 + 1*I, 2 + 2*I, 3 + 3*I, 4 + 4*I][5 + 5*I]

Mobius transformation as real 2D vector function

In Mathematica, a complex number can be expressed as (a+b*I), where a and b are real numbers and a is the real part and the b*I is the complex part. However, in programing, sometimes it is more convenient to deal with the complex number's components directly. So, we code complex numbers as a pair of numbers {a,b}.
So, we define a second mobius transformation, where the input and output are list of pairs of two elements.

A mobius transformation is defined as:
f[Z]:=(A*Z+B)/(C*Z+D)
where all variables are complex numbers.

We rewrite the expression using components of the complex numbers. So, we write A as {a1,a2}, B as {b1,b2} and so on. And, we use functional notation for all the multiply, plus, and division operations. We have:

complexTimes[complexPlus[complexTimes[{a1, a2}, {z1, z2}], {b1, b2}], 
      complexInversion[
        complexPlus[complexTimes[{c1, c2}, {z1, z2}], {d1, d2}]]]

% // Simplify

So we define it as:

Clear[MobiusTransform2];
\(\(\(MobiusTransform2::usage = "MobiusTransform2[{a1,a2},{b1,b2},{c1,c2},{d1,d2}] returns a function that is the Mobius Transformation defined as f[Z]:=(A*Z + B)/(C*Z + D), where all variables are complex numbers. MobiusTransform[{a1,a2},{b1,b2},{c1,c2},{d1,d2}][{z1,z2}] will return a expression evaluated at {z1,z2}. For example: MobiusTransform2[{1,1},{2,2},{3,3},{4,4}][{5,5}] returns {104/293,-(5/293)}";\)\(
\)
    \)\)
MobiusTransform2[{a1_, a2_}, {b1_, b2_}, {c1_, c2_}, {d1_, 
            d2_}][{z1_, z2_}] := 
      complexTimes[complexPlus[complexTimes[{a1, a2}, {z1, z2}], {b1, b2}], 
        complexInversion[
          complexPlus[
            complexTimes[{c1, c2}, {z1, z2}], {d1, d2}]]]

Sample Usage

MobiusTransform2[{1, 1}, {2, 2}, {3, 3}, {4, 4}][{5, 5}]

MobiusTransform[1 + 1*I, 2 + 2*I, 3 + 3*I, 4 + 4*I][
      5 + 5*I]

As we can see, this agrees with our alterative definition MobiusTransform[] using (a+b*I) form for complex numbers.

mobius transformation as sequence of transformations

We define the following transformations:

Clear[f1, f2, f3, f4]
f1[Z_] := Z + D/C
f2[Z_] := 1/Z
f3[Z_] := -(A D - B C)/C^2*Z
f4[Z_] := Z + A/C

Then, a mobius transformation is just f4[f3[f2[f1[Z]]]]

f4@f3@f2@f1@z

% // Simplify

Note that f3 is -(A D-B C)/C^2*Z. If  A D-B C == {0,0}, then the numerator is ZERO, which makes the whole transformation collaps to {0,0}. And, f4 just translate {0,0} to A/C. Thus, if A D - B C == {0,0}, then mobius transformation collaps to the point A/C, which isn't interesting. Thus, we require by definition that A D-B C != {0,0}.

Just curious, what does A D-B C mean in terms of pairs of numbers? It means:

complexTimes[{a1, a2}, {d1, d2}] - 
      complexTimes[{b1, b2}, {c1, c2}]

inverse mobius transformation

Now, back to the sequence of transformations. If we reverse the sequence, then we get the inverse function of the mobius transformation.
Let's define function g1, g2, g3, g4, such that g1 is the inverse of f1 and so on.

g1[Z_] := Z - D/C
g2[Z_] := 1/Z
g3[Z_] := -C^2/(A D - B C)*Z
g4[Z_] := (Z - A/C)

Apply f1, f2, f3, f4 followed by g4, g3, g3, g1 gets us the identity:

g1@g2@g3@g4@f4@f3@f2@f1@z // 
      Simplify

Now, let's just compute the g1, g2 etc, to get the expression for the inverse of mobius transformation.

g1@g2@g3@g4@z // Simplify

Now, let's verify this expression by plugging it into the MobiusTransform function we wrote:

MobiusTransform[-d, b, c, -a]@MobiusTransform[a, b, c, d]@
          z // Simplify

Alnertatively:

Simplify@MobiusTransform[-d1 + I*-d2, b1 + I*b2, 
          c1 + I*c2, -a1 + I*-a2]@MobiusTransform[a1 + I*a2, 
            b1 + I*b2, c1 + I*c2, d1 + I*d2]@(z1 + I*z2)

Alternativesly:

MobiusTransform2[-{d1, d2}, {b1, b2}, {c1, 
            c2}, -{a1, a2}]@MobiusTransform2[{a1, a2}, {b1, b2}, {c1, 
              c2}, {d1, d2}]@{z1, z2} // Simplify

We get the identity. All worked out well.