diff --git a/.ipynb_checkpoints/Apollonian Circle Packings-checkpoint.ipynb b/.ipynb_checkpoints/Apollonian Circle Packings-checkpoint.ipynb index de63932..791e551 100644 --- a/.ipynb_checkpoints/Apollonian Circle Packings-checkpoint.ipynb +++ b/.ipynb_checkpoints/Apollonian Circle Packings-checkpoint.ipynb @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -42,7 +42,7 @@ "[ 0 0 0 1]" ] }, - "execution_count": 50, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -62,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 4, "metadata": { "scrolled": true }, @@ -113,7 +113,7 @@ "[-1 -1 -1 -1]" ] }, - "execution_count": 52, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -125,7 +125,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 5, "metadata": { "scrolled": true }, @@ -139,7 +139,7 @@ "[-1/2 -1/2 -1/2 1/2]" ] }, - "execution_count": 53, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -150,7 +150,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -203,7 +203,7 @@ "[ 0 0 0 1]" ] }, - "execution_count": 56, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -214,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -223,7 +223,7 @@ "[b_avg == b1 + b2 + b3 - sqrt(2*b1*b2 + 2*(b1 + b2)*b3), b_avg == b1 + b2 + b3 + sqrt(2*b1*b2 + 2*(b1 + b2)*b3)]" ] }, - "execution_count": 57, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -235,7 +235,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -244,7 +244,7 @@ "b1^2 + b2^2 + b3^2 - 2*b1*b_avg - 2*b2*b_avg - 2*b3*b_avg + b_avg^2" ] }, - "execution_count": 58, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -266,7 +266,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -275,7 +275,7 @@ "1/2*b1*h11 - 1/2*b_avg*h11 - 1/2*b1*h1_avg - 1/2*b2*h1_avg - 1/2*b3*h1_avg + 1/2*b_avg*h1_avg + 1/2*b2*h21 - 1/2*b_avg*h21 + 1/2*b3*h31 - 1/2*b_avg*h31" ] }, - "execution_count": 59, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -290,12 +290,12 @@ "source": [ "# Calculations to find the generators for the \"Apollonian\" Group for the octahedral packing\n", "\n", - "We can try the reflection group, since that is one way to derive the generators for the Apollonian group and see if it works. My worry is that it won't since the coordinate system is so different." + "We can try the Weyl group, since that is one way to derive the generators for the Apollonian group and see if it works. My worry is that it won't since the coordinate system is so different." ] }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -373,70 +373,16 @@ " return drawing" ] }, - { - "cell_type": "code", - "execution_count": 95, - "metadata": {}, - "outputs": [], - "source": [ - "def draw_circles_from_coords(coords, color=(0,0,1)):\n", - " drawing = None\n", - " for row in coords:\n", - " b = row[1]\n", - " if not b == 0:\n", - " x = row[2] / b\n", - " y = row[3] / b\n", - " if drawing is not None:\n", - " drawing += circle((x, y), 1 / b, rgbcolor=color)\n", - " else:\n", - " drawing = circle((x, y), 1 / b, rgbcolor=color)\n", - " return drawing" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "root = matrix([\n", - " [2, 0, 0, 1],\n", - " [2, 0, 0, -1],\n", - " [-1, 1, 0, 0],\n", - " [3, 1, 2, 0]\n", - "])\n", - "\n", - "S4 = matrix([\n", - " [1, 0, 0, 0],\n", - " [0, 1, 0, 0],\n", - " [0, 0, 1, 0],\n", - " [2, 2, 2, -1],\n", - "])\n", - "\n", - "drawing = draw_circles_from_coords(root)\n", - "branches = [root]\n", - "for i in range(10):\n", - " new_branches = []\n", - " for tree in branches:\n", - " drawing += draw_circles_from_coords(tree)\n", - " new_branches.append(S1 * tree)\n", - " new_branches.append(S2 * tree)\n", - " new_branches.append(S3 * tree)\n", - " new_branches.append(S4 * tree)\n", - " branches = new_branches\n", - "drawing" - ] - }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Hmm. Doesn't look like it worked. And my crude code to draw the circles doesn't seem to be the problem either." + "Hmm. Doesn't look like it worked. And my crude code to draw the circles doesn't seem to be the problem either. I calculated a few of these circles by hand using the matrices and it comes out exactly where it's drawn here, so my code isn't the problem. Unless, of course, I computed the generators of the Weyl group wrong." ] }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -446,7 +392,7 @@ "Graphics object consisting of 8 graphics primitives" ] }, - "execution_count": 93, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -466,7 +412,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -490,7 +436,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -555,7 +501,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -565,7 +511,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -581,7 +527,7 @@ "[ 3/4 -3/2 3/4 -1 -5/4 1/2 -5/4 1]" ] }, - "execution_count": 66, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -604,7 +550,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -618,7 +564,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 21, "metadata": { "scrolled": true }, @@ -632,7 +578,7 @@ "[-5/4 1/2 -5/4 1]" ] }, - "execution_count": 68, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -644,7 +590,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -653,7 +599,7 @@ "97*b1^2 - 304*b1*b2 + 328*b2^2 - 290*b1*b3 - 304*b2*b3 + 97*b3^2 + 32*b1*b_avg - 1088*b2*b_avg + 32*b3*b_avg + 1280*b_avg^2" ] }, - "execution_count": 69, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } diff --git a/Apollonian Circle Packings.ipynb b/Apollonian Circle Packings.ipynb index de63932..791e551 100644 --- a/Apollonian Circle Packings.ipynb +++ b/Apollonian Circle Packings.ipynb @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -42,7 +42,7 @@ "[ 0 0 0 1]" ] }, - "execution_count": 50, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -62,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 4, "metadata": { "scrolled": true }, @@ -113,7 +113,7 @@ "[-1 -1 -1 -1]" ] }, - "execution_count": 52, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -125,7 +125,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 5, "metadata": { "scrolled": true }, @@ -139,7 +139,7 @@ "[-1/2 -1/2 -1/2 1/2]" ] }, - "execution_count": 53, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -150,7 +150,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -182,7 +182,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -191,7 +191,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -203,7 +203,7 @@ "[ 0 0 0 1]" ] }, - "execution_count": 56, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -214,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -223,7 +223,7 @@ "[b_avg == b1 + b2 + b3 - sqrt(2*b1*b2 + 2*(b1 + b2)*b3), b_avg == b1 + b2 + b3 + sqrt(2*b1*b2 + 2*(b1 + b2)*b3)]" ] }, - "execution_count": 57, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -235,7 +235,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -244,7 +244,7 @@ "b1^2 + b2^2 + b3^2 - 2*b1*b_avg - 2*b2*b_avg - 2*b3*b_avg + b_avg^2" ] }, - "execution_count": 58, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -266,7 +266,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -275,7 +275,7 @@ "1/2*b1*h11 - 1/2*b_avg*h11 - 1/2*b1*h1_avg - 1/2*b2*h1_avg - 1/2*b3*h1_avg + 1/2*b_avg*h1_avg + 1/2*b2*h21 - 1/2*b_avg*h21 + 1/2*b3*h31 - 1/2*b_avg*h31" ] }, - "execution_count": 59, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -290,12 +290,12 @@ "source": [ "# Calculations to find the generators for the \"Apollonian\" Group for the octahedral packing\n", "\n", - "We can try the reflection group, since that is one way to derive the generators for the Apollonian group and see if it works. My worry is that it won't since the coordinate system is so different." + "We can try the Weyl group, since that is one way to derive the generators for the Apollonian group and see if it works. My worry is that it won't since the coordinate system is so different." ] }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -331,7 +331,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -345,7 +345,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -373,70 +373,16 @@ " return drawing" ] }, - { - "cell_type": "code", - "execution_count": 95, - "metadata": {}, - "outputs": [], - "source": [ - "def draw_circles_from_coords(coords, color=(0,0,1)):\n", - " drawing = None\n", - " for row in coords:\n", - " b = row[1]\n", - " if not b == 0:\n", - " x = row[2] / b\n", - " y = row[3] / b\n", - " if drawing is not None:\n", - " drawing += circle((x, y), 1 / b, rgbcolor=color)\n", - " else:\n", - " drawing = circle((x, y), 1 / b, rgbcolor=color)\n", - " return drawing" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "root = matrix([\n", - " [2, 0, 0, 1],\n", - " [2, 0, 0, -1],\n", - " [-1, 1, 0, 0],\n", - " [3, 1, 2, 0]\n", - "])\n", - "\n", - "S4 = matrix([\n", - " [1, 0, 0, 0],\n", - " [0, 1, 0, 0],\n", - " [0, 0, 1, 0],\n", - " [2, 2, 2, -1],\n", - "])\n", - "\n", - "drawing = draw_circles_from_coords(root)\n", - "branches = [root]\n", - "for i in range(10):\n", - " new_branches = []\n", - " for tree in branches:\n", - " drawing += draw_circles_from_coords(tree)\n", - " new_branches.append(S1 * tree)\n", - " new_branches.append(S2 * tree)\n", - " new_branches.append(S3 * tree)\n", - " new_branches.append(S4 * tree)\n", - " branches = new_branches\n", - "drawing" - ] - }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Hmm. Doesn't look like it worked. And my crude code to draw the circles doesn't seem to be the problem either." + "Hmm. Doesn't look like it worked. And my crude code to draw the circles doesn't seem to be the problem either. I calculated a few of these circles by hand using the matrices and it comes out exactly where it's drawn here, so my code isn't the problem. Unless, of course, I computed the generators of the Weyl group wrong." ] }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -446,7 +392,7 @@ "Graphics object consisting of 8 graphics primitives" ] }, - "execution_count": 93, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -466,7 +412,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -490,7 +436,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -555,7 +501,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -565,7 +511,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -581,7 +527,7 @@ "[ 3/4 -3/2 3/4 -1 -5/4 1/2 -5/4 1]" ] }, - "execution_count": 66, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -604,7 +550,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -618,7 +564,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 21, "metadata": { "scrolled": true }, @@ -632,7 +578,7 @@ "[-5/4 1/2 -5/4 1]" ] }, - "execution_count": 68, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -644,7 +590,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -653,7 +599,7 @@ "97*b1^2 - 304*b1*b2 + 328*b2^2 - 290*b1*b3 - 304*b2*b3 + 97*b3^2 + 32*b1*b_avg - 1088*b2*b_avg + 32*b3*b_avg + 1280*b_avg^2" ] }, - "execution_count": 69, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" }