Circle-Packings/old_stuff/Apollonian Circle Packings.ipynb

3555 lines
204 KiB
Text
Raw Permalink Normal View History

2021-03-05 18:47:48 -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"
]
},
{
"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$."
]
},
2021-03-05 18:47:48 -08:00
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 1,
2021-03-05 18:47:48 -08:00
"metadata": {},
2021-05-24 10:56:59 -07:00
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}-2 \\, \\pi - \\frac{2 \\, R}{r {\\left(\\frac{R^{2}}{r^{2}} + 1\\right)}} + 2 \\, \\arctan\\left(\\frac{R}{r}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}-2 \\, \\pi - \\frac{2 \\, R}{r {\\left(\\frac{R^{2}}{r^{2}} + 1\\right)}} + 2 \\, \\arctan\\left(\\frac{R}{r}\\right)$$"
],
"text/plain": [
"-2*pi - 2*R/(r*(R^2/r^2 + 1)) + 2*arctan(R/r)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var('r, R')\n",
"d = diff(2 * atan(R / r) * r - 2 * pi * r, r)\n",
"show(d)"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 2,
2021-05-24 10:56:59 -07:00
"metadata": {
"scrolled": true
},
2021-03-05 18:47:48 -08:00
"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-06-01 17:37:27 -07:00
"execution_count": 3,
2021-05-24 10:56:59 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}2</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}2$$"
],
"text/plain": [
"2"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,0,\\,0,\\,0\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,0,\\,0,\\,0\\right)$$"
],
"text/plain": [
"(1, 0, 0, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(0,\\,1,\\,0,\\,0\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(0,\\,1,\\,0,\\,0\\right)$$"
],
"text/plain": [
"(0, 1, 0, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(0,\\,0,\\,1,\\,0\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(0,\\,0,\\,1,\\,0\\right)$$"
],
"text/plain": [
"(0, 0, 1, 0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(0,\\,0,\\,0,\\,1\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(0,\\,0,\\,0,\\,1\\right)$$"
],
"text/plain": [
"(0, 0, 0, 1)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mat = matrix([\n",
" [2, -2, -2, -2],\n",
" [-2, 2, -2, -2],\n",
" [-2, -2, 2, -2],\n",
" [-2, -2, -2, 2]\n",
"])\n",
"\n",
"a1 = vector([1, 0, 0, 0])\n",
"a2 = vector([0, 1, 0, 0])\n",
"a3 = vector([0, 0, 1, 0])\n",
"a4 = vector([0, 0, 0, 1])\n",
"\n",
"av1 = 2 / (a1 * mat * a1) * a1\n",
"av2 = 2 / (a2 * mat * a2) * a2\n",
"av3 = 2 / (a3 * mat * a3) * a3\n",
"av4 = 2 / (a4 * mat * a4) * a4\n",
"\n",
"show(a1 * mat * a1)\n",
"\n",
"show(av1)\n",
"show(av2)\n",
"show(av3)\n",
"show(av4)"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 4,
2021-03-05 18:47:48 -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-06-01 17:37:27 -07:00
"execution_count": 4,
2021-03-05 18:47:48 -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",
"\n",
"Here $W$ is such a matrix computed for the $(0, 0, 1, 1, 2, 2)$ root sextuple."
]
},
2021-03-05 18:47:48 -08:00
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 5,
2021-03-05 18:47:48 -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-05 18:47:48 -08:00
"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
2021-03-05 18:47:48 -08:00
"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."
2021-03-05 18:47:48 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 6,
2021-03-05 18:47:48 -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-05 18:47:48 -08:00
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 6,
2021-03-05 18:47:48 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M = W * P * W.transpose()\n",
"M"
2021-03-05 18:47:48 -08:00
]
},
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-05 18:47:48 -08:00
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 7,
2021-03-05 18:47:48 -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-05 18:47:48 -08:00
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 7,
2021-03-05 18:47:48 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M.inverse()"
2021-03-05 18:47:48 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 8,
2021-03-05 18:47:48 -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",
2021-03-05 18:47:48 -08:00
"\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",
2021-03-05 18:47:48 -08:00
"])"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 9,
2021-03-05 18:47:48 -08:00
"metadata": {},
"outputs": [],
"source": [
"D = W2.transpose() * M.inverse() * W2"
2021-03-05 18:47:48 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 10,
2021-03-05 18:47:48 -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-06-01 17:37:27 -07:00
"execution_count": 10,
2021-03-05 18:47:48 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P.inverse()"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 11,
2021-03-05 18:47:48 -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-05 18:47:48 -08:00
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 11,
2021-03-05 18:47:48 -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-05 18:47:48 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 12,
2021-03-05 18:47:48 -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-03-29 17:16:35 -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",
2021-06-01 17:37:27 -07:00
"execution_count": 13,
2021-03-12 18:07:17 -08:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 14,
2021-03-29 17:16:35 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 2 0 0 -1]\n",
"[ 0 2 0 -1]\n",
"[ 0 0 2 -1]\n",
"[ -1 -1 -1 1/2]"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 14,
2021-03-29 17:16:35 -07:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"4 * M.inverse()"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 15,
2021-03-12 18:07:17 -08:00
"metadata": {},
2021-03-05 18:47:48 -08:00
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"[\n",
2021-03-29 17:16:35 -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-05 18:47:48 -08:00
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 15,
2021-03-05 18:47:48 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-03-29 17:16:35 -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-06-01 17:37:27 -07:00
"execution_count": 16,
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-05 18:47:48 -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-05 18:47:48 -08:00
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 17,
2021-03-05 18:47:48 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"(7, 2, 4, 6)"
2021-03-05 18:47:48 -08:00
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 17,
2021-03-05 18:47:48 -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-06-01 17:37:27 -07:00
"execution_count": 18,
2021-03-08 07:43:47 -08:00
"metadata": {},
2021-03-12 18:07:17 -08:00
"outputs": [
{
"data": {
"text/plain": [
"(-1, 4, 4, 6)"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 18,
2021-03-12 18:07:17 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
2021-03-08 07:43:47 -08:00
"source": [
2021-03-12 18:07:17 -08:00
"S2 * root"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 19,
2021-03-08 07:43:47 -08:00
"metadata": {},
2021-03-12 18:07:17 -08:00
"outputs": [
{
"data": {
"text/plain": [
"(-1, 2, 2, 6)"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 19,
2021-03-12 18:07:17 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
2021-03-08 07:43:47 -08:00
"source": [
2021-03-12 18:07:17 -08:00
"S3 * root"
2021-03-08 07:43:47 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 20,
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-06-01 17:37:27 -07:00
"execution_count": 20,
2021-03-08 07:43:47 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-03-29 17:16:35 -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."
]
},
2021-03-05 18:47:48 -08:00
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 21,
2021-03-05 18:47:48 -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-06-01 17:37:27 -07:00
"execution_count": 22,
2021-03-05 18:47:48 -08:00
"metadata": {},
2021-05-24 10:56:59 -07:00
"outputs": [],
"source": [
"def abbc_coords(b, h1, h2):\n",
" return [(h1^2 + h2^2 - 1) / b, b, h1, h2]"
]
},
{
"cell_type": "code",
2021-07-15 10:50:33 -07:00
"execution_count": 63,
2021-05-24 10:56:59 -07:00
"metadata": {
"scrolled": true
},
2021-03-05 18:47:48 -08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1/2*sqrt(2), 1)\n",
2021-07-15 10:50:33 -07:00
"sqrt(2)\n",
"(1/4*sqrt(2), 0)\n",
"2*sqrt(2)\n"
2021-03-05 18:47:48 -08:00
]
},
{
"data": {
2021-07-15 10:50:33 -07:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAGECAYAAAAySIfuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAA9hAAAPYQGoP6dpAABeHElEQVR4nO2dd3gUVRfG382mk0IJJZCEqkDohCBNJaBIEQQFC4JUpYtdUKQrfIJioUtTUFA6Fpp0B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YLePsBAYCa9cC778PvPsu+8ozM21/XJ2OffNz5vA2Y4bzT8jTaICPPwbWrOHxkebN+V4RigQiDEWR6Gj2xwcH89+NGqltkXJotcDkydwDWryYo6rS0213vIQE4Kmn2G20ZQv3FlyJ557j3s/t28ATT/AsdcHlEWEoahw4wBVZeDhXZI4UcaQkr74KrFrFaTZefpldPUpz5w7P+v7vP2DrVq44XZHatYGdO/nvli05ek1waUQYihInTuSkr9iwgV0vrkzHjsDKlSwOffooO+aQksJjGefPs8A2aKBc2Y5IpUoctUQEtG4NxMerbZFgQ0QYigq3bvGkqpAQzp3j76+2Rfbh2WeBH3/k7bPPlCmTiKO4Dh/mQdp69ZQp19EJC+Oe0Z07QNeutumFCQ6BCENRICMDePFFfqDXrnXeyCNLefFFDrscNYrP31o+/xz46Sdg0SLHm7Bma6pUYRfdnj3A8OFqWyPYCBGGosB777GPeMUKTmddFPnkE+CFF4AePXiuhqX88QcwciSLzIsvKmefM9GiBc+InzW
2021-03-05 18:47:48 -08:00
"text/plain": [
2021-07-15 10:50:33 -07:00
"Graphics object consisting of 14 graphics primitives"
2021-03-05 18:47:48 -08:00
]
},
"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",
2021-03-05 18:47:48 -08:00
"print(1 / r)\n",
"\n",
2021-05-24 10:56:59 -07:00
"btest = []\n",
"coordsnew = abbc_coords(1/r, x/r, y/r)\n",
"bnew = coordsnew[0]\n",
"btest.append(circle((coordsnew[2]/bnew, coordsnew[3]/bnew), 1/bnew))\n",
"coordsnew = abbc_coords(1/r, -x/r, y/r)\n",
"bnew = coordsnew[0]\n",
"btest.append(circle((coordsnew[2]/bnew, coordsnew[3]/bnew), 1/bnew))\n",
"coordsnew = abbc_coords(1/r, x/r, -y/r)\n",
"bnew = coordsnew[0]\n",
"btest.append(circle((coordsnew[2]/bnew, coordsnew[3]/bnew), 1/bnew))\n",
"coordsnew = abbc_coords(1/r, -x/r, -y/r)\n",
"bnew = coordsnew[0]\n",
"btest.append(circle((coordsnew[2]/bnew, coordsnew[3]/bnew), 1/bnew))\n",
"\n",
2021-07-15 10:50:33 -07:00
"#show(sum(btest))\n",
2021-05-24 10:56:59 -07:00
"\n",
2021-03-05 18:47:48 -08:00
"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",
2021-03-05 18:47:48 -08:00
"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",
2021-07-15 10:50:33 -07:00
"show(c1 + c2 + c3 + c4 + c5 + c6 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8)"
2021-03-05 18:47:48 -08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2021-03-12 18:07:17 -08:00
"# The quadratic form for the cubical packing\n",
"\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-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."
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 24,
"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-06-01 17:37:27 -07:00
"execution_count": 24,
"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",
"])\n",
"\n",
2021-03-29 17:16:35 -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."
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 25,
"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",
"])"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 26,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[ 1 -3 -3 -3]\n",
"[-3 1 -3 -3]\n",
"[-3 -3 1 -3]\n",
"[-3 -3 -3 1]"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 26,
2021-03-12 18:07:17 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = W * P * W.transpose()\n",
"m"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 27,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2021-03-29 17:16:35 -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
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 27,
2021-03-12 18:07:17 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-03-29 17:16:35 -07:00
"32 * m.inverse() * 2/5"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 28,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[bt1 b1 h11 h21]\n",
"[bt2 b2 h12 h22]\n",
"[bt3 b3 h13 h23]\n",
"[bt4 b4 h14 h24]"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 28,
2021-03-12 18:07:17 -08:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 29,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [],
"source": [
"D = W2.transpose() * m.inverse() * W2"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 30,
2021-03-12 18:07:17 -08:00
"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"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 30,
2021-03-12 18:07:17 -08:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 31,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
2021-03-12 18:07:17 -08:00
"[\n",
2021-03-29 17:16:35 -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-06-01 17:37:27 -07:00
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-03-29 17:16:35 -07:00
"S_i = weyl_generators(m.inverse(), standard_basis(4))\n",
2021-03-12 18:07:17 -08:00
"S_i"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 32,
2021-03-12 18:07:17 -08:00
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
2021-03-29 17:16:35 -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
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 32,
2021-03-12 18:07:17 -08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2021-03-29 17:16:35 -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",
2021-06-01 17:37:27 -07:00
"execution_count": 33,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [],
"source": [
"def quadform_from_root(root_matrix):\n",
2021-03-29 21:38:58 -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-03-29 21:38:58 -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-03-29 17:16:35 -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-03-29 21:38:58 -07:00
" return relations[4:], M.inverse(), D[1][1]"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 34,
"metadata": {},
"outputs": [
2021-03-12 18:07:17 -08:00
{
2021-03-29 21:38:58 -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": [
2021-05-24 10:56:59 -07:00
"$$\\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]$$"
2021-03-29 21:38:58 -07:00
],
"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": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
2021-03-29 21:38:58 -07:00
"5 & -3 & -3 & -3 \\\\\n",
"-3 & 5 & -3 & -3 \\\\\n",
"-3 & -3 & 5 & -3 \\\\\n",
"-3 & -3 & -3 & 5\n",
2021-05-24 10:56:59 -07:00
"\\end{array}\\right)$$"
2021-03-29 21:38:58 -07:00
],
"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"
},
{
"data": {
"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": [
2021-05-24 10:56:59 -07:00
"$$\\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}$$"
2021-03-29 21:38:58 -07:00
],
"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"
2021-03-12 18:07:17 -08:00
},
{
"data": {
2021-03-29 21:38:58 -07:00
"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": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
2021-03-29 21:38:58 -07:00
"-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",
2021-05-24 10:56:59 -07:00
"\\end{array}\\right)\\right]$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
2021-03-12 18:07:17 -08:00
"[\n",
2021-03-29 17:16:35 -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
"]"
]
},
"metadata": {},
2021-03-29 21:38:58 -07:00
"output_type": "display_data"
}
],
"source": [
2021-03-12 18:07:17 -08:00
"# cubical\n",
"relation, mat, equation = quadform_from_root(Wc)\n",
2021-03-29 21:38:58 -07:00
"show([2 * eq for eq in relation])\n",
"show(32 * mat)\n",
"show(32 * equation)\n",
2021-05-24 10:56:59 -07:00
"show(weyl_generators(mat, standard_basis(4)))"
2021-03-12 18:07:17 -08:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 35,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [
{
2021-03-29 21:38:58 -07:00
"data": {
"text/html": [
2021-05-24 10:56:59 -07:00
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = b_{1} + b_{3} + b_{4}, b_{6} = b_{2} + b_{3} + b_{4}\\right]</script></html>"
2021-03-29 21:38:58 -07:00
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5} = b_{1} + b_{3} + b_{4}, b_{6} = b_{2} + b_{3} + b_{4}\\right]$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
2021-05-24 10:56:59 -07:00
"[b5 == b1 + b3 + b4, b6 == b2 + b3 + b4]"
2021-03-29 21:38:58 -07:00
]
},
"metadata": {},
"output_type": "display_data"
2021-03-12 18:07:17 -08:00
},
{
"data": {
2021-03-29 21:38:58 -07:00
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
2021-05-24 10:56:59 -07:00
"17 & 15 & -6 & -6 \\\\\n",
"15 & 17 & -6 & -6 \\\\\n",
"-6 & -6 & 4 & 0 \\\\\n",
"-6 & -6 & 0 & 4\n",
2021-03-29 21:38:58 -07:00
"\\end{array}\\right)</script></html>"
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"17 & 15 & -6 & -6 \\\\\n",
"15 & 17 & -6 & -6 \\\\\n",
"-6 & -6 & 4 & 0 \\\\\n",
"-6 & -6 & 0 & 4\n",
"\\end{array}\\right)$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
2021-05-24 10:56:59 -07:00
"[17 15 -6 -6]\n",
"[15 17 -6 -6]\n",
"[-6 -6 4 0]\n",
"[-6 -6 0 4]"
2021-03-29 21:38:58 -07:00
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
2021-05-24 10:56:59 -07:00
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}17 \\, b_{1}^{2} + 30 \\, b_{1} b_{2} + 17 \\, b_{2}^{2} - 12 \\, b_{1} b_{3} - 12 \\, b_{2} b_{3} + 4 \\, b_{3}^{2} - 12 \\, b_{1} b_{4} - 12 \\, b_{2} b_{4} + 4 \\, b_{4}^{2}</script></html>"
2021-03-29 21:38:58 -07:00
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}17 \\, b_{1}^{2} + 30 \\, b_{1} b_{2} + 17 \\, b_{2}^{2} - 12 \\, b_{1} b_{3} - 12 \\, b_{2} b_{3} + 4 \\, b_{3}^{2} - 12 \\, b_{1} b_{4} - 12 \\, b_{2} b_{4} + 4 \\, b_{4}^{2}$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
2021-05-24 10:56:59 -07:00
"17*b1^2 + 30*b1*b2 + 17*b2^2 - 12*b1*b3 - 12*b2*b3 + 4*b3^2 - 12*b1*b4 - 12*b2*b4 + 4*b4^2"
2021-03-29 21:38:58 -07:00
]
},
"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",
2021-05-24 10:56:59 -07:00
"-1 & -\\frac{30}{17} & \\frac{12}{17} & \\frac{12}{17} \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"-\\frac{30}{17} & -1 & \\frac{12}{17} & \\frac{12}{17} \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"3 & 3 & -1 & 0 \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"3 & 3 & 0 & -1\n",
2021-03-29 21:38:58 -07:00
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & -\\frac{30}{17} & \\frac{12}{17} & \\frac{12}{17} \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"-\\frac{30}{17} & -1 & \\frac{12}{17} & \\frac{12}{17} \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"3 & 3 & -1 & 0 \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"3 & 3 & 0 & -1\n",
"\\end{array}\\right)\\right]$$"
2021-03-29 21:38:58 -07:00
],
2021-03-12 18:07:17 -08:00
"text/plain": [
"[\n",
2021-05-24 10:56:59 -07:00
"[ -1 -30/17 12/17 12/17] [ 1 0 0 0]\n",
"[ 0 1 0 0] [-30/17 -1 12/17 12/17]\n",
"[ 0 0 1 0] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 0 0 0 1],\n",
"\n",
"[ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [ 0 1 0 0]\n",
"[ 3 3 -1 0] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 3 3 0 -1]\n",
2021-03-12 18:07:17 -08:00
"]"
]
},
"metadata": {},
2021-03-29 21:38:58 -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",
2021-05-24 10:56:59 -07:00
" [1, 1, sqrt(2), 0],\n",
" [1, 1, -sqrt(2), 0],\n",
" [4, 2, 0, 1],\n",
" [4, 2, 0, -1],\n",
2021-03-12 18:07:17 -08:00
"]))\n",
2021-03-29 21:38:58 -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",
2021-06-01 17:37:27 -07:00
"execution_count": 36,
2021-03-12 18:07:17 -08:00
"metadata": {},
"outputs": [
{
2021-03-29 21:38:58 -07:00
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\right]</script></html>"
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\right]$$"
2021-03-29 21:38:58 -07:00
],
"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": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
2021-03-29 21:38:58 -07:00
"1 & -1 & -1 & -1 \\\\\n",
"-1 & 1 & -1 & -1 \\\\\n",
"-1 & -1 & 1 & -1 \\\\\n",
"-1 & -1 & -1 & 1\n",
2021-05-24 10:56:59 -07:00
"\\end{array}\\right)$$"
2021-03-29 21:38:58 -07:00
],
"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": [
2021-05-24 10:56:59 -07:00
"$$\\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}$$"
2021-03-29 21:38:58 -07:00
],
"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-03-29 21:38:58 -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": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
2021-03-29 21:38:58 -07:00
"-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",
2021-05-24 10:56:59 -07:00
"\\end{array}\\right)\\right]$$"
2021-03-29 21:38:58 -07:00
],
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-03-29 21:38:58 -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-03-29 21:38:58 -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-03-29 21:38:58 -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",
2021-06-01 17:37:27 -07:00
"execution_count": 37,
2021-03-29 21:38:58 -07:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 38,
2021-03-29 21:38:58 -07:00
"metadata": {},
"outputs": [],
"source": [
"# just convenience function for quadratic forms\n",
"def qform(matrix, vector):\n",
" return vector * matrix * vector"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 39,
2021-03-29 21:38:58 -07:00
"metadata": {},
"outputs": [],
"source": [
2021-05-24 10:56:59 -07:00
"def linear_relations_and_quadratic_form_from_wtpw(mat, indices=None):\n",
" if indices is None:\n",
" indices = range(mat.dimensions()[0] + 1)\n",
" n = mat.dimensions()[0]\n",
2021-03-29 21:38:58 -07:00
" \n",
" # work out initial relations\n",
2021-05-24 10:56:59 -07:00
" relations_temp = vector([ var('b' + str(i)) for i in range(1, n + 1) ]) * mat.transpose().rref()\n",
2021-03-29 21:38:58 -07:00
" relations = []\n",
2021-05-24 10:56:59 -07:00
" for i in range(n):\n",
2021-03-29 21:38:58 -07:00
" 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",
2021-05-24 10:56:59 -07:00
" targets = [ var('b' + str(i)) for i in indices[4:] ]\n",
" show(relations)\n",
" show(targets)\n",
" #relations = solve(relations, *targets)[0]\n",
2021-03-29 21:38:58 -07:00
" \n",
" # find the matrix corresponding to the quadratic form, picking the appropriate rows from the matrix\n",
2021-05-24 10:56:59 -07:00
" 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",
2021-03-29 21:38:58 -07:00
" \n",
" # find the quadratic form in variables; proper units will satisfy this being equal to zero\n",
2021-05-24 10:56:59 -07:00
" vec = vector([ var('b' + str(i)) for i in indices[:4] ])\n",
" nqform = vec * Q * vec\n",
2021-03-29 21:38:58 -07:00
" \n",
" return relations, Q, expand(nqform)"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 40,
2021-03-29 21:38:58 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
2021-05-24 10:56:59 -07:00
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{4}, 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>"
2021-03-29 21:38:58 -07:00
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{4}, 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]$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
2021-05-24 10:56:59 -07:00
"[b1 == b1,\n",
" b2 == b2,\n",
" b3 == b3,\n",
" b4 == b4,\n",
" b5 == b2 - 2*b3 + 2*b4,\n",
" b6 == 2*b2 - 3*b3 + 2*b4,\n",
" b7 == 2*b2 - 2*b3 + b4]"
2021-03-29 21:38:58 -07:00
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
2021-05-24 10:56:59 -07:00
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{2}, b_{4}, b_{6}\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{2}, b_{4}, b_{6}\\right]$$"
],
"text/plain": [
"[b2, b4, b6]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"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>"
2021-03-29 21:38:58 -07:00
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\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}$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
2021-05-24 10:56:59 -07:00
"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"
2021-03-29 21:38:58 -07:00
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
2021-05-24 10:56:59 -07:00
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[3 \\, b_{1} = 3 \\, b_{1}, 3 \\, b_{2} = 3 \\, b_{2}, 3 \\, b_{3} = 3 \\, b_{3}, 3 \\, b_{4} = 3 \\, b_{4}, 3 \\, b_{5} = 3 \\, b_{2} - 6 \\, b_{3} + 6 \\, b_{4}, 3 \\, b_{6} = 6 \\, b_{2} - 9 \\, b_{3} + 6 \\, b_{4}, 3 \\, b_{7} = 6 \\, b_{2} - 6 \\, b_{3} + 3 \\, b_{4}\\right]</script></html>"
2021-03-29 21:38:58 -07:00
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[3 \\, b_{1} = 3 \\, b_{1}, 3 \\, b_{2} = 3 \\, b_{2}, 3 \\, b_{3} = 3 \\, b_{3}, 3 \\, b_{4} = 3 \\, b_{4}, 3 \\, b_{5} = 3 \\, b_{2} - 6 \\, b_{3} + 6 \\, b_{4}, 3 \\, b_{6} = 6 \\, b_{2} - 9 \\, b_{3} + 6 \\, b_{4}, 3 \\, b_{7} = 6 \\, b_{2} - 6 \\, b_{3} + 3 \\, b_{4}\\right]$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
2021-05-24 10:56:59 -07:00
"[3*b1 == 3*b1,\n",
" 3*b2 == 3*b2,\n",
" 3*b3 == 3*b3,\n",
" 3*b4 == 3*b4,\n",
" 3*b5 == 3*b2 - 6*b3 + 6*b4,\n",
" 3*b6 == 6*b2 - 9*b3 + 6*b4,\n",
" 3*b7 == 6*b2 - 6*b3 + 3*b4]"
2021-03-29 21:38:58 -07:00
]
},
"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",
2021-05-24 10:56:59 -07:00
"-1 & \\frac{2}{9} & \\frac{2}{9} & \\frac{2}{9} \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"2 & -1 & 2 & 2 \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"2 & 2 & -1 & 2 \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"2 & 2 & 2 & -1\n",
2021-03-29 21:38:58 -07:00
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & \\frac{2}{9} & \\frac{2}{9} & \\frac{2}{9} \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"2 & -1 & 2 & 2 \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"2 & 2 & -1 & 2 \\\\\n",
2021-03-29 21:38:58 -07:00
"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",
2021-05-24 10:56:59 -07:00
"2 & 2 & 2 & -1\n",
"\\end{array}\\right)\\right]$$"
2021-03-29 21:38:58 -07:00
],
"text/plain": [
"[\n",
2021-05-24 10:56:59 -07:00
"[ -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",
2021-03-29 21:38:58 -07:00
"]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2021-05-24 10:56:59 -07:00
"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)))"
2021-03-29 21:38:58 -07:00
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 41,
2021-03-29 21:38:58 -07:00
"metadata": {},
2021-05-24 10:56:59 -07:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 42,
2021-05-24 10:56:59 -07:00
"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": [
"$$\\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]$$"
],
"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": [
"$$\\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)$$"
],
"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": [
"$$\\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}$$"
],
"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": [
"$$\\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]$$"
],
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 43,
2021-05-24 10:56:59 -07:00
"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": [
"$$\\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]$$"
],
"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": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"9 & -1 & -1 & -1 \\\\\n",
"-1 & 1 & -1 & -1 \\\\\n",
2021-03-29 21:38:58 -07:00
"-1 & -1 & 1 & -1 \\\\\n",
"-1 & -1 & -1 & 1\n",
2021-05-24 10:56:59 -07:00
"\\end{array}\\right)$$"
2021-03-29 21:38:58 -07:00
],
"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": [
2021-05-24 10:56:59 -07:00
"$$\\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}$$"
2021-03-29 21:38:58 -07:00
],
"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": [
2021-05-24 10:56:59 -07:00
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
2021-03-29 21:38:58 -07:00
"-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",
2021-05-24 10:56:59 -07:00
"\\end{array}\\right)\\right]$$"
2021-03-29 21:38:58 -07:00
],
"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"
2021-05-24 10:56:59 -07:00
},
{
"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": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{2}{9} \\, b_{2} + \\frac{2}{9} \\, b_{3} + \\frac{2}{9} \\, b_{4}$$"
],
"text/plain": [
"2/9*b2 + 2/9*b3 + 2/9*b4"
]
},
"metadata": {},
"output_type": "display_data"
2021-03-29 21:38:58 -07:00
}
],
"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",
2021-05-24 10:56:59 -07:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 44,
2021-05-24 10:56:59 -07:00
"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",
" pass\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",
2021-06-01 17:37:27 -07:00
"execution_count": 45,
2021-05-24 10:56:59 -07:00
"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": {
2021-07-15 10:50:33 -07:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAGGCAYAAAB/gCblAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSB0lEQVR4nO3dd3gUZdcH4N+mkISSUAKREoq0EAICIShFlCroC2JBQaVIkRKwgCigUgUUAd9XCNiDHUEpwU9p0lRaEkJLQlV6b0lIT/Z8fxw3yZI2my0zs3vu69orkMzOnJl9Zs7OM08xEBGEEEIIEze1AxBCCKEtkhiEEEKYkcQghBDCjCQGIYQQZiQxCCGEMCOJQQghhBlJDEIIIcxIYhBCCGFGEoMQAAzM12AwGNSORQi1GSzo+SxdpIXTiYiIQEREBHJzc3H8+HEkJSXB19dX7bCEsBdFX3wkMQgBIDk5GX5+fpIYhLNTlBikKkkIIYQZSQxCCCHMSGIQQghhRhKDEEIIM5IY9CAtDdi/n38KoVdSjnVDEoMeHD0KhIbyTyH0SsqxbkhiEEIIYUYSgxBCCDOSGIRLi4iIQHBwMMLCwtQORQjNkMQgXFp4eDgSEhIQHR2tdihCaIYkBiGEEGYkMQghhDAjiUEIIYQZSQxCCCHMSGIQQghhRhKDEEIIM5IYhBBCmJHEIIQQwowkBiGEEGYkMQiXJkNiCFGYJAbh0mRIDCEKk8QghBDCjCQGIYQQZiQxCCGEMCOJQejesmXL0LJlS/j6+sLX1xft27fHb7/9pnZYQuiWJAahe3Xq1MF7772HmJgYxMTEoGvXrnj88ccRHx+vdmhC6JKH2gEIYa0+ffqY/X/OnDlYtmwZ9uzZg+bNm6sUlRD6JYlBOJXc3FysWrUKqampaN++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dkbC38HBODiNHAjk5/IVAkoOAJAYBcPXRyy9zQli+nJs2CtcwfDhPCjR0KODlBXz0kVQrCUkMLo+I5xiOiAA+/dTlkkJERAQiIiKQm5urdijqGTyYq5NGjeI7iPnzJTm4OEkMrm72bH74+NFHXKXgYsLDwxEeHo7k5GT4+fmpHY56XnqJk8MrrwCVKnHHOOGyJDG4spUreeL52bOB8ePVjkao7eWXgeRkHkKjWTMePVe4JEkMrioujuuVBw4E3npL7WiEVrz1Fg/AN3Qo0Lgx0KqV2hEJFUgTBFd05QqPfRQczD1gpT5ZmBgM3AghKIjLyNWrakckVCCJwdVkZQFPPcU/164FypdXOyKhNeXLc9nIzMwvK8KlSGJwJUTcaS06modkrlNH7YhsYt68eQgLC0OlSpVQo0YN9OvXD8eOHVM7LH0LDOQysm8f93eQoTNciiQGV7JkCVcTfPop0L692tHYzI4dOxAeHo49e/Zg8+bNyMnJQc+ePZEq8w9Yp3177vT2+efcnFm4DHn47Cp27wZee41fQ4aoHY1Nbdiwwez/kZGRqFGjBmJjY9G5c2eVonISL74IHDoEvPoqEBrqVF8oRPHkjsEVpKdzK5O2bbnzkpNLSkoCAFStWrXYZTIzM5GcnGz2EsX44AMuO0OHclkSTk8Sgyt45x2ehW35csDDuW8SiQgTJkxAp06dEBISUuxy8+bNg5+fX94rMDDQgVHqjIcHEBnJZUg6vrkESQzObtcuYNEi7sQWFKR2NHY3btw4HDp0CD/88EOJy02ZMgVJSUl5r3PnzjkoQp1q1ozn+l64kKslhVNz7q+Pri49neuI27XjORac3Pjx4xEVFYWdO3eiTiktrry8vODl5eWgyJzExIk85/fQocCBA4CPj9oRCTuROwZn9vbb+VVI7u5qR2M3RIRx48Zh9erV2Lp1Kxo0aKB2SM7J3T2/Sumdd9SORtiRJAZntWsX8OGHLlGFFB4ejm+//Rbff/8
2021-05-24 10:56:59 -07:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 46,
2021-05-24 10:56:59 -07:00
"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": [
"$$\\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]$$"
],
"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": [
"$$\\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}$$"
],
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 47,
2021-05-24 10:56:59 -07:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 48,
2021-05-24 10:56:59 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-1/2*b2*bt1 - 1/2*b1*bt2 + h11*h12 + h21*h22"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 48,
2021-05-24 10:56:59 -07:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 49,
2021-05-24 10:56:59 -07:00
"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": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{2 \\, \\sin\\left(\\frac{\\pi k}{n}\\right)^{2}}{\\sin\\left(\\frac{\\pi}{n}\\right)^{2}} + 1$$"
],
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 50,
2021-05-24 10:56:59 -07:00
"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",
2021-06-01 17:37:27 -07:00
"execution_count": 51,
2021-05-24 10:56:59 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-x^6 + x^5 + x^4 - x^3 - 2*x^2 + 2*x"
]
},
2021-06-01 17:37:27 -07:00
"execution_count": 51,
2021-05-24 10:56:59 -07:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"expand(x * (1 - x) * (x^4 - x^2 + 2))"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 52,
2021-05-24 10:56:59 -07:00
"metadata": {},
"outputs": [],
"source": [
"S1 = matrix([\n",
" [-1, 0, 0, 2],\n",
" [0, 1, 0, 0],\n",
" [0, 0, 1, 0],\n",
" [0, 0, 0, 1],\n",
"])\n",
"S2 = matrix([\n",
" [1, 0, 0, 0],\n",
" [0, -1, 0, 2],\n",
" [0, 0, 1, 0],\n",
" [0, 0, 0, 1],\n",
"])\n",
"S3 = matrix([\n",
" [1, 0, 0, 0],\n",
" [0, 1, 0, 0],\n",
" [0, 0, -1, 2],\n",
" [0, 0, 0, 1],\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",
"Ss = [S4, S4 * S1, S4 * S1 * S2, S4 * S1 * S3, S4 * S1 * S2 * S3, S4 * S2, S4 * S2 * S3, S4 * S3]\n",
"v1 = vector(var('b' + str(i + 1)) for i in range(4))\n",
"v2 = vector(var('b' + str(i + 1)) for i in range(6))\n",
"temp = [matrix * v1 for matrix in Ss]\n",
"new = []\n",
"for blah in temp:\n",
" new.append([var('b' + str(i+1) + 'p') == blah[i] for i in range(len(blah))])\n",
"\n",
"for eqs in new:\n",
" for i in range(len(eqs)):\n",
" eqs[i] = eqs[i].subs(var('b4') == var('b1') + var('b6'))\n",
" eqs[i] = eqs[i].subs(var('b4p') == var('b1p') + var('b6p'))"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 53,
2021-05-24 10:56:59 -07:00
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{1} + b_{2} - b_{3}, b_{5} = b_{4}, b_{6} = b_{2} - b_{3} - b_{4}\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{1} + b_{2} - b_{3}, b_{5} = b_{4}, b_{6} = b_{2} - b_{3} - b_{4}\\right]$$"
],
"text/plain": [
"[b1 == b1,\n",
" b2 == b2,\n",
" b3 == b3,\n",
" b4 == b1 + b2 - b3,\n",
" b5 == b4,\n",
" b6 == b2 - b3 - b4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{4}, b_{5}, b_{6}\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{4}, b_{5}, b_{6}\\right]$$"
],
"text/plain": [
"[b4, b5, b6]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{1} + b_{2} - b_{3}, b_{5} = b_{4}, b_{6} = b_{2} - b_{3} - b_{4}\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{1} + b_{2} - b_{3}, b_{5} = b_{4}, b_{6} = b_{2} - b_{3} - b_{4}\\right]$$"
],
"text/plain": [
"[b1 == b1,\n",
" b2 == b2,\n",
" b3 == b3,\n",
" b4 == b1 + b2 - b3,\n",
" b5 == b4,\n",
" b6 == 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",
"4 & 0 & -2 & 2 \\\\\n",
"0 & 4 & -2 & 2 \\\\\n",
"-2 & -2 & 1 & -3 \\\\\n",
"2 & 2 & -3 & 9\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"4 & 0 & -2 & 2 \\\\\n",
"0 & 4 & -2 & 2 \\\\\n",
"-2 & -2 & 1 & -3 \\\\\n",
"2 & 2 & -3 & 9\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ 4 0 -2 2]\n",
"[ 0 4 -2 2]\n",
"[-2 -2 1 -3]\n",
"[ 2 2 -3 9]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}4 \\, b_{0}^{2} + 4 \\, b_{1}^{2} - 4 \\, b_{0} b_{2} - 4 \\, b_{1} b_{2} + b_{2}^{2} + 4 \\, b_{0} b_{3} + 4 \\, b_{1} b_{3} - 6 \\, b_{2} b_{3} + 9 \\, b_{3}^{2}</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}4 \\, b_{0}^{2} + 4 \\, b_{1}^{2} - 4 \\, b_{0} b_{2} - 4 \\, b_{1} b_{2} + b_{2}^{2} + 4 \\, b_{0} b_{3} + 4 \\, b_{1} b_{3} - 6 \\, b_{2} b_{3} + 9 \\, b_{3}^{2}$$"
],
"text/plain": [
"4*b0^2 + 4*b1^2 - 4*b0*b2 - 4*b1*b2 + b2^2 + 4*b0*b3 + 4*b1*b3 - 6*b2*b3 + 9*b3^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 & 0 & 1 & -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",
"0 & -1 & 1 & -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",
"4 & 4 & -1 & 6 \\\\\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{4}{9} & -\\frac{4}{9} & \\frac{2}{3} & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrr}\n",
"-1 & 0 & 1 & -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",
"0 & -1 & 1 & -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",
"4 & 4 & -1 & 6 \\\\\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{4}{9} & -\\frac{4}{9} & \\frac{2}{3} & -1\n",
"\\end{array}\\right)\\right]$$"
],
"text/plain": [
"[\n",
"[-1 0 1 -1] [ 1 0 0 0] [ 1 0 0 0] [ 1 0 0 0]\n",
"[ 0 1 0 0] [ 0 -1 1 -1] [ 0 1 0 0] [ 0 1 0 0]\n",
"[ 0 0 1 0] [ 0 0 1 0] [ 4 4 -1 6] [ 0 0 1 0]\n",
"[ 0 0 0 1], [ 0 0 0 1], [ 0 0 0 1], [-4/9 -4/9 2/3 -1]\n",
"]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"W = matrix([\n",
" [2, 0, 0, 1],\n",
" [4, 2, 0, -1],\n",
" [2, 0, 0, -1],\n",
" [4, 2, 0, 1],\n",
" [1, 1, sqrt(2), 0],\n",
" [1, 1, -sqrt(2), 0],\n",
"])\n",
"\n",
"relations, Q, nqform = linear_relations_and_quadratic_form_from_wtpw(W * P * W.transpose())#, [1, 2, 3, 4, 5, 6])\n",
"show(relations)\n",
"show(8 * Q)\n",
"show(8 * nqform)\n",
"show(weyl_generators(8 * Q, standard_basis(4)))"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 54,
2021-05-24 10:56:59 -07:00
"metadata": {},
"outputs": [],
"source": [
"def diagonalize(mat):\n",
" eigs = WPWT.eigenvectors_right()\n",
" eigvs = []\n",
" eigvals = []\n",
" for eig in eigs:\n",
" for eigv in eig[1]:\n",
" eigvs.append(eigv)\n",
" for _ in range(eig[2]):\n",
" eigvals.append(eig[0])\n",
" Q = matrix(eigvs)\n",
" D = diagonal_matrix(eigvals)\n",
" return (Q, D)"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 55,
2021-05-24 10:56:59 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrrrrrr}\n",
"-1 & 2 & 6 & 2 & 10 & 6 & 2 & 6 \\\\\n",
"0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrrrrrr}\n",
"1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 6 & 6 & 10 & 6 & 2 \\\\\n",
"0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 1 & 0 & 0 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1 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\\\\n",
"6 & 2 & 6 & 10 & 2 & 6 & 2 & -1\n",
"\\end{array}\\right)\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(\\begin{array}{rrrrrrrr}\n",
"-1 & 2 & 6 & 2 & 10 & 6 & 2 & 6 \\\\\n",
"0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrrrrrr}\n",
"1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"2 & -1 & 2 & 6 & 6 & 10 & 6 & 2 \\\\\n",
"0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\n",
"\\end{array}\\right), \\left(\\begin{array}{rrrrrrrr}\n",
"1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"6 & 2 & -1 & 2 & 2 & 6 & 10 & 6 \\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 0 0]\n",
"[ 0 0 1 0 0 0 0 0] [ 0 0 1 0 0 0 0 0]\n",
"[ 0 0 0 1 0 0 0 0] [ 0 0 0 1 0 0 0 0]\n",
"[ 0 0 0 0 1 0 0 0] [ 0 0 0 0 1 0 0 0]\n",
"[ 0 0 0 0 0 1 0 0] [ 0 0 0 0 0 1 0 0]\n",
"[ 2 6 10 6 6 2 -1 2] [ 0 0 0 0 0 0 1 0]\n",
"[ 0 0 0 0 0 0 0 1], [ 6 2 6 10 2 6 2 -1]\n",
"]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1 -1 -3 -1 -5 -3 -1 -3]\n",
"[-1 1 -1 -3 -3 -5 -3 -1]\n",
"[-3 -1 1 -1 -1 -3 -5 -3]\n",
"[-1 -3 -1 1 -3 -1 -3 -5]\n",
"[-5 -3 -1 -3 1 -1 -3 -1]\n",
"[-3 -5 -3 -1 -1 1 -1 -3]\n",
"[-1 -3 -5 -3 -3 -1 1 -1]\n",
"[-3 -1 -3 -5 -1 -3 -1 1]\n"
]
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrr}\n",
"-16 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 8 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 8 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 8 & 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 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrr}\n",
"-16 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 8 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 8 & 0 & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 8 & 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 \\\\\n",
"0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[-16 0 0 0 0 0 0 0]\n",
"[ 0 8 0 0 0 0 0 0]\n",
"[ 0 0 8 0 0 0 0 0]\n",
"[ 0 0 0 8 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]\n",
"[ 0 0 0 0 0 0 0 0]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrr}\n",
"1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\\\\n",
"1 & 0 & 0 & 1 & -1 & 0 & 0 & -1 \\\\\n",
"0 & 1 & 0 & -1 & 0 & -1 & 0 & 1 \\\\\n",
"0 & 0 & 1 & 1 & 0 & 0 & -1 & -1 \\\\\n",
"1 & 0 & 0 & -1 & 0 & 1 & -1 & 0 \\\\\n",
"0 & 1 & 0 & -1 & 0 & 1 & 0 & -1 \\\\\n",
"0 & 0 & 1 & -1 & 0 & 0 & 1 & -1 \\\\\n",
"0 & 0 & 0 & 0 & 1 & -1 & 1 & -1\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrr}\n",
"1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\\\\n",
"1 & 0 & 0 & 1 & -1 & 0 & 0 & -1 \\\\\n",
"0 & 1 & 0 & -1 & 0 & -1 & 0 & 1 \\\\\n",
"0 & 0 & 1 & 1 & 0 & 0 & -1 & -1 \\\\\n",
"1 & 0 & 0 & -1 & 0 & 1 & -1 & 0 \\\\\n",
"0 & 1 & 0 & -1 & 0 & 1 & 0 & -1 \\\\\n",
"0 & 0 & 1 & -1 & 0 & 0 & 1 & -1 \\\\\n",
"0 & 0 & 0 & 0 & 1 & -1 & 1 & -1\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ 1 1 1 1 1 1 1 1]\n",
"[ 1 0 0 1 -1 0 0 -1]\n",
"[ 0 1 0 -1 0 -1 0 1]\n",
"[ 0 0 1 1 0 0 -1 -1]\n",
"[ 1 0 0 -1 0 1 -1 0]\n",
"[ 0 1 0 -1 0 1 0 -1]\n",
"[ 0 0 1 -1 0 0 1 -1]\n",
"[ 0 0 0 0 1 -1 1 -1]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0, 0\t\t[1/8]\n",
"0, 1\t\t[0]\n",
"0, 2\t\t[0]\n",
"0, 3\t\t[0]\n",
"0, 4\t\t[0]\n",
"0, 5\t\t[0]\n",
"1, 0\t\t[0]\n",
"1, 1\t\t[3/8]\n",
"1, 2\t\t[1/8]\n",
"1, 3\t\t[-1/8]\n",
"1, 4\t\t[0]\n",
"1, 5\t\t[0]\n",
"2, 0\t\t[0]\n",
"2, 1\t\t[1/8]\n",
"2, 2\t\t[3/8]\n",
"2, 3\t\t[1/8]\n",
"2, 4\t\t[0]\n",
"2, 5\t\t[0]\n",
"3, 0\t\t[0]\n",
"3, 1\t\t[-1/8]\n",
"3, 2\t\t[1/8]\n",
"3, 3\t\t[3/8]\n",
"3, 4\t\t[0]\n",
"3, 5\t\t[0]\n",
"4, 0\t\t[0]\n",
"4, 1\t\t[0]\n",
"4, 2\t\t[0]\n",
"4, 3\t\t[0]\n",
"4, 4\t\t[1/2]\n",
"4, 5\t\t[-1/4]\n",
"5, 0\t\t[0]\n",
"5, 1\t\t[0]\n",
"5, 2\t\t[0]\n",
"5, 3\t\t[0]\n",
"5, 4\t\t[-1/4]\n",
"5, 5\t\t[1/2]\n"
]
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrr}\n",
"1 & -1 & -3 & -1 & -5 & -3 & -1 & -3 \\\\\n",
"-1 & 1 & -1 & -3 & -3 & -5 & -3 & -1 \\\\\n",
"-3 & -1 & 1 & -1 & -1 & -3 & -5 & -3 \\\\\n",
"-1 & -3 & -1 & 1 & -3 & -1 & -3 & -5 \\\\\n",
"-5 & -3 & -1 & -3 & 1 & -1 & -3 & -1 \\\\\n",
"-3 & -5 & -3 & -1 & -1 & 1 & -1 & -3 \\\\\n",
"-1 & -3 & -5 & -3 & -3 & -1 & 1 & -1 \\\\\n",
"-3 & -1 & -3 & -5 & -1 & -3 & -1 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrr}\n",
"1 & -1 & -3 & -1 & -5 & -3 & -1 & -3 \\\\\n",
"-1 & 1 & -1 & -3 & -3 & -5 & -3 & -1 \\\\\n",
"-3 & -1 & 1 & -1 & -1 & -3 & -5 & -3 \\\\\n",
"-1 & -3 & -1 & 1 & -3 & -1 & -3 & -5 \\\\\n",
"-5 & -3 & -1 & -3 & 1 & -1 & -3 & -1 \\\\\n",
"-3 & -5 & -3 & -1 & -1 & 1 & -1 & -3 \\\\\n",
"-1 & -3 & -5 & -3 & -3 & -1 & 1 & -1 \\\\\n",
"-3 & -1 & -3 & -5 & -1 & -3 & -1 & 1\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ 1 -1 -3 -1 -5 -3 -1 -3]\n",
"[-1 1 -1 -3 -3 -5 -3 -1]\n",
"[-3 -1 1 -1 -1 -3 -5 -3]\n",
"[-1 -3 -1 1 -3 -1 -3 -5]\n",
"[-5 -3 -1 -3 1 -1 -3 -1]\n",
"[-3 -5 -3 -1 -1 1 -1 -3]\n",
"[-1 -3 -5 -3 -3 -1 1 -1]\n",
"[-3 -1 -3 -5 -1 -3 -1 1]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"WPWT = matrix([\n",
" [1, -1, -3, -1, -5, -3, -1, -3],\n",
" [-1, 1, -1, -3, -3, -5, -3, -1],\n",
" [-3, -1, 1, -1, -1, -3, -5, -3],\n",
" [-1, -3, -1, 1, -3, -1, -3, -5],\n",
" [-5, -3, -1, -3, 1, -1, -3, -1],\n",
" [-3, -5, -3, -1, -1, 1, -1, -3],\n",
" [-1, -3, -5, -3, -3, -1, 1, -1],\n",
" [-3, -1, -3, -5, -1, -3, -1, 1]\n",
"])\n",
"show(weyl_generators(WPWT, standard_basis(8)))\n",
"# WPWT = W * P * W.transpose()\n",
"Q, D = diagonalize(WPWT) \n",
"print(WPWT)\n",
"show(D)\n",
"show(Q)\n",
"Qi = expand(Q.inverse())\n",
"for i in range(6):\n",
" for j in range(6):\n",
" print('{}, {}\\t\\t{}'.format(i, j, expand(Qi[:,i].transpose() * Qi[:,j])))\n",
"show(expand(Q.inverse() * D * Q))"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 56,
2021-05-24 10:56:59 -07:00
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,1,\\,-\\frac{1}{3},\\,-\\frac{1}{3}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,1,\\,-\\frac{1}{3},\\,-\\frac{1}{3}\\right)$$"
],
"text/plain": [
"(1, 1, -1/3, -1/3)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-\\frac{1}{3},\\,1,\\,-\\frac{1}{3}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-\\frac{1}{3},\\,1,\\,-\\frac{1}{3}\\right)$$"
],
"text/plain": [
"(1, -1/3, 1, -1/3)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-3,\\,-3,\\,1\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-3,\\,-3,\\,1\\right)$$"
],
"text/plain": [
"(1, -3, -3, 1)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-\\frac{1}{3},\\,-\\frac{1}{3},\\,1\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-\\frac{1}{3},\\,-\\frac{1}{3},\\,1\\right)$$"
],
"text/plain": [
"(1, -1/3, -1/3, 1)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-3,\\,1,\\,-3\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,-3,\\,1,\\,-3\\right)$$"
],
"text/plain": [
"(1, -3, 1, -3)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,1,\\,-3,\\,-3\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(1,\\,1,\\,-3,\\,-3\\right)$$"
],
"text/plain": [
"(1, 1, -3, -3)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"S1 = matrix([\n",
" [1, 0, 3, 3],\n",
" [0, 1, 3, 3],\n",
" [0, 0, 0, -1],\n",
" [0, 0, -1, 0]\n",
"]).transpose()\n",
"S2 = matrix([\n",
" [1, 3, 0, 3],\n",
" [0, 0, 0, -1],\n",
" [0, 3, 1, 3],\n",
" [0, -1, 0, 0]\n",
"]).transpose()\n",
"S3 = matrix([\n",
" [0, 0, 0, -1],\n",
" [3, 1, 0, 3],\n",
" [3, 0, 1, 3],\n",
" [-1, 0, 0, 0]\n",
"]).transpose()\n",
"S4 = matrix([\n",
" [1, 3, 3, 0],\n",
" [0, 0, -1, 0],\n",
" [0, -1, 0, 0],\n",
" [0, 3, 3, 1]\n",
"]).transpose()\n",
"S5 = matrix([\n",
" [0, 0, -1, 0],\n",
" [3, 1, 3, 0],\n",
" [-1, 0, 0, 0],\n",
" [3, 0, 3, 1]\n",
"]).transpose()\n",
"S6 = matrix([\n",
" [0, -1, 0, 0],\n",
" [-1, 0, 0, 0],\n",
" [3, 3, 1, 0],\n",
" [3, 3, 0, 1]\n",
"]).transpose()\n",
"\n",
"for mat in [S1, S2, S3, S4, S5, S6]:\n",
" for eigvec in mat.eigenvectors_left():\n",
" if (eigvec[0] == -1):\n",
" show(eigvec[1][0])"
]
},
{
"cell_type": "code",
2021-06-01 17:37:27 -07:00
"execution_count": 57,
2021-05-24 10:56:59 -07:00
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{4}, b_{5} = \\frac{1}{2} \\, b_{1} + \\frac{1}{2} \\, b_{2} + \\frac{1}{2} \\, b_{3} - \\frac{1}{2} \\, b_{4}, b_{6} = \\frac{1}{2} \\, b_{1} + \\frac{1}{2} \\, b_{2} - \\frac{1}{2} \\, b_{3} + \\frac{1}{2} \\, b_{4}, b_{7} = \\frac{1}{2} \\, b_{1} - \\frac{1}{2} \\, b_{2} + \\frac{1}{2} \\, b_{3} + \\frac{1}{2} \\, b_{4}, b_{8} = -\\frac{1}{2} \\, b_{1} + \\frac{1}{2} \\, b_{2} + \\frac{1}{2} \\, b_{3} + \\frac{1}{2} \\, b_{4}\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{1} = b_{1}, b_{2} = b_{2}, b_{3} = b_{3}, b_{4} = b_{4}, b_{5} = \\frac{1}{2} \\, b_{1} + \\frac{1}{2} \\, b_{2} + \\frac{1}{2} \\, b_{3} - \\frac{1}{2} \\, b_{4}, b_{6} = \\frac{1}{2} \\, b_{1} + \\frac{1}{2} \\, b_{2} - \\frac{1}{2} \\, b_{3} + \\frac{1}{2} \\, b_{4}, b_{7} = \\frac{1}{2} \\, b_{1} - \\frac{1}{2} \\, b_{2} + \\frac{1}{2} \\, b_{3} + \\frac{1}{2} \\, b_{4}, b_{8} = -\\frac{1}{2} \\, b_{1} + \\frac{1}{2} \\, b_{2} + \\frac{1}{2} \\, b_{3} + \\frac{1}{2} \\, b_{4}\\right]$$"
],
"text/plain": [
"[b1 == b1,\n",
" b2 == b2,\n",
" b3 == b3,\n",
" b4 == b4,\n",
" b5 == 1/2*b1 + 1/2*b2 + 1/2*b3 - 1/2*b4,\n",
" b6 == 1/2*b1 + 1/2*b2 - 1/2*b3 + 1/2*b4,\n",
" b7 == 1/2*b1 - 1/2*b2 + 1/2*b3 + 1/2*b4,\n",
" b8 == -1/2*b1 + 1/2*b2 + 1/2*b3 + 1/2*b4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5}, b_{6}, b_{7}, b_{8}\\right]</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[b_{5}, b_{6}, b_{7}, b_{8}\\right]$$"
],
"text/plain": [
"[b5, b6, b7, b8]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[2 \\, b_{1} = 2 \\, b_{1}, 2 \\, b_{2} = 2 \\, b_{2}, 2 \\, b_{3} = 2 \\, b_{3}, 2 \\, b_{4} = 2 \\, b_{4}, 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": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[2 \\, b_{1} = 2 \\, b_{1}, 2 \\, b_{2} = 2 \\, b_{2}, 2 \\, b_{3} = 2 \\, b_{3}, 2 \\, b_{4} = 2 \\, b_{4}, 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]$$"
],
"text/plain": [
"[2*b1 == 2*b1,\n",
" 2*b2 == 2*b2,\n",
" 2*b3 == 2*b3,\n",
" 2*b4 == 2*b4,\n",
" 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",
"\\frac{5}{4} & -\\frac{3}{4} & -\\frac{3}{4} & -\\frac{3}{4} \\\\\n",
"-\\frac{3}{4} & \\frac{5}{4} & -\\frac{3}{4} & -\\frac{3}{4} \\\\\n",
"-\\frac{3}{4} & -\\frac{3}{4} & \\frac{5}{4} & -\\frac{3}{4} \\\\\n",
"-\\frac{3}{4} & -\\frac{3}{4} & -\\frac{3}{4} & \\frac{5}{4}\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n",
"\\frac{5}{4} & -\\frac{3}{4} & -\\frac{3}{4} & -\\frac{3}{4} \\\\\n",
"-\\frac{3}{4} & \\frac{5}{4} & -\\frac{3}{4} & -\\frac{3}{4} \\\\\n",
"-\\frac{3}{4} & -\\frac{3}{4} & \\frac{5}{4} & -\\frac{3}{4} \\\\\n",
"-\\frac{3}{4} & -\\frac{3}{4} & -\\frac{3}{4} & \\frac{5}{4}\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ 5/4 -3/4 -3/4 -3/4]\n",
"[-3/4 5/4 -3/4 -3/4]\n",
"[-3/4 -3/4 5/4 -3/4]\n",
"[-3/4 -3/4 -3/4 5/4]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{5}{4} \\, b_{1}^{2} - \\frac{3}{2} \\, b_{1} b_{2} + \\frac{5}{4} \\, b_{2}^{2} - \\frac{3}{2} \\, b_{1} b_{3} - \\frac{3}{2} \\, b_{2} b_{3} + \\frac{5}{4} \\, b_{3}^{2} - \\frac{3}{2} \\, b_{1} b_{4} - \\frac{3}{2} \\, b_{2} b_{4} - \\frac{3}{2} \\, b_{3} b_{4} + \\frac{5}{4} \\, b_{4}^{2}</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{5}{4} \\, b_{1}^{2} - \\frac{3}{2} \\, b_{1} b_{2} + \\frac{5}{4} \\, b_{2}^{2} - \\frac{3}{2} \\, b_{1} b_{3} - \\frac{3}{2} \\, b_{2} b_{3} + \\frac{5}{4} \\, b_{3}^{2} - \\frac{3}{2} \\, b_{1} b_{4} - \\frac{3}{2} \\, b_{2} b_{4} - \\frac{3}{2} \\, b_{3} b_{4} + \\frac{5}{4} \\, b_{4}^{2}$$"
],
"text/plain": [
"5/4*b1^2 - 3/2*b1*b2 + 5/4*b2^2 - 3/2*b1*b3 - 3/2*b2*b3 + 5/4*b3^2 - 3/2*b1*b4 - 3/2*b2*b4 - 3/2*b3*b4 + 5/4*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": [
"$$\\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]$$"
],
"text/plain": [
"[\n",
"[ -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",
"]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# cubical\n",
"Wc = matrix([\n",
" [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",
"])\n",
"relation, mat, equation = linear_relations_and_quadratic_form_from_wtpw(Wc * P * Wc.transpose(), [1, 2, 3, 4, 5, 6, 7, 8])\n",
"show([2 * eq for eq in relation])\n",
"show(8 * mat)\n",
"show(8 * equation)\n",
"show(weyl_generators(mat, standard_basis(4)))"
]
2021-06-01 17:37:27 -07:00
},
{
"cell_type": "code",
2021-07-15 10:50:33 -07:00
"execution_count": 58,
2021-06-01 17:37:27 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{1}{2 \\, {\\left(2 \\, \\sqrt{6} - 5\\right)}}</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\frac{1}{2 \\, {\\left(2 \\, \\sqrt{6} - 5\\right)}}$$"
],
"text/plain": [
"-1/2/(2*sqrt(6) - 5)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def abbc_coords_3d(b, h1, h2, h3):\n",
" return (1-h1^2-h2^2-h3^2)/b\n",
"\n",
"show(simplify(abbc_coords_3d(10-4*sqrt(6), 0, 0, 0)))"
]
},
{
"cell_type": "code",
2021-07-15 10:50:33 -07:00
"execution_count": 59,
2021-06-01 17:37:27 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrr}\n",
"-\\frac{1}{2} & -\\frac{1}{2} & -\\frac{1}{2} & -\\frac{1}{2} & \\sqrt{6} + \\frac{5}{2} \\\\\n",
"1 & 1 & 1 & 1 & -4 \\, \\sqrt{6} + 10 \\\\\n",
"1 & -1 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 1 & -1 & 0 \\\\\n",
"-\\frac{1}{2} \\, \\sqrt{2} & -\\frac{1}{2} \\, \\sqrt{2} & \\frac{1}{2} \\, \\sqrt{2} & \\frac{1}{2} \\, \\sqrt{2} & 0\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrr}\n",
"-\\frac{1}{2} & -\\frac{1}{2} & -\\frac{1}{2} & -\\frac{1}{2} & \\sqrt{6} + \\frac{5}{2} \\\\\n",
"1 & 1 & 1 & 1 & -4 \\, \\sqrt{6} + 10 \\\\\n",
"1 & -1 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 1 & -1 & 0 \\\\\n",
"-\\frac{1}{2} \\, \\sqrt{2} & -\\frac{1}{2} \\, \\sqrt{2} & \\frac{1}{2} \\, \\sqrt{2} & \\frac{1}{2} \\, \\sqrt{2} & 0\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ -1/2 -1/2 -1/2 -1/2 sqrt(6) + 5/2]\n",
"[ 1 1 1 1 -4*sqrt(6) + 10]\n",
"[ 1 -1 0 0 0]\n",
"[ 0 0 1 -1 0]\n",
"[ -1/2*sqrt(2) -1/2*sqrt(2) 1/2*sqrt(2) 1/2*sqrt(2) 0]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"W = matrix([\n",
" [-1/2, -1/2, -1/2, -1/2, 5/2+sqrt(6)],\n",
" [1, 1, 1, 1, 10-4*sqrt(6)],\n",
" [1, -1, 0, 0, 0],\n",
" [0, 0, 1, -1, 0],\n",
" [-1/sqrt(2), -1/sqrt(2), 1/sqrt(2), 1/sqrt(2), 0]\n",
"])\n",
"show(W)"
]
},
{
"cell_type": "code",
2021-07-15 10:50:33 -07:00
"execution_count": 60,
2021-06-01 17:37:27 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrr}\n",
"0 & -\\frac{1}{2} & 0 & 0 & 0 \\\\\n",
"-\\frac{1}{2} & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrr}\n",
"0 & -\\frac{1}{2} & 0 & 0 & 0 \\\\\n",
"-\\frac{1}{2} & 0 & 0 & 0 & 0 \\\\\n",
"0 & 0 & 1 & 0 & 0 \\\\\n",
"0 & 0 & 0 & 1 & 0 \\\\\n",
"0 & 0 & 0 & 0 & 1\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ 0 -1/2 0 0 0]\n",
"[-1/2 0 0 0 0]\n",
"[ 0 0 1 0 0]\n",
"[ 0 0 0 1 0]\n",
"[ 0 0 0 0 1]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"P = matrix([\n",
" [0, -1/2, 0, 0, 0],\n",
" [-1/2, 0, 0, 0, 0],\n",
" [0, 0, 1, 0, 0],\n",
" [0, 0, 0, 1, 0],\n",
" [0, 0, 0, 0, 1]\n",
"])\n",
"show(P)"
]
},
{
"cell_type": "code",
2021-07-15 10:50:33 -07:00
"execution_count": 61,
2021-06-01 17:37:27 -07:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrr}\n",
"2 & 0 & 0 & 0 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"0 & 2 & 0 & 0 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"0 & 0 & 2 & 0 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"0 & 0 & 0 & 2 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"-\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & {\\left(2 \\, \\sqrt{6} + 5\\right)} {\\left(2 \\, \\sqrt{6} - 5\\right)}\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrr}\n",
"2 & 0 & 0 & 0 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"0 & 2 & 0 & 0 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"0 & 0 & 2 & 0 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"0 & 0 & 0 & 2 & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} \\\\\n",
"-\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & -\\frac{3}{2} \\, \\sqrt{6} + \\frac{5}{4} & {\\left(2 \\, \\sqrt{6} + 5\\right)} {\\left(2 \\, \\sqrt{6} - 5\\right)}\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ 2 0 0 0 -3/2*sqrt(6) + 5/4]\n",
"[ 0 2 0 0 -3/2*sqrt(6) + 5/4]\n",
"[ 0 0 2 0 -3/2*sqrt(6) + 5/4]\n",
"[ 0 0 0 2 -3/2*sqrt(6) + 5/4]\n",
"[ -3/2*sqrt(6) + 5/4 -3/2*sqrt(6) + 5/4 -3/2*sqrt(6) + 5/4 -3/2*sqrt(6) + 5/4 (2*sqrt(6) + 5)*(2*sqrt(6) - 5)]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show(W.transpose() * P * W)"
]
},
{
"cell_type": "code",
2021-07-15 10:50:33 -07:00
"execution_count": 62,
2021-06-01 17:37:27 -07:00
"metadata": {},
"outputs": [
{
2021-07-15 10:50:33 -07:00
"data": {
"text/html": [
"<html><script type=\"math/tex; mode=display\">\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrrrrrrrrrr}\n",
"1 & -1 & -1 & -3 & -1 & -3 & -3 & -5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 \\\\\n",
"-1 & 1 & -3 & -1 & -3 & -1 & -5 & -3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 \\\\\n",
"-1 & -3 & 1 & -1 & -3 & -5 & -1 & -3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 \\\\\n",
"-3 & -1 & -1 & 1 & -5 & -3 & -3 & -1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 \\\\\n",
"-1 & -3 & -3 & -5 & 1 & -1 & -1 & -3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 \\\\\n",
"-3 & -1 & -5 & -3 & -1 & 1 & -3 & -1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 \\\\\n",
"-3 & -5 & -1 & -3 & -1 & -3 & 1 & -1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 \\\\\n",
"-5 & -3 & -3 & -1 & -3 & -1 & -1 & 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & 1 & -1 & -1 & -3 & -1 & -3 & -3 & -5 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -1 & 1 & -3 & -1 & -3 & -1 & -5 & -3 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -1 & -3 & 1 & -1 & -3 & -5 & -1 & -3 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -3 & -1 & -1 & 1 & -5 & -3 & -3 & -1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -1 & -3 & -3 & -5 & 1 & -1 & -1 & -3 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -3 & -1 & -5 & -3 & -1 & 1 & -3 & -1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -3 & -5 & -1 & -3 & -1 & -3 & 1 & -1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -5 & -3 & -3 & -1 & -3 & -1 & -1 & 1\n",
"\\end{array}\\right)</script></html>"
],
"text/latex": [
"$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrrrrrrrrrrrrrr}\n",
"1 & -1 & -1 & -3 & -1 & -3 & -3 & -5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 \\\\\n",
"-1 & 1 & -3 & -1 & -3 & -1 & -5 & -3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 \\\\\n",
"-1 & -3 & 1 & -1 & -3 & -5 & -1 & -3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 \\\\\n",
"-3 & -1 & -1 & 1 & -5 & -3 & -3 & -1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 \\\\\n",
"-1 & -3 & -3 & -5 & 1 & -1 & -1 & -3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 \\\\\n",
"-3 & -1 & -5 & -3 & -1 & 1 & -3 & -1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 \\\\\n",
"-3 & -5 & -1 & -3 & -1 & -3 & 1 & -1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 \\\\\n",
"-5 & -3 & -3 & -1 & -3 & -1 & -1 & 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & 1 & -1 & -1 & -3 & -1 & -3 & -3 & -5 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -1 & 1 & -3 & -1 & -3 & -1 & -5 & -3 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -1 & -3 & 1 & -1 & -3 & -5 & -1 & -3 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -3 & -1 & -1 & 1 & -5 & -3 & -3 & -1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -1 & -3 & -3 & -5 & 1 & -1 & -1 & -3 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -3 & -1 & -5 & -3 & -1 & 1 & -3 & -1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -3 & -5 & -1 & -3 & -1 & -3 & 1 & -1 \\\\\n",
"-\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 5 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 3 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} - 1 & -\\sqrt{3} - \\frac{1}{\\sqrt{3} + 2} + 1 & -5 & -3 & -3 & -1 & -3 & -1 & -1 & 1\n",
"\\end{array}\\right)$$"
],
"text/plain": [
"[ 1 -1 -1 -3 -1 -3 -3 -5 -sqrt(3) - 1/(sqrt(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) +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sqrt(3) - 1/(sqrt(3) + 2) - 5 -sqrt(3) - 1/(sqrt(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3]\n",
"[ -3 -1 -5 -3 -1 1 -3 -1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 5 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1]\n",
"[ -3 -5 -1 -3 -1 -3 1 -1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 5 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1]\n",
"[ -5 -3 -3 -1 -3 -1 -1 1 -sqrt(3) - 1/(sqrt(3) + 2) - 5 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) + 1]\n",
"[-sqrt(3) - 1/(sqrt(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt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(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -1 -3 -3 -5 1 -1 -1 -3]\n",
"[-sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 5 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -3 -1 -5 -3 -1 1 -3 -1]\n",
"[-sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 5 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) + 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -3 -5 -1 -3 -1 -3 1 -1]\n",
"[-sqrt(3) - 1/(sqrt(3) + 2) - 5 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 3 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) - 1 -sqrt(3) - 1/(sqrt(3) + 2) + 1 -5 -3 -3 -1 -3 -1 -1 1]"
]
},
"metadata": {},
"output_type": "display_data"
2021-06-01 17:37:27 -07:00
}
],
"source": [
"bt = 2 * (2 + sqrt(3))\n",
"b = 1 / (2 + sqrt(3))\n",
"\n",
"W = matrix([\n",
" [2, 2, 2, 2, 2, 2, 2, 2, bt, bt, bt, bt, bt, bt, bt, bt],\n",
" [1, 1, 1, 1, 1, 1, 1, 1, b, b, b, b, b, b, b, b],\n",
" [1, 1, 1, 1, -1, -1, -1, -1] * 2,\n",
" [1, 1, -1, -1, 1, 1, -1, -1] * 2,\n",
" [1, -1, 1, -1, 1, -1, 1, -1] * 2\n",
"])\n",
"\n",
"show(W.transpose() * P * W)"
]
2021-03-05 18:47:48 -08:00
}
],
"metadata": {
"kernelspec": {
2021-05-24 10:56:59 -07:00
"display_name": "SageMath 9.3",
2021-03-05 18:47:48 -08:00
"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",
2021-07-15 10:50:33 -07:00
"version": "3.9.6"
2021-03-29 17:16:35 -07:00
},
"name": "Apollonian Circle Packings.ipynb"
2021-03-05 18:47:48 -08:00
},
"nbformat": 4,
"nbformat_minor": 4
}