Circle-Packings/.ipynb_checkpoints/Apollonian Circle Packings-checkpoint.ipynb

2172 lines
133 KiB
Text
Raw Normal View History

2021-03-08 07:43:47 -08:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-03-12 18:07:17 -08:00
"# Calculations to find the quadratic form of the octahedral packing"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$P$ is the matrix of the quadratic form corresponding to $h_1^2 + h_2^2 - \\tilde{b}b = 1$."
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 1,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [],
"source": [
"P = matrix([\n",
" [0, -1/2, 0, 0],\n",
" [-1/2, 0, 0, 0],\n",
" [0, 0, 1, 0],\n",
" [0, 0, 0, 1],\n",
"])"
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 2,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 0 -2 0 0]\n",
"[-2 0 0 0]\n",
"[ 0 0 1 0]\n",
"[ 0 0 0 1]"
]
},
2021-03-08 12:41:32 -08:00
"execution_count": 2,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P.inverse()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-03-12 18:07:17 -08:00
"For an Apollonian packing, you can make a matrix, $W$, where the rows are the coordinates of each of the circles in a quadruple. In an octahedral packing, this is impossible, as there are six circles in a unit. You can try creating a $6\\times 4$ matrix, but, later, we end up needing to invert $WPW^T$, the product of a $6\\times 4$, $4\\times 4$, and $4\\times 6$ matrix, which is singular. Fortunately, the sextuples come in three pairs of circles. Each pair consists of circles that aren't tangent to each other. It turns out that the average of the coordinates of the circles in a pair is the same across the sextuple. So, we can make a matrix where the first three rows are the coordinates of circles from different pairs, i.e. three mutually tangent circles, and the fourth is the average of the coordinates in a pair. From this, you can recover the coordinates for all the circles in a sextuple.\n",
2021-03-08 07:43:47 -08:00
"\n",
"Here $W$ is such a matrix computed for the $(0, 0, 1, 1, 2, 2)$ root sextuple."
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 3,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [],
"source": [
"W = matrix([\n",
" [2, 0, 0, 1],\n",
" [2, 0, 0, -1],\n",
" [-1, 1, 0, 0],\n",
2021-03-12 18:07:17 -08:00
" [6, 2, 2*sqrt(2), 0]\n",
2021-03-08 07:43:47 -08:00
"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here we have $$\n",
" WPW^T = \\left(\\begin{matrix}\n",
" 1 & -1 & -1 & -1\\\\\n",
" -1 & 1 & -1 & -1\\\\\n",
" -1 & -1 & 1 & -1\\\\\n",
" -1 & -1 & -1 & -1\n",
" \\end{matrix}\\right) = M\n",
"$$\n",
"So, inverting both sides, we get $$\n",
" (WPW^T)^{-1} = M^{-1}\n",
"$$ $$\n",
" (W^T)^{-1}P^{-1}W^{-1} = M^{-1}\n",
"$$ $$\n",
" P^{-1} = W^TM^{-1}W\n",
".$$\n",
"\n",
"Like in the case with Apollonian packings, this is true for any sextuple $W$. So, we can substitute an arbitrary sextuple for $W$ and it must be equal to $P^{-1}$, letting us derive some useful quadratic forms."
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 4,
2021-03-08 07:43:47 -08:00
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"[ 1 -1 -1 -2]\n",
"[-1 1 -1 -2]\n",
"[-1 -1 1 -2]\n",
"[-2 -2 -2 -4]"
2021-03-08 07:43:47 -08:00
]
},
2021-03-08 12:41:32 -08:00
"execution_count": 4,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M = W * P * W.transpose()\n",
"M"
]
},
2021-03-12 18:07:17 -08:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$M^{-1}$ is the matrix of the quadratic form, although it is nice to normalize it to have ones along the diagonal, which is fine since it is equal to zero.\n",
"$$\n",
"\\left(\\begin{matrix}\n",
" 1 & 0 & 0 & -1/2\\\\\n",
" 0 & 1 & 0 & -1/2\\\\\n",
" 0 & 0 & 1 & -1/2\\\\\n",
" -1/2 & -1/2 & -1/2 & 1/4\n",
"\\end{matrix}\\right)\n",
"$$"
]
},
2021-03-08 07:43:47 -08:00
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 5,
2021-03-08 07:43:47 -08:00
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"[ 1/2 0 0 -1/4]\n",
"[ 0 1/2 0 -1/4]\n",
"[ 0 0 1/2 -1/4]\n",
"[-1/4 -1/4 -1/4 1/8]"
2021-03-08 07:43:47 -08:00
]
},
2021-03-08 12:41:32 -08:00
"execution_count": 5,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M.inverse()"
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 6,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [],
"source": [
"bt1 = var('bt1')\n",
"b1 = var('b1')\n",
"h11 = var('h11')\n",
"h12 = var('h12')\n",
"bt2 = var('bt2')\n",
"b2 = var('b2')\n",
"h21 = var('h21')\n",
"h22 = var('h22')\n",
"bt3 = var('bt3')\n",
"b3 = var('b3')\n",
"h31 = var('h31')\n",
"h32 = var('h32')\n",
"b5_avg = var('b5_avg')\n",
"b_avg = var('b_avg')\n",
"h1_avg = var('h1_avg')\n",
"h2_avg = var('h2_avg')\n",
"\n",
"\n",
"W2 = matrix([\n",
" [bt1, b1, h11, h12],\n",
" [bt2, b2, h21, h22],\n",
" [bt3, b3, h31, h32],\n",
" [b5_avg, b_avg, h1_avg, h2_avg],\n",
"])"
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 7,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [],
"source": [
"D = W2.transpose() * M.inverse() * W2"
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 8,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 0 -2 0 0]\n",
"[-2 0 0 0]\n",
"[ 0 0 1 0]\n",
"[ 0 0 0 1]"
]
},
2021-03-08 12:41:32 -08:00
"execution_count": 8,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P.inverse()"
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 9,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"b1^2 + b2^2 + b3^2 - b1*b_avg - b2*b_avg - b3*b_avg + 1/4*b_avg^2"
2021-03-08 07:43:47 -08:00
]
},
2021-03-08 12:41:32 -08:00
"execution_count": 9,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-03-12 18:07:17 -08:00
"2 * factor(simplify(D[1][1]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"So, we end up deriving the quadratic form $$\n",
" b_1^2 + b_2^2 + b_3^2 + b_{\\text{sum}}^2/4 - b_{\\text{sum}}(b_1 + b_2 + b_3) = 0\n",
".$$\n",
"\n",
"This means that, given three mutually tangent circles with curvatures $b_1,b_2,b_3$, there are two solutions for $b_{\\text{avg}}$, allowing us to derive two new sets of three mutually tangent circles with curvatures $b_1' = 2b_{\\text{avg}} - b_1$ etc."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculations to find the generators for the \"Apollonian\" Group for the octahedral packing\n",
"\n",
"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."
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-03-08 12:41:32 -08:00
"execution_count": 10,
2021-03-08 07:43:47 -08:00
"metadata": {},
2021-03-12 18:07:17 -08:00
"outputs": [],
"source": [
"def weyl_generators(matrix, alphas):\n",
" retval = []\n",
" for alpha in alphas:\n",
2021-05-24 10:56:59 -07:00
" scale_factor = (alpha.transpose() * matrix * alpha)[0][0]\n",
" retval.append(identity_matrix(len(alphas)) - 2 * alpha * alpha.transpose() * matrix / scale_factor)\n",
2021-03-12 18:07:17 -08:00
" return retval"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"def standard_basis(dim):\n",
" return [ matrix(dim, 1, [0] * i + [1] + [0] * (dim - i - 1)) for i in range(dim) ]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
2021-05-24 10:56:59 -07:00
"outputs": [
{
"data": {
"text/plain": [
"[ 2 0 0 -1]\n",
"[ 0 2 0 -1]\n",
"[ 0 0 2 -1]\n",
"[ -1 -1 -1 1/2]"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"4 * M.inverse()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
2021-03-08 07:43:47 -08:00
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"[\n",
2021-05-24 10:56:59 -07:00
"[-1 0 0 1] [ 1 0 0 0] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [ 0 -1 0 1] [ 0 1 0 0] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [ 0 0 -1 1] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1], [ 4 4 4 -1]\n",
2021-03-12 18:07:17 -08:00
"]"
2021-03-08 07:43:47 -08:00
]
},
2021-05-24 10:56:59 -07:00
"execution_count": 13,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-05-24 10:56:59 -07:00
"S_i = weyl_generators(4 * M.inverse(), standard_basis(4))\n",
2021-03-12 18:07:17 -08:00
"S_i"
]
},
{
"cell_type": "code",
2021-05-24 10:56:59 -07:00
"execution_count": 14,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [],
"source": [
"S1 = S_i[0]\n",
"S2 = S_i[1]\n",
"S3 = S_i[2]\n",
"S4 = S_i[3]"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-03-12 18:07:17 -08:00
"We can test this out on the packing on page 3 of the Guettler and Mallows. The root sextuple is (-1, 2, 2, 4, 4 7), so the coordinates would be (-1, 2, 4, 6). After applying $s_1$, it should swap out $s_1$ for its pair, resulting in (7, 2, 4, 6). Likewise for $s_2$ and $s_3$. Then, for $s_4$, it should give the average between the triple (-1, 2, 4) and the other tangent triple, i.e. (-1, 2, 4, 14)."
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-05-24 10:56:59 -07:00
"execution_count": 15,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"(7, 2, 4, 6)"
2021-03-08 07:43:47 -08:00
]
},
2021-05-24 10:56:59 -07:00
"execution_count": 15,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-03-12 18:07:17 -08:00
"root = vector([-1, 2, 4, 6])\n",
"S1 * root"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 16,
2021-03-08 07:43:47 -08:00
"metadata": {},
2021-03-12 18:07:17 -08:00
"outputs": [
{
"data": {
"text/plain": [
2021-05-24 10:56:59 -07:00
"(-1, 4, 4, 6)"
2021-03-12 18:07:17 -08:00
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
2021-03-08 07:43:47 -08:00
"source": [
2021-05-24 10:56:59 -07:00
"S2 * root"
2021-03-08 07:43:47 -08:00
]
},
{
2021-03-12 18:07:17 -08:00
"cell_type": "code",
"execution_count": 17,
2021-03-08 07:43:47 -08:00
"metadata": {},
2021-03-12 18:07:17 -08:00
"outputs": [
{
"data": {
"text/plain": [
2021-05-24 10:56:59 -07:00
"(-1, 2, 2, 6)"
2021-03-12 18:07:17 -08:00
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
2021-03-08 07:43:47 -08:00
"source": [
2021-05-24 10:56:59 -07:00
"S3 * root"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 18,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"(-1, 2, 4, 14)"
2021-03-08 07:43:47 -08:00
]
},
2021-03-12 18:07:17 -08:00
"execution_count": 18,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-05-24 10:56:59 -07:00
"S4 * root"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculations to find the curvatures of the dual circles of the octahedral packing\n",
"\n",
"Here the basic idea was to work out the intersection points of the circles and let the computer algebraically find the radii of the circles. The end up coming out, rather anticlimactically, to $(0, 0, \\sqrt 2, \\sqrt 2, \\sqrt 2, \\sqrt 2, 2\\sqrt 2, 2\\sqrt 2)$. It's rather satisfying and a bit surprising that the dual of the root sextuple of the octahedral packing is the root of the cubic packing, since the dual polyhedron of the octahedron is the cube."
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 19,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [],
"source": [
"def circle_from_points(pta, ptb, ptc):\n",
" a = var('a')\n",
" b = var('b')\n",
" r = var('r')\n",
" x = var('x')\n",
" y = var('y')\n",
" \n",
" circle_func = (x - a)^2 + (y - b)^2 == r^2\n",
" \n",
" eq1 = circle_func.subs(x == pta[0]).subs(y == pta[1])\n",
" eq2 = circle_func.subs(x == ptb[0]).subs(y == ptb[1])\n",
" eq3 = circle_func.subs(x == ptc[0]).subs(y == ptc[1])\n",
" \n",
" res = solve([eq1, eq2, eq3], a, b, r)[1]\n",
" \n",
" return (res[0].rhs(), res[1].rhs(), res[2].rhs())"
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 20,
2021-05-24 10:56:59 -07:00
"metadata": {
"scrolled": true
},
2021-03-08 07:43:47 -08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1/2*sqrt(2), 1)\n",
"sqrt(2)\n",
"(1/4*sqrt(2), 0)\n",
"2*sqrt(2)\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAGECAYAAAAySIfuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAA9hAAAPYQGoP6dpAABdvElEQVR4nO2dd3gUVRfG300lARIIPRAgEFrohChFEEQRRKpipwiCCCgqKqAi8inSQRGC2MAKKL2qoBBERELoJfSeACEJmxBSd8/3x2GTLCTZNruzuzm/55lnk93ZO2dmZ+57yznnaogIgiAIgmDAQ20DBEEQBOdChEEQBEEwQoRBEARBMEKEQRAEQTBChEEQBEEwQoRBEARBMEKEQRAEQTBChEEQCqBhAjQajUZtWwRBLbys/J5ExQluiVarRWBgILRardqmCIK9MNnokR6DIAiCYIQIgyAIgmCECIMgCIJghAiD4DYsXLgQzZo1Q0BAAAICAtC2bVts3rxZbbMEweUQYRDchho1amDatGmIjY3F3r178dBDD6F37944evSo2qYJgkuhsTLttnglORO3bwNxcUDDhoC/v9rWOBVBQUGYOXMmhg4dWujnWVlZyMrKyvs/NTUVISEh0Gq1CAgIcJSZ7oncl86KeCWVCOLigIgIfhUAADqdDsuWLUN6ejratm1b5H5Tp05FYGBg3hYSEuJAK90cuS9dFh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mvW8AI5JZGZM3k+oH9/nki1lqVL2VtnxgxOK1ES6d6dz3/
"text/plain": [
"Graphics object consisting of 14 graphics primitives"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"c1 = line([(-3, 1), (3, 1)])\n",
"c2 = line([(-3, -1), (3, -1)])\n",
"c3 = circle((-sqrt(2), 0), 1)\n",
"c4 = circle((sqrt(2), 0), 1)\n",
"c5 = circle((0, 1/2), 1/2)\n",
"c6 = circle((0, -1/2), 1/2)\n",
"\n",
"b1 = line([(-sqrt(2), -3), (-sqrt(2), 3)], rgbcolor=(1, 0, 0))\n",
"b2 = line([(sqrt(2), -3), (sqrt(2), 3)], rgbcolor=(1, 0, 0))\n",
"\n",
"x, y, r = circle_from_points((sqrt(2) / 3, 1 / 3), (0, 1), (sqrt(2), 1))\n",
"print('({}, {})'.format(x, y))\n",
"print(1 / r)\n",
"\n",
"b3 = circle(( x, y), r, rgbcolor=(1, 0, 0))\n",
"b4 = circle((-x, y), r, rgbcolor=(1, 0, 0))\n",
"b5 = circle(( x, -y), r, rgbcolor=(1, 0, 0))\n",
"b6 = circle((-x, -y), r, rgbcolor=(1, 0, 0))\n",
"\n",
"x, y, r = circle_from_points((sqrt(2) / 3, 1 / 3), (0, 0), (sqrt(2) / 3, -1 / 3))\n",
"print('({}, {})'.format(x, y))\n",
"print(1 / r)\n",
"\n",
"b7 = circle(( x, y), r, rgbcolor=(1, 0, 0))\n",
"b8 = circle((-x, y), r, rgbcolor=(1, 0, 0))\n",
"\n",
"show(c1 + c2 + c3 + c4 + c5 + c6 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-03-12 18:07:17 -08:00
"# The quadratic form for the cubical packing\n",
2021-03-08 07:43:47 -08:00
"\n",
2021-03-12 18:07:17 -08:00
"We first made a matrix, $W_c$, whose rows are the abbc coordinates of the circles in the root octuple. Then we found the row echelon form of that matrix, resulting in a system of linear relations the coordinates must satisfy. Then, from there, we could derive the rest of the coordinates from the first four (we chose the first four to be the \"cubicle\" from the Stange), allowing us to derive the quadratic form."
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 21,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [],
"source": [
"def abbc_coords(b, h1, h2):\n",
" return [(h1^2 + h2^2 - 1) / b, b, h1, h2]"
]
},
2021-03-12 18:07:17 -08:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The idea here is that by multiplying $W_c$ by an arbitrary vector in $\\mathbf{R}^8$ and setting that equal to $\\vec{0}$, we can find a basis for the null space of $W_c$, which will end up giving us a bunch of linear relations the curvatures must satisfy. The thing to notice is that $W_c\\vec{v} = 0$ for some $\\vec{v}\\in\\mathbf{R}^8$ gives the system of equations with coefficient matrix $W^T$. So finding the row echelon form of $W^T$ will give us the coefficients in the simplified system of linear relations, with each row equal to 0."
]
},
2021-03-08 07:43:47 -08:00
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 22,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"[ 1 0 0 0 1/2 1/2 1/2 -1/2]\n",
"[ 0 1 0 0 1/2 1/2 -1/2 1/2]\n",
"[ 0 0 1 0 1/2 -1/2 1/2 1/2]\n",
"[ 0 0 0 1 -1/2 1/2 1/2 1/2]"
2021-03-08 07:43:47 -08:00
]
},
2021-03-12 18:07:17 -08:00
"execution_count": 22,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Wc = matrix([\n",
2021-03-12 18:07:17 -08:00
" [4, 0, 0, 1],\n",
" [0, 2, 0, 1],\n",
" [2, 1, -sqrt(2), -1],\n",
" [2, 1, sqrt(2), -1],\n",
" [2, 1, -sqrt(2), 1],\n",
" [2, 1, sqrt(2), 1],\n",
" [4, 0, 0, -1],\n",
" [0, 2, 0, -1],\n",
2021-03-08 07:43:47 -08:00
"])\n",
"\n",
2021-05-24 10:56:59 -07:00
"Wc.transpose().rref()"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"From here we can conclude that $$\n",
"\\begin{align*}\n",
" 2b_1 &= -b_5 - b_6 - b_7 + b_8\\\\\n",
" 2b_2 &= -b_5 - b_6 + b_7 - b_8\\\\\n",
" 2b_3 &= -b_5 + b_6 - b_7 - b_8\\\\\n",
" 2b_4 &= b_5 - b_6 - b_7 - b_8\n",
"\\end{align*}\n",
"$$\n",
"This differs slightly from Stange's system of equations because we put the circles in a slightly different order."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In any case, this gives us the tools to derive the full octuple from just four coordinates, letting us use those four coordinates to represent the entire octuple, and finally making $WPW^T$ nonsingular, allowing us to find the quadratic form the same way we did for the Descartes quadratic form and the octahedral quadratic form."
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 23,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [],
"source": [
"W = matrix([\n",
2021-03-12 18:07:17 -08:00
" [4, 0, 0, 1],\n",
" [0, 2, 0, 1],\n",
" [2, 1, -sqrt(2), -1],\n",
" [2, 1, sqrt(2), -1],\n",
2021-03-08 07:43:47 -08:00
"])"
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1 -3 -3 -3]\n",
"[-3 1 -3 -3]\n",
"[-3 -3 1 -3]\n",
"[-3 -3 -3 1]"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = W * P * W.transpose()\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-05-24 10:56:59 -07:00
"[ 2 -6/5 -6/5 -6/5]\n",
"[-6/5 2 -6/5 -6/5]\n",
"[-6/5 -6/5 2 -6/5]\n",
"[-6/5 -6/5 -6/5 2]"
2021-03-12 18:07:17 -08:00
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-05-24 10:56:59 -07:00
"32 * m.inverse() * 2/5"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[bt1 b1 h11 h21]\n",
"[bt2 b2 h12 h22]\n",
"[bt3 b3 h13 h23]\n",
"[bt4 b4 h14 h24]"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"W2 = matrix([\n",
" [\n",
" var('bt' + str(i)),\n",
" var('b' + str(i)),\n",
" var('h1' + str(i)),\n",
" var('h2' + str(i)),\n",
" ] for i in range(1, 5)\n",
"])\n",
"W2"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
"D = W2.transpose() * m.inverse() * W2"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5*b1^2 - 6*b1*b2 + 5*b2^2 - 6*b1*b3 - 6*b2*b3 + 5*b3^2 - 6*b1*b4 - 6*b2*b4 - 6*b3*b4 + 5*b4^2"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"32 * simplify(expand(D[1][1]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This spits out the lovely quadratic form $$\n",
" 8(b_1^2 + b_2^2 + b_3^2 + b_4^2) = 3(b_1 + b_2 + b_3 + b_4)^2\n",
".$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here's the generators for the Weyl group. They might or might not be generators for the packing itself, however."
]
},
{
"cell_type": "code",
"execution_count": 29,
2021-03-08 07:43:47 -08:00
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"[\n",
2021-05-24 10:56:59 -07:00
"[ -1 6/5 6/5 6/5] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [6/5 -1 6/5 6/5] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [6/5 6/5 -1 6/5]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1],\n",
"\n",
"[ 1 0 0 0]\n",
"[ 0 1 0 0]\n",
"[ 0 0 1 0]\n",
"[6/5 6/5 6/5 -1]\n",
2021-03-12 18:07:17 -08:00
"]"
2021-03-08 07:43:47 -08:00
]
},
2021-03-12 18:07:17 -08:00
"execution_count": 29,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-05-24 10:56:59 -07:00
"S_i = weyl_generators(m.inverse(), standard_basis(4))\n",
2021-03-12 18:07:17 -08:00
"S_i"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-03-12 18:07:17 -08:00
"execution_count": 30,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
2021-05-24 10:56:59 -07:00
"[ 1 0 0 0 1/2 1/2 1/2 -1/2]\n",
"[ 0 1 0 0 1/2 1/2 -1/2 1/2]\n",
"[ 0 0 1 0 1/2 -1/2 1/2 1/2]\n",
"[ 0 0 0 1 -1/2 1/2 1/2 1/2]\n",
"[ 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0]"
2021-03-12 18:07:17 -08:00
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-05-24 10:56:59 -07:00
"(Wc * P * Wc.transpose()).rref()"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Generalization of this method\n",
"This method seems remarkably general. Given a matrix representing a root unit of a packing, we can find the linear relation between the coordinates, and thus represent the packing with only four coordinates, allowing us to find the quadratic form."
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"def quadform_from_root(root_matrix):\n",
2021-05-24 10:56:59 -07:00
" n = root_matrix.dimensions()[1]\n",
2021-03-12 18:07:17 -08:00
" P = matrix([\n",
" [0, -1/2, 0, 0],\n",
" [-1/2, 0, 0, 0],\n",
" [0, 0, 1, 0],\n",
" [0, 0, 0, 1],\n",
" ])\n",
" \n",
" # step 1: find linear relation between coords\n",
2021-05-24 10:56:59 -07:00
" relations_temp = vector([ var('b' + str(i)) for i in range(1, n + 1)]) * root_matrix.transpose().rref()\n",
" relations = []\n",
" for i, expr in enumerate(relations_temp):\n",
" relations.append(var('b' + str(i + 1)) == expr)\n",
" \n",
2021-03-12 18:07:17 -08:00
" # step 2: find matrix of quadratic form\n",
2021-05-24 10:56:59 -07:00
" W = root_matrix[-4:]\n",
2021-03-12 18:07:17 -08:00
" M = W * P * W.transpose()\n",
" \n",
" # step 3: repeat with arbitrary matrix\n",
" W2 = matrix([\n",
" [\n",
" var('bt' + str(i)),\n",
" var('b' + str(i)),\n",
" var('h1' + str(i)),\n",
" var('h2' + str(i)),\n",
" ] for i in range(1, 5)\n",
" ])\n",
" D = factor(simplify(expand(W2.transpose() * M.inverse() * W2)))\n",
" \n",
2021-05-24 10:56:59 -07:00
" return relations[4:], M.inverse(), D[1][1]"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "code",
2021-05-24 10:56:59 -07:00
"execution_count": 122,
2021-03-08 07:43:47 -08:00
"metadata": {},
"outputs": [
2021-03-12 18:07:17 -08:00
{
2021-05-24 10:56:59 -07:00
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[2 \\, b_{5} = b_{1} + b_{2} + b_{3} - b_{4}, 2 \\, b_{6} = b_{1} + b_{2} - b_{3} + b_{4}, 2 \\, b_{7} = b_{1} - b_{2} + b_{3} + b_{4}, 2 \\, b_{8} = -b_{1} + b_{2} + b_{3} + b_{4}\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[2 \\, b_{5} = b_{1} + b_{2} + b_{3} - b_{4}, 2 \\, b_{6} = b_{1} + b_{2} - b_{3} + b_{4}, 2 \\, b_{7} = b_{1} - b_{2} + b_{3} + b_{4}, 2 \\, b_{8} = -b_{1} + b_{2} + b_{3} + b_{4}\\right]\n",
"\\end{math}"
],
"text/plain": [
"[2*b5 == b1 + b2 + b3 - b4,\n",
" 2*b6 == b1 + b2 - b3 + b4,\n",
" 2*b7 == b1 - b2 + b3 + b4,\n",
" 2*b8 == -b1 + b2 + b3 + b4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"5 & -3 & -3 & -3 \\\\\n",
"-3 & 5 & -3 & -3 \\\\\n",
"-3 & -3 & 5 & -3 \\\\\n",
"-3 & -3 & -3 & 5\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"5 & -3 & -3 & -3 \\\\\n",
"-3 & 5 & -3 & -3 \\\\\n",
"-3 & -3 & 5 & -3 \\\\\n",
"-3 & -3 & -3 & 5\n",
"\\end{array}\\right)\n",
"\\end{math}"
],
"text/plain": [
"[ 5 -3 -3 -3]\n",
"[-3 5 -3 -3]\n",
"[-3 -3 5 -3]\n",
"[-3 -3 -3 5]"
]
},
"metadata": {},
"output_type": "display_data"
2021-03-12 18:07:17 -08:00
},
2021-03-08 07:43:47 -08:00
{
"data": {
2021-05-24 10:56:59 -07:00
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}5 \\, b_{1}^{2} - 6 \\, b_{1} b_{2} + 5 \\, b_{2}^{2} - 6 \\, b_{1} b_{3} - 6 \\, b_{2} b_{3} + 5 \\, b_{3}^{2} - 6 \\, b_{1} b_{4} - 6 \\, b_{2} b_{4} - 6 \\, b_{3} b_{4} + 5 \\, b_{4}^{2}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}5 \\, b_{1}^{2} - 6 \\, b_{1} b_{2} + 5 \\, b_{2}^{2} - 6 \\, b_{1} b_{3} - 6 \\, b_{2} b_{3} + 5 \\, b_{3}^{2} - 6 \\, b_{1} b_{4} - 6 \\, b_{2} b_{4} - 6 \\, b_{3} b_{4} + 5 \\, b_{4}^{2}\n",
"\\end{math}"
],
"text/plain": [
"5*b1^2 - 6*b1*b2 + 5*b2^2 - 6*b1*b3 - 6*b2*b3 + 5*b3^2 - 6*b1*b4 - 6*b2*b4 - 6*b3*b4 + 5*b4^2"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & \\frac{6}{5} & \\frac{6}{5} & \\frac{6}{5} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"\\frac{6}{5} & -1 & \\frac{6}{5} & \\frac{6}{5} \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"\\frac{6}{5} & \\frac{6}{5} & -1 & \\frac{6}{5} \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"\\frac{6}{5} & \\frac{6}{5} & \\frac{6}{5} & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & \\frac{6}{5} & \\frac{6}{5} & \\frac{6}{5} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"\\frac{6}{5} & -1 & \\frac{6}{5} & \\frac{6}{5} \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"\\frac{6}{5} & \\frac{6}{5} & -1 & \\frac{6}{5} \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"\\frac{6}{5} & \\frac{6}{5} & \\frac{6}{5} & -1\n",
"\\end{array}\\right)\\right]\n",
"\\end{math}"
],
2021-03-08 07:43:47 -08:00
"text/plain": [
2021-03-12 18:07:17 -08:00
"[\n",
2021-05-24 10:56:59 -07:00
"[ -1 6/5 6/5 6/5] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [6/5 -1 6/5 6/5] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [6/5 6/5 -1 6/5]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1],\n",
"\n",
"[ 1 0 0 0]\n",
"[ 0 1 0 0]\n",
"[ 0 0 1 0]\n",
"[6/5 6/5 6/5 -1]\n",
2021-03-12 18:07:17 -08:00
"]"
2021-03-08 07:43:47 -08:00
]
},
"metadata": {},
2021-05-24 10:56:59 -07:00
"output_type": "display_data"
2021-03-08 07:43:47 -08:00
}
],
"source": [
2021-03-12 18:07:17 -08:00
"# cubical\n",
"relation, mat, equation = quadform_from_root(Wc)\n",
2021-05-24 10:56:59 -07:00
"show([2 * eq for eq in relation])\n",
"show(32 * mat)\n",
"show(32 * equation)\n",
"show(weyl_generators(mat, standard_basis(4)))"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
2021-05-24 10:56:59 -07:00
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = b_{1} - b_{2} + b_{4}, b_{6} = b_{1} - b_{3} + b_{4}\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = b_{1} - b_{2} + b_{4}, b_{6} = b_{1} - b_{3} + b_{4}\\right]\n",
"\\end{math}"
],
"text/plain": [
"[b5 == b1 - b2 + b4, b6 == b1 - b3 + b4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & -2 & -2 & -1 \\\\\n",
"-2 & 4 & 0 & -2 \\\\\n",
"-2 & 0 & 4 & -2 \\\\\n",
"-1 & -2 & -2 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & -2 & -2 & -1 \\\\\n",
"-2 & 4 & 0 & -2 \\\\\n",
"-2 & 0 & 4 & -2 \\\\\n",
"-1 & -2 & -2 & 1\n",
"\\end{array}\\right)\n",
"\\end{math}"
],
"text/plain": [
"[ 1 -2 -2 -1]\n",
"[-2 4 0 -2]\n",
"[-2 0 4 -2]\n",
"[-1 -2 -2 1]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}b_{1}^{2} - 4 \\, b_{1} b_{2} + 4 \\, b_{2}^{2} - 4 \\, b_{1} b_{3} + 4 \\, b_{3}^{2} - 2 \\, b_{1} b_{4} - 4 \\, b_{2} b_{4} - 4 \\, b_{3} b_{4} + b_{4}^{2}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}b_{1}^{2} - 4 \\, b_{1} b_{2} + 4 \\, b_{2}^{2} - 4 \\, b_{1} b_{3} + 4 \\, b_{3}^{2} - 2 \\, b_{1} b_{4} - 4 \\, b_{2} b_{4} - 4 \\, b_{3} b_{4} + b_{4}^{2}\n",
"\\end{math}"
],
"text/plain": [
"b1^2 - 4*b1*b2 + 4*b2^2 - 4*b1*b3 + 4*b3^2 - 2*b1*b4 - 4*b2*b4 - 4*b3*b4 + b4^2"
]
},
"metadata": {},
"output_type": "display_data"
2021-03-12 18:07:17 -08:00
},
{
"data": {
2021-05-24 10:56:59 -07:00
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & 4 & 4 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"1 & -1 & 0 & 1 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"1 & 0 & -1 & 1 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 4 & 4 & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & 4 & 4 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"1 & -1 & 0 & 1 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"1 & 0 & -1 & 1 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 4 & 4 & -1\n",
"\\end{array}\\right)\\right]\n",
"\\end{math}"
],
2021-03-12 18:07:17 -08:00
"text/plain": [
"[\n",
"[-1 4 4 2] [ 1 0 0 0] [ 1 0 0 0] [ 1 0 0 0]\n",
2021-05-24 10:56:59 -07:00
"[ 0 1 0 0] [ 1 -1 0 1] [ 0 1 0 0] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [ 1 0 -1 1] [ 0 0 1 0]\n",
2021-03-12 18:07:17 -08:00
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1], [ 2 4 4 -1]\n",
"]"
]
},
"metadata": {},
2021-05-24 10:56:59 -07:00
"output_type": "display_data"
2021-03-12 18:07:17 -08:00
}
],
"source": [
"# octahedral\n",
"relation, mat, equation = quadform_from_root(matrix([\n",
" [2, 0, 0, 1],\n",
" [2, 0, 0, -1],\n",
" [-1, 1, 0, 0],\n",
" [4, 2, 2*sqrt(2), -1],\n",
" [4, 2, 2*sqrt(2), 1],\n",
" [7, 1, 2*sqrt(2), 0],\n",
"]))\n",
2021-05-24 10:56:59 -07:00
"show(relation)\n",
"show(8 * mat)\n",
"show(8 * equation)\n",
"show(weyl_generators(8 * mat, standard_basis(4)))"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
2021-05-24 10:56:59 -07:00
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\right]\n",
"\\end{math}"
],
"text/plain": [
"[]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & -1 & -1 & -1 \\\\\n",
"-1 & 1 & -1 & -1 \\\\\n",
"-1 & -1 & 1 & -1 \\\\\n",
"-1 & -1 & -1 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"1 & -1 & -1 & -1 \\\\\n",
"-1 & 1 & -1 & -1 \\\\\n",
"-1 & -1 & 1 & -1 \\\\\n",
"-1 & -1 & -1 & 1\n",
"\\end{array}\\right)\n",
"\\end{math}"
],
"text/plain": [
"[ 1 -1 -1 -1]\n",
"[-1 1 -1 -1]\n",
"[-1 -1 1 -1]\n",
"[-1 -1 -1 1]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}b_{1}^{2} - 2 \\, b_{1} b_{2} + b_{2}^{2} - 2 \\, b_{1} b_{3} - 2 \\, b_{2} b_{3} + b_{3}^{2} - 2 \\, b_{1} b_{4} - 2 \\, b_{2} b_{4} - 2 \\, b_{3} b_{4} + b_{4}^{2}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}b_{1}^{2} - 2 \\, b_{1} b_{2} + b_{2}^{2} - 2 \\, b_{1} b_{3} - 2 \\, b_{2} b_{3} + b_{3}^{2} - 2 \\, b_{1} b_{4} - 2 \\, b_{2} b_{4} - 2 \\, b_{3} b_{4} + b_{4}^{2}\n",
"\\end{math}"
],
"text/plain": [
"b1^2 - 2*b1*b2 + b2^2 - 2*b1*b3 - 2*b2*b3 + b3^2 - 2*b1*b4 - 2*b2*b4 - 2*b3*b4 + b4^2"
]
},
"metadata": {},
"output_type": "display_data"
2021-03-12 18:07:17 -08:00
},
{
"data": {
2021-05-24 10:56:59 -07:00
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & 2 & 2 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"2 & 2 & -1 & 2 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 2 & 2 & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & 2 & 2 & 2 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"2 & 2 & -1 & 2 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 2 & 2 & -1\n",
"\\end{array}\\right)\\right]\n",
"\\end{math}"
],
2021-03-12 18:07:17 -08:00
"text/plain": [
"[\n",
"[-1 2 2 2] [ 1 0 0 0] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [ 2 -1 2 2] [ 0 1 0 0] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [ 2 2 -1 2] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1], [ 2 2 2 -1]\n",
"]"
]
},
"metadata": {},
2021-05-24 10:56:59 -07:00
"output_type": "display_data"
2021-03-12 18:07:17 -08:00
}
],
"source": [
"# tetrahedral\n",
"relation, mat, equation = quadform_from_root(matrix([\n",
" [2, 0, 0, 1],\n",
" [2, 0, 0, -1],\n",
" [-1, 1, 0, 0],\n",
" [3, 1, 2, 0]\n",
"]))\n",
2021-05-24 10:56:59 -07:00
"show(relation)\n",
"show(4 * mat)\n",
"show(4 * equation)\n",
"show(weyl_generators(4 * mat, standard_basis(4)))"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-05-24 10:56:59 -07:00
"# $n$-Gon Base Pyramid\n",
"\n",
"The goal here is to find the quadratic form for an arbitrary $n$-gon base pyramid. The key to the whole process is a magic formula Dylan found for the bilinear form between two circles in an $n$-gon base pyramidal packing, namely $$\n",
" \\frac{1 - \\cos\\left(\\frac{2\\pi}{n}\\right) - 4\\sin^2\\left(\\frac{p\\pi}{n}\\right)}{1-\\cos\\left(\\frac{2\\pi}{n}\\right)}\n",
"$$\n",
"\n",
"where $p$ is how many circles are between the two circles in question. If we are finding the bilinear form between the central circle and any other circle it will always be $-1$ so we don't need to worry about that case."
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"# function to compute W^T*P*W for n-gon pyramidal packing\n",
"def wmatrix(n):\n",
" vals = []\n",
" for i in range(n+1):\n",
" row = []\n",
" for j in range(n+1):\n",
" if i == j: # same vertex bilinear form'd with itself, so 1\n",
" row.append(1)\n",
" elif i ==0 or j == 0: # vertex bilinear form'd with special point, so tangent and therefore -1\n",
" row.append(-1)\n",
" else:\n",
" p = abs(i - j) # otherwise Dylan's crazy formula\n",
" row.append(\n",
" (1 - cos(2 * pi / n) - 4 * sin(pi * p / n)^2) / (1 - cos(2 * pi / n))\n",
" )\n",
" vals.append(row)\n",
" return matrix(vals)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"# just convenience function for quadratic forms\n",
"def qform(matrix, vector):\n",
" return vector * matrix * vector"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
"def linear_relations_and_quadratic_form_from_wtpw(mat, indices=None):\n",
" if indices is None:\n",
" indices = range(mat.dimensions()[0])\n",
" n = mat.dimensions()[0]\n",
" \n",
" # work out initial relations\n",
" relations_temp = vector([ var('b' + str(i)) for i in range(1, n + 1) ]) * mat.transpose().rref()\n",
" relations = []\n",
" for i in range(n):\n",
" relations.append(var('b' + str(i + 1)) == relations_temp[i])\n",
" \n",
" # rewrite the relations in terms of the variables we care about, depends on the step\n",
" targets = [ var('b' + str(i)) for i in indices[4:] ]\n",
" relations = solve(relations, *targets)[0]\n",
" \n",
" # find the matrix corresponding to the quadratic form, picking the appropriate rows from the matrix\n",
" mat = matrix([\n",
" [ mat[i - 1][j - 1] for j in indices[:4] ] for i in indices[:4]\n",
" ])\n",
"\n",
" Q = mat.inverse()\n",
" \n",
" # find the quadratic form in variables; proper units will satisfy this being equal to zero\n",
" vec = vector([ var('b' + str(i)) for i in indices[:4] ])\n",
" nqform = vec * Q * vec\n",
" \n",
" return relations, Q, expand(nqform)"
]
},
{
"cell_type": "code",
"execution_count": 123,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 9 -1 -1 -1]\n",
"[-1 1 -1 -1]\n",
"[-1 -1 1 -1]\n",
"[-1 -1 -1 1]\n"
]
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}9 \\, b_{1}^{2} - 2 \\, b_{1} b_{3} + b_{3}^{2} - 2 \\, b_{1} b_{5} - 2 \\, b_{3} b_{5} + b_{5}^{2} - 2 \\, b_{1} b_{7} - 2 \\, b_{3} b_{7} - 2 \\, b_{5} b_{7} + b_{7}^{2}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}9 \\, b_{1}^{2} - 2 \\, b_{1} b_{3} + b_{3}^{2} - 2 \\, b_{1} b_{5} - 2 \\, b_{3} b_{5} + b_{5}^{2} - 2 \\, b_{1} b_{7} - 2 \\, b_{3} b_{7} - 2 \\, b_{5} b_{7} + b_{7}^{2}\n",
"\\end{math}"
],
"text/plain": [
"9*b1^2 - 2*b1*b3 + b3^2 - 2*b1*b5 - 2*b3*b5 + b5^2 - 2*b1*b7 - 2*b3*b7 - 2*b5*b7 + b7^2"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[3 \\, b_{2} = 2 \\, b_{3} - b_{5} + 2 \\, b_{7}, 3 \\, b_{4} = 2 \\, b_{3} + 2 \\, b_{5} - b_{7}, 3 \\, b_{6} = -b_{3} + 2 \\, b_{5} + 2 \\, b_{7}\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[3 \\, b_{2} = 2 \\, b_{3} - b_{5} + 2 \\, b_{7}, 3 \\, b_{4} = 2 \\, b_{3} + 2 \\, b_{5} - b_{7}, 3 \\, b_{6} = -b_{3} + 2 \\, b_{5} + 2 \\, b_{7}\\right]\n",
"\\end{math}"
],
"text/plain": [
"[3*b2 == 2*b3 - b5 + 2*b7, 3*b4 == 2*b3 + 2*b5 - b7, 3*b6 == -b3 + 2*b5 + 2*b7]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & \\frac{2}{9} & \\frac{2}{9} & \\frac{2}{9} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"2 & 2 & -1 & 2 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 2 & 2 & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & \\frac{2}{9} & \\frac{2}{9} & \\frac{2}{9} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"2 & 2 & -1 & 2 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 2 & 2 & -1\n",
"\\end{array}\\right)\\right]\n",
"\\end{math}"
],
"text/plain": [
"[\n",
"[ -1 2/9 2/9 2/9] [ 1 0 0 0] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [ 2 -1 2 2] [ 0 1 0 0] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [ 2 2 -1 2] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1], [ 2 2 2 -1]\n",
"]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"relations, Q, nqform = linear_relations_and_quadratic_form_from_wtpw(wmatrix(6), [1, 3, 5, 7, 2, 4, 6])\n",
"print(12 * Q)\n",
"show(12 * nqform)\n",
"show([3 * rel for rel in relations])\n",
"show(weyl_generators(12 * Q, standard_basis(4)))"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
"# function to compute the linear relations and quadratic formula for an ngon base pyramid\n",
"# the circles will be numbered 1 in the center, then 2 through n winding around the circle by step, so\n",
"# for n = 4 with step = 1, we have\n",
"# b3\n",
"# b4 b1 b2\n",
"# b5\n",
"# and the quadratic form is in terms of b1, b2, b3, and b4\n",
"# and for n = 6 with step = 2, we have\n",
"# b4 b3\n",
"# b5 b1 b2\n",
"# b6 b7\n",
"# and the quadratic form is in terms of b1, b3, b5, and b7\n",
"def ngon_linear_relations_and_quadratic_form(n, step=1):\n",
" mat = wmatrix(n)\n",
" \n",
" # work out initial relations\n",
" relations_temp = vector([ var('b' + str(i)) for i in range(1, n + 2) ]) * mat.transpose().rref()\n",
" relations = []\n",
" for i in range(4, n + 1):\n",
" relations.append(var('b' + str(i + 1)) == relations_temp[i])\n",
" \n",
" # rewrite the relations in terms of the variables we care about, depends on the step\n",
" shuffled = (list(range(1, n + 2)) * step)[::step]\n",
" targets = [ var('b' + str(i)) for i in shuffled[4:] ]\n",
" relations = solve(relations, *targets)[0]\n",
" \n",
" # find the matrix corresponding to the quadratic form, picking the appropriate rows from the matrix\n",
" Q = mat[:4*step:step,:4*step:step].inverse()\n",
" \n",
" # find the quadratic form in variables; proper units will satisfy this being equal to zero\n",
" nqform = qform(Q, vector([ var('b' + str(i)) for i in range(1, 5) ]))\n",
" \n",
" return relations, Q, expand(nqform)"
]
},
{
"cell_type": "code",
"execution_count": 120,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = -b_{3} {\\left(\\sqrt{2} + 1\\right)} + b_{4} {\\left(\\sqrt{2} + 1\\right)} + b_{2}, b_{6} = b_{4} {\\left(\\sqrt{2} + 2\\right)} + b_{2} {\\left(\\sqrt{2} + 1\\right)} - 2 \\, b_{3} {\\left(\\sqrt{2} + 1\\right)}, b_{7} = -b_{3} {\\left(2 \\, \\sqrt{2} + 3\\right)} + b_{2} {\\left(\\sqrt{2} + 2\\right)} + b_{4} {\\left(\\sqrt{2} + 2\\right)}, b_{8} = b_{2} {\\left(\\sqrt{2} + 2\\right)} - 2 \\, b_{3} {\\left(\\sqrt{2} + 1\\right)} + b_{4} {\\left(\\sqrt{2} + 1\\right)}, b_{9} = b_{2} {\\left(\\sqrt{2} + 1\\right)} - b_{3} {\\left(\\sqrt{2} + 1\\right)} + b_{4}\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = -b_{3} {\\left(\\sqrt{2} + 1\\right)} + b_{4} {\\left(\\sqrt{2} + 1\\right)} + b_{2}, b_{6} = b_{4} {\\left(\\sqrt{2} + 2\\right)} + b_{2} {\\left(\\sqrt{2} + 1\\right)} - 2 \\, b_{3} {\\left(\\sqrt{2} + 1\\right)}, b_{7} = -b_{3} {\\left(2 \\, \\sqrt{2} + 3\\right)} + b_{2} {\\left(\\sqrt{2} + 2\\right)} + b_{4} {\\left(\\sqrt{2} + 2\\right)}, b_{8} = b_{2} {\\left(\\sqrt{2} + 2\\right)} - 2 \\, b_{3} {\\left(\\sqrt{2} + 1\\right)} + b_{4} {\\left(\\sqrt{2} + 1\\right)}, b_{9} = b_{2} {\\left(\\sqrt{2} + 1\\right)} - b_{3} {\\left(\\sqrt{2} + 1\\right)} + b_{4}\\right]\n",
"\\end{math}"
],
"text/plain": [
"[b5 == -b3*(sqrt(2) + 1) + b4*(sqrt(2) + 1) + b2,\n",
" b6 == b4*(sqrt(2) + 2) + b2*(sqrt(2) + 1) - 2*b3*(sqrt(2) + 1),\n",
" b7 == -b3*(2*sqrt(2) + 3) + b2*(sqrt(2) + 2) + b4*(sqrt(2) + 2),\n",
" b8 == b2*(sqrt(2) + 2) - 2*b3*(sqrt(2) + 1) + b4*(sqrt(2) + 1),\n",
" b9 == b2*(sqrt(2) + 1) - b3*(sqrt(2) + 1) + b4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -2 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 3 & -2 \\\\\n",
"-2 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -2 & \\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} \\\\\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 3 & -2 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -2 \\\\\n",
"-2 & \\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -2 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1}\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -2 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 3 & -2 \\\\\n",
"-2 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -2 & \\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} \\\\\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 3 & -2 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -2 \\\\\n",
"-2 & \\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -2 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1}\n",
"\\end{array}\\right)\n",
"\\end{math}"
],
"text/plain": [
"[ -(sqrt(2) + 2)/(sqrt(2) - 2) + 1 -2 -(sqrt(2) + 2)/(sqrt(2) - 2) - 3 -2]\n",
"[ -2 -4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1) -2 4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1)]\n",
"[ -(sqrt(2) + 2)/(sqrt(2) - 2) - 3 -2 -(sqrt(2) + 2)/(sqrt(2) - 2) + 1 -2]\n",
"[ -2 4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1) -2 -4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1)]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}b_{1}^{2} - 4 \\, b_{1} b_{2} - 6 \\, b_{1} b_{3} - 4 \\, b_{2} b_{3} + b_{3}^{2} - 4 \\, b_{1} b_{4} - 4 \\, b_{3} b_{4} - \\frac{\\sqrt{2} b_{1}^{2}}{\\sqrt{2} - 2} - \\frac{2 \\, \\sqrt{2} b_{1} b_{3}}{\\sqrt{2} - 2} - \\frac{\\sqrt{2} b_{3}^{2}}{\\sqrt{2} - 2} - \\frac{2 \\, b_{1}^{2}}{\\sqrt{2} - 2} - \\frac{4 \\, b_{1} b_{3}}{\\sqrt{2} - 2} - \\frac{2 \\, b_{3}^{2}}{\\sqrt{2} - 2} - \\frac{4 \\, b_{2}^{2}}{\\frac{\\sqrt{2}}{\\sqrt{2} - 2} + \\frac{2}{\\sqrt{2} - 2} - 1} + \\frac{8 \\, b_{2} b_{4}}{\\frac{\\sqrt{2}}{\\sqrt{2} - 2} + \\frac{2}{\\sqrt{2} - 2} - 1} - \\frac{4 \\, b_{4}^{2}}{\\frac{\\sqrt{2}}{\\sqrt{2} - 2} + \\frac{2}{\\sqrt{2} - 2} - 1}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}b_{1}^{2} - 4 \\, b_{1} b_{2} - 6 \\, b_{1} b_{3} - 4 \\, b_{2} b_{3} + b_{3}^{2} - 4 \\, b_{1} b_{4} - 4 \\, b_{3} b_{4} - \\frac{\\sqrt{2} b_{1}^{2}}{\\sqrt{2} - 2} - \\frac{2 \\, \\sqrt{2} b_{1} b_{3}}{\\sqrt{2} - 2} - \\frac{\\sqrt{2} b_{3}^{2}}{\\sqrt{2} - 2} - \\frac{2 \\, b_{1}^{2}}{\\sqrt{2} - 2} - \\frac{4 \\, b_{1} b_{3}}{\\sqrt{2} - 2} - \\frac{2 \\, b_{3}^{2}}{\\sqrt{2} - 2} - \\frac{4 \\, b_{2}^{2}}{\\frac{\\sqrt{2}}{\\sqrt{2} - 2} + \\frac{2}{\\sqrt{2} - 2} - 1} + \\frac{8 \\, b_{2} b_{4}}{\\frac{\\sqrt{2}}{\\sqrt{2} - 2} + \\frac{2}{\\sqrt{2} - 2} - 1} - \\frac{4 \\, b_{4}^{2}}{\\frac{\\sqrt{2}}{\\sqrt{2} - 2} + \\frac{2}{\\sqrt{2} - 2} - 1}\n",
"\\end{math}"
],
"text/plain": [
"b1^2 - 4*b1*b2 - 6*b1*b3 - 4*b2*b3 + b3^2 - 4*b1*b4 - 4*b3*b4 - sqrt(2)*b1^2/(sqrt(2) - 2) - 2*sqrt(2)*b1*b3/(sqrt(2) - 2) - sqrt(2)*b3^2/(sqrt(2) - 2) - 2*b1^2/(sqrt(2) - 2) - 4*b1*b3/(sqrt(2) - 2) - 2*b3^2/(sqrt(2) - 2) - 4*b2^2/(sqrt(2)/(sqrt(2) - 2) + 2/(sqrt(2) - 2) - 1) + 8*b2*b4/(sqrt(2)/(sqrt(2) - 2) + 2/(sqrt(2) - 2) - 1) - 4*b4^2/(sqrt(2)/(sqrt(2) - 2) + 2/(sqrt(2) - 2) - 1)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -\\frac{2 \\, {\\left(\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 3\\right)}}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -1 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"-\\frac{2 \\, {\\left(\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 3\\right)}}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -1 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & 2 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -\\frac{2 \\, {\\left(\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 3\\right)}}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -1 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"-\\frac{2 \\, {\\left(\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 3\\right)}}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} & -1 & -\\frac{4}{\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} - 1} \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"-\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & 2 & -\\frac{\\sqrt{2} + 2}{\\sqrt{2} - 2} + 1 & -1\n",
"\\end{array}\\right)\\right]\n",
"\\end{math}"
],
"text/plain": [
"[\n",
"[ -1 -4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1) -2*((sqrt(2) + 2)/(sqrt(2) - 2) + 3)/((sqrt(2) + 2)/(sqrt(2) - 2) - 1) -4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1)] [ 1 0 0 0] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [-(sqrt(2) + 2)/(sqrt(2) - 2) + 1 -1 -(sqrt(2) + 2)/(sqrt(2) - 2) + 1 2] [ 0 1 0 0] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [-2*((sqrt(2) + 2)/(sqrt(2) - 2) + 3)/((sqrt(2) + 2)/(sqrt(2) - 2) - 1) -4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1) -1 -4/((sqrt(2) + 2)/(sqrt(2) - 2) - 1)] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1], [-(sqrt(2) + 2)/(sqrt(2) - 2) + 1 2 -(sqrt(2) + 2)/(sqrt(2) - 2) + 1 -1]\n",
"]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"relations, Q, nqform = ngon_linear_relations_and_quadratic_form(8)\n",
"\n",
"show(relations)\n",
"show(8 * Q)\n",
"show(8 * nqform)\n",
"show(weyl_generators(8 * Q, standard_basis(4)))"
]
},
{
"cell_type": "code",
"execution_count": 163,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[3 \\, b_{2} = 2 \\, b_{3} - b_{5} + 2 \\, b_{7}, 3 \\, b_{4} = 2 \\, b_{3} + 2 \\, b_{5} - b_{7}, 3 \\, b_{6} = -b_{3} + 2 \\, b_{5} + 2 \\, b_{7}\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[3 \\, b_{2} = 2 \\, b_{3} - b_{5} + 2 \\, b_{7}, 3 \\, b_{4} = 2 \\, b_{3} + 2 \\, b_{5} - b_{7}, 3 \\, b_{6} = -b_{3} + 2 \\, b_{5} + 2 \\, b_{7}\\right]\n",
"\\end{math}"
],
"text/plain": [
"[3*b2 == 2*b3 - b5 + 2*b7, 3*b4 == 2*b3 + 2*b5 - b7, 3*b6 == -b3 + 2*b5 + 2*b7]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"9 & -1 & -1 & -1 \\\\\n",
"-1 & 1 & -1 & -1 \\\\\n",
"-1 & -1 & 1 & -1 \\\\\n",
"-1 & -1 & -1 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"9 & -1 & -1 & -1 \\\\\n",
"-1 & 1 & -1 & -1 \\\\\n",
"-1 & -1 & 1 & -1 \\\\\n",
"-1 & -1 & -1 & 1\n",
"\\end{array}\\right)\n",
"\\end{math}"
],
"text/plain": [
"[ 9 -1 -1 -1]\n",
"[-1 1 -1 -1]\n",
"[-1 -1 1 -1]\n",
"[-1 -1 -1 1]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}9 \\, b_{1}^{2} - 2 \\, b_{1} b_{2} + b_{2}^{2} - 2 \\, b_{1} b_{3} - 2 \\, b_{2} b_{3} + b_{3}^{2} - 2 \\, b_{1} b_{4} - 2 \\, b_{2} b_{4} - 2 \\, b_{3} b_{4} + b_{4}^{2}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}9 \\, b_{1}^{2} - 2 \\, b_{1} b_{2} + b_{2}^{2} - 2 \\, b_{1} b_{3} - 2 \\, b_{2} b_{3} + b_{3}^{2} - 2 \\, b_{1} b_{4} - 2 \\, b_{2} b_{4} - 2 \\, b_{3} b_{4} + b_{4}^{2}\n",
"\\end{math}"
],
"text/plain": [
"9*b1^2 - 2*b1*b2 + b2^2 - 2*b1*b3 - 2*b2*b3 + b3^2 - 2*b1*b4 - 2*b2*b4 - 2*b3*b4 + b4^2"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & \\frac{2}{9} & \\frac{2}{9} & \\frac{2}{9} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"2 & 2 & -1 & 2 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 2 & 2 & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & \\frac{2}{9} & \\frac{2}{9} & \\frac{2}{9} \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 2 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"2 & 2 & -1 & 2 \\\\\n",
"0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrr}\n",
"1 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 \\\\\n",
"2 & 2 & 2 & -1\n",
"\\end{array}\\right)\\right]\n",
"\\end{math}"
],
"text/plain": [
"[\n",
"[ -1 2/9 2/9 2/9] [ 1 0 0 0] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [ 2 -1 2 2] [ 0 1 0 0] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [ 2 2 -1 2] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1], [ 2 2 2 -1]\n",
"]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{2}{9} \\, b_{2} + \\frac{2}{9} \\, b_{3} + \\frac{2}{9} \\, b_{4}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{2}{9} \\, b_{2} + \\frac{2}{9} \\, b_{3} + \\frac{2}{9} \\, b_{4}\n",
"\\end{math}"
],
"text/plain": [
"2/9*b2 + 2/9*b3 + 2/9*b4"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"relations, Q, nqform = ngon_linear_relations_and_quadratic_form(6, 2)\n",
"\n",
"show([3 * eq for eq in relations])\n",
"show(12 * Q)\n",
"show(12 * nqform)\n",
"show(weyl_generators(12 * Q, standard_basis(4)))\n",
"\n",
"sols = solve(nqform, b1)\n",
"s1 = sols[0].rhs()\n",
"s2 = sols[1].rhs()\n",
"show(s1 + s2)"
]
},
{
"cell_type": "code",
"execution_count": 164,
"metadata": {},
"outputs": [],
"source": [
"class Circle:\n",
" def __init__(self, bt, b, h1, h2):\n",
" self.bt = bt\n",
" self.b = b\n",
" self.h1 = h1\n",
" self.h2 = h2\n",
" self.vec = vector(bt, b, h1, h2)\n",
" \n",
" def __mul__(self, other):\n",
" self.vec *= other\n",
" self.bt = self.vec[0]\n",
" self.b = self.vec[1]\n",
" self.h1 = self.vec[2]\n",
" self.h2 = self.vec[3]\n",
" \n",
" def draw(self, plt):\n",
" \n",
" \n",
"def from_xyr(x, y, r):\n",
" b = 1/r\n",
" h1 = b * x\n",
" h2 = b * y\n",
" return Circle((1 - h1^2 - h2^2) / b, b, h1, h2)"
]
},
{
"cell_type": "code",
"execution_count": 158,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(-2/3*sqrt(3), -1)\t1/3*sqrt(3)\n",
"(-1/6*sqrt(3), -1)\t1/6*sqrt(3)\n",
"(0, 1)\tsqrt(3)\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAGGCAYAAAB/gCblAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSD0lEQVR4nO3dd3gUZdcH4N+mkgAJLURKgvQQAgIhaABRqqAvEQt2iiBSAoogCqggIKCIWDBgQcH6IahA8FWaUlRaCAklCfWV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Nqh6VfQUFcRnbv5v4OMnSGS5HE4Eo+/pirCT77DIiMVDsam9q6dSuio6Oxc+dObNy4EXl5eejTpw8yZA6CyouM5E5vS5Zwc2bhMuThs6vYsQN46SV+DRmidjQ2t27dOrP/L1u2DHXr1kV8fDy6deumUlRO4Nlngf37gfHjgfBwp/tCIUondwyuICuLW5l07Midl1xAamoqAKBWrVql/j0nJwdpaWlmL1GGd9/lsjN0KJcl4fQkMbiCN97gWdiWLQM8nP8m0Wg0Yvz48ejSpQvCwsJKXWbu3Lnw9/cvfAUFBTk4Sh3x8ACWLuUyJB3fXIIkBme3fTuwYAF3YgsJUTsah4iOjsbBgwexfPnyMpeZMmUKUlNTC1+nT592YIQ61KoVz/X93ntcLSmcmvN/fXRlWVlcR9ypE8+x4ALGjh2LX375Bdu2bUPDclpdeXt7w9vb24GROYGJE3nO76FDgcREwMdH7YiEncgdgzN7/fWiKiR3d7WjsSsiwtixY7Fq1Sr88ccfaNy4sdohOR9396IqpTfeUDsaYUeSGJzV9u3A+++7TBVSdHQ0vv32W3z
"text/plain": [
"Graphics object consisting of 14 graphics primitives"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"b1, b2, b3, b4, b5, b6, b7 = var('b1 b2 b3 b4 b5 b6 b7')\n",
"test = [relation.subs([b1 == 0, b2 == 1, b3 == 0, b4 == 1]) for relation in relations]\n",
"\n",
"plt = line([(-2*sqrt(3), 1), (2*sqrt(3), 1)])\n",
"plt += line([(-2*sqrt(3), -1), (2*sqrt(3), -1)])\n",
"plt += circle((-sqrt(3), 0), 1)\n",
"plt += circle((-1/3 * sqrt(3), -2/3), 1/3)\n",
"plt += circle((0, -3/4), 1/4)\n",
"plt += circle((1/3 * sqrt(3), -2/3), 1/3)\n",
"plt += circle((sqrt(3), 0), 1)\n",
"\n",
"plt += line([(-sqrt(3), 2*sqrt(3)), (-sqrt(3), -2*sqrt(3))], rgbcolor=(1,0,0))\n",
"plt += line([( sqrt(3), 2*sqrt(3)), ( sqrt(3), -2*sqrt(3))], rgbcolor=(1,0,0))\n",
"\n",
"x, y = var('x y')\n",
"c1 = (x + sqrt(3))^2 + y^2 == 1\n",
"c2 = (x + 1/3*sqrt(3))^2 + (y + 2/3)^2 == 1/9\n",
"c3 = x^2 + (y + 3/4)^2 == 1/16\n",
"i1 = solve([c1, c2], [x, y])[0]\n",
"x1 = i1[0].rhs()\n",
"y1 = i1[1].rhs()\n",
"i2 = solve([c2, c3], [x, y])[0]\n",
"x2 = i2[0].rhs()\n",
"y2 = i2[1].rhs()\n",
"\n",
"x, y, r = circle_from_points((-sqrt(3), -1), (-1/3*sqrt(3), -1), (x1, y1))\n",
"print('({}, {})\\t{}'.format(x, y, r))\n",
"\n",
"plt += circle((x, y), r, rgbcolor=(1,0,0))\n",
"plt += circle((-x, y), r, rgbcolor=(1,0,0))\n",
"\n",
"x, y, r = circle_from_points((-1/3*sqrt(3), -1), (0, -1), (x2, y2))\n",
"print('({}, {})\\t{}'.format(x, y, r))\n",
"\n",
"plt += circle((x, y), r, rgbcolor=(1,0,0))\n",
"plt += circle((-x, y), r, rgbcolor=(1,0,0))\n",
"\n",
"x, y, r = circle_from_points((-sqrt(3), 1), (x1, y1), (sqrt(3), 1))\n",
"print('({}, {})\\t{}'.format(x, y, r))\n",
"\n",
"plt += circle((x, y), r, rgbcolor=(1, 0, 0))\n",
"\n",
"show(plt)"
]
},
{
"cell_type": "code",
"execution_count": 152,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = b_{2} - 2 \\, b_{3} + 2 \\, b_{4}, b_{6} = 2 \\, b_{2} - 3 \\, b_{3} + 2 \\, b_{4}, b_{7} = 2 \\, b_{2} - 2 \\, b_{3} + b_{4}\\right]</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = b_{2} - 2 \\, b_{3} + 2 \\, b_{4}, b_{6} = 2 \\, b_{2} - 3 \\, b_{3} + 2 \\, b_{4}, b_{7} = 2 \\, b_{2} - 2 \\, b_{3} + b_{4}\\right]\n",
"\\end{math}"
],
"text/plain": [
"[b5 == b2 - 2*b3 + 2*b4, b6 == 2*b2 - 3*b3 + 2*b4, b7 == 2*b2 - 2*b3 + b4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}6 \\, b_{1}^{2} - 4 \\, b_{1} b_{2} + \\frac{2}{3} \\, b_{2}^{2} + 4 \\, b_{1} b_{3} - 4 \\, b_{2} b_{3} + 6 \\, b_{3}^{2} - 4 \\, b_{1} b_{4} - \\frac{4}{3} \\, b_{2} b_{4} - 4 \\, b_{3} b_{4} + \\frac{2}{3} \\, b_{4}^{2}</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}6 \\, b_{1}^{2} - 4 \\, b_{1} b_{2} + \\frac{2}{3} \\, b_{2}^{2} + 4 \\, b_{1} b_{3} - 4 \\, b_{2} b_{3} + 6 \\, b_{3}^{2} - 4 \\, b_{1} b_{4} - \\frac{4}{3} \\, b_{2} b_{4} - 4 \\, b_{3} b_{4} + \\frac{2}{3} \\, b_{4}^{2}\n",
"\\end{math}"
],
"text/plain": [
"6*b1^2 - 4*b1*b2 + 2/3*b2^2 + 4*b1*b3 - 4*b2*b3 + 6*b3^2 - 4*b1*b4 - 4/3*b2*b4 - 4*b3*b4 + 2/3*b4^2"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"relations, Q, nqform = ngon_linear_relations_and_quadratic_form(6)\n",
"show(relations)\n",
"show(simplify(8 * nqform))"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[b5 == -1/2*b3*(sqrt(5) + 3) + 1/2*b4*(sqrt(5) + 3) + b2, b6 == -1/2*b3*(3*sqrt(5) + 5) + 1/2*b2*(sqrt(5) + 3) + b4*(sqrt(5) + 2), b7 == b4*(sqrt(5) + 3) + b2*(sqrt(5) + 2) - 2*b3*(sqrt(5) + 2), b8 == -b3*(2*sqrt(5) + 5) + b2*(sqrt(5) + 3) + b4*(sqrt(5) + 3), b9 == b2*(sqrt(5) + 3) - 2*b3*(sqrt(5) + 2) + b4*(sqrt(5) + 2), b10 == -1/2*b3*(3*sqrt(5) + 5) + 1/2*b4*(sqrt(5) + 3) + b2*(sqrt(5) + 2), b11 == 1/2*b2*(sqrt(5) + 3) - 1/2*b3*(sqrt(5) + 3) + b4]\n"
]
}
],
"source": [
"relations, Q, nqform = ngon_linear_relations_and_quadratic_form(10)\n",
"print(relations)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-1/2*b2*bt1 - 1/2*b1*bt2 + h11*h12 + h21*h22"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"vec1 = vector([var('bt1'), var('b1'), var('h11'), var('h21')])\n",
"vec2 = vector([var('bt2'), var('b2'), var('h12'), var('h22')])\n",
"vec1 * P * vec2"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{2 \\, \\sin\\left(\\frac{\\pi k}{n}\\right)^{2}}{\\sin\\left(\\frac{\\pi}{n}\\right)^{2}} + 1</script></html>"
],
"text/latex": [
"\\begin{math}\n",
"\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{2 \\, \\sin\\left(\\frac{\\pi k}{n}\\right)^{2}}{\\sin\\left(\\frac{\\pi}{n}\\right)^{2}} + 1\n",
"\\end{math}"
],
"text/plain": [
"-2*sin(pi*k/n)^2/sin(pi/n)^2 + 1"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"k = var('k', domain=RR)\n",
"n = var('n', domain=RR)\n",
"\n",
"c1 = 1\n",
"c2i = sin(2 * pi * k / n)\n",
"c2r = cos(2 * pi * k / n)\n",
"\n",
"dist = sin(pi * k / n)\n",
"r = dist.subs(k==1) / 2\n",
"dist /= r\n",
"\n",
"bf = 1/2 * (1 + 1 * (1 - dist^2))\n",
"show(bf)"
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 \t 0\n",
"1 \t x - 1\n",
"2 \t 2*x^2 - 2\n",
"3 \t 4*x^3 - 3*x - 1\n",
"4 \t 8*x^4 - 8*x^2\n",
"5 \t 16*x^5 - 20*x^3 + 5*x - 1\n",
"6 \t 32*x^6 - 48*x^4 + 18*x^2 - 2\n",
"7 \t 64*x^7 - 112*x^5 + 56*x^3 - 7*x - 1\n",
"8 \t 128*x^8 - 256*x^6 + 160*x^4 - 32*x^2\n",
"9 \t 256*x^9 - 576*x^7 + 432*x^5 - 120*x^3 + 9*x - 1\n",
"10 \t 512*x^10 - 1280*x^8 + 1120*x^6 - 400*x^4 + 50*x^2 - 2\n"
]
}
],
"source": [
"T = []\n",
"x = var('x')\n",
"T.append(1)\n",
"T.append(x)\n",
"\n",
"def nextT():\n",
" i = len(T)\n",
" T.append(expand(2 * x * T[i - 1] - T[i - 2]))\n",
" #print(i, '\\t', T[i] - 1)\n",
" \n",
"for _ in range(9):\n",
" nextT()\n",
"\n",
"for i, poly in enumerate(T):\n",
" print(i, '\\t', poly - 1)"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-x^6 + x^5 + x^4 - x^3 - 2*x^2 + 2*x"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expand(x * (1 - x) * (x^4 - x^2 + 2))"
2021-03-08 07:43:47 -08:00
]
}
],
"metadata": {
"kernelspec": {
"display_name": "SageMath 9.2",
"language": "sage",
"name": "sagemath"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
2021-05-24 10:56:59 -07:00
},
"name": "Apollonian Circle Packings.ipynb"
2021-03-08 07:43:47 -08:00
},
"nbformat": 4,
"nbformat_minor": 4
}