|
50 | 50 | },
|
51 | 51 | {
|
52 | 52 | "cell_type": "code",
|
53 |
| - "execution_count": 1, |
| 53 | + "execution_count": 2, |
54 | 54 | "id": "24d69d5e",
|
55 | 55 | "metadata": {},
|
56 | 56 | "outputs": [],
|
|
72 | 72 | "metadata": {},
|
73 | 73 | "source": [
|
74 | 74 | "A *combinatorial complex*, CCC, combines features of both hypergraphs and of cell complexes $[1]$. A hypergraph is a generalisation of a graph in which a single edge is not limited to joining just two vertices like in an ordinary graph, but can actually join multiple vertices together. A cell complex is a mathematical structure that is built up from simple building blocks called cells. These cells can be thought of as generalized versions of familiar shapes, such as points, line segments, triangles, and disks. By gluing these cells together in a prescribed way, one can create complex geometrical objects that are of interest in topology and geometry. We can use cell complex very well to model all sorts of classical topological spaces, in particular many physical spaces.\n",
|
75 |
| - "Importantly, cellular complexes naturally provide a notion of hierarchical organisation: boundary elements are related to their \"interior\", yet the interior can itself be the boundary of a higher-order object. Hierarchical relations between the boundary and the interior are often essential when describing physical quantities. In cellular complexes, this type of coupling is however only mediated via cells of adjacent dimension (the boundary of a boundary is zero; a d-2 dimensinonal object has zero measure for integration in a d-dimensional space) -- this does not imply that multi-body interactions between nodes may not be encoded, yet, this aspect is arguably not the strong suit of cellular complexes.\n", |
| 75 | + "Importantly, cellular complexes naturally provide a notion of hierarchical organisation: boundary elements are related to their \"interior\", yet the interior can itself be the boundary of a higher-order object. Hierarchical relations between the boundary and the interior are often essential when describing physical quantities. In cellular complexes, this type of coupling is however only mediated via cells of adjacent dimension (the boundary of a boundary is zero; a d-2 dimensional object has zero measure for integration in a d-dimensional space) -- this does not imply that multi-body interactions between nodes may not be encoded, yet, this aspect is arguably not the strong suit of cellular complexes.\n", |
76 | 76 | "\n",
|
77 | 77 | "\n",
|
78 | 78 | "\n",
|
|
94 | 94 | "id": "cff96cdf",
|
95 | 95 | "metadata": {},
|
96 | 96 | "source": [
|
97 |
| - "$[1]$ Let S be a non-empty finite set and $\\mathcal{P}(S)$ its power set. A combinatorial complex (CCC) is a tuple $(X, \\imath)$ formed by a set $X \\subset \\mathcal{P}(S)$ \\ ${\\emptyset}$ together with a rank function $\\imath : X \\rightarrow \\mathbb{Z}^+$\n", |
| 97 | + "$[1]$ Let $S$ be a non-empty finite set and $\\mathcal{P}(S)$ be its power set. A combinatorial complex (CCC) is a tuple $(X, \\imath)$ formed by a set $X \\subset \\mathcal{P}(S)$ \\ ${\\emptyset}$ together with a rank function $\\imath : X \\rightarrow \\mathbb{Z}^+$\n", |
98 | 98 | "that \n",
|
99 | 99 | "\n",
|
100 | 100 | "  (i) $\\imath$({$x$}) $= 0$ for all $x \\in S$, and \n",
|
|
128 | 128 | "id": "9d28c791",
|
129 | 129 | "metadata": {},
|
130 | 130 | "source": [
|
131 |
| - "This is an example of a combinatorial complex (CCC), this example has six cells of rank 0, three cells of rank 1 and two cells of rank 2. As we can see this is different to a cell comples (CC) as cells of rank 2 can contain cells of rank 0 without needing cells of rank 0 also. \n", |
| 131 | + "This is an example of a combinatorial complex (CCC), this example has six cells of rank 0, three cells of rank 1 and two cells of rank 2. As we can see this is different to a cell complexes (CC) as cells of rank 2 can contain cells of rank 0 without needing cells of rank 0 also. \n", |
132 | 132 | "\n",
|
133 | 133 | "To express this example as code we may use the `add_cell` function. Examples of this can be seen below."
|
134 | 134 | ]
|
135 | 135 | },
|
136 | 136 | {
|
137 | 137 | "cell_type": "code",
|
138 |
| - "execution_count": 2, |
| 138 | + "execution_count": 3, |
139 | 139 | "id": "0ce2f1f7",
|
140 | 140 | "metadata": {},
|
141 | 141 | "outputs": [
|
142 | 142 | {
|
143 | 143 | "name": "stdout",
|
144 | 144 | "output_type": "stream",
|
145 | 145 | "text": [
|
146 |
| - "Combinatorial Complex with 2 nodes and cells with ranks [0, 1] and sizes [2, 1] \n", |
147 |
| - "Combinatorial Complex with 3 nodes and cells with ranks [0, 1] and sizes [3, 2] \n", |
148 |
| - "Combinatorial Complex with 4 nodes and cells with ranks [0, 1, 2] and sizes [4, 2, 1] \n", |
149 |
| - "Combinatorial Complex with 5 nodes and cells with ranks [0, 1, 2] and sizes [5, 3, 1] \n", |
150 |
| - "Combinatorial Complex with 6 nodes and cells with ranks [0, 1, 2] and sizes [6, 3, 2] \n" |
| 146 | + "Combinatorial Complex with 2 nodes and cells with ranks [0, 1] and sizes (2, 1) \n", |
| 147 | + "Combinatorial Complex with 3 nodes and cells with ranks [0, 1] and sizes (3, 2) \n", |
| 148 | + "Combinatorial Complex with 4 nodes and cells with ranks [0, 1, 2] and sizes (4, 2, 1) \n", |
| 149 | + "Combinatorial Complex with 5 nodes and cells with ranks [0, 1, 2] and sizes (5, 3, 1) \n", |
| 150 | + "Combinatorial Complex with 6 nodes and cells with ranks [0, 1, 2] and sizes (6, 3, 2) \n" |
151 | 151 | ]
|
152 | 152 | }
|
153 | 153 | ],
|
|
177 | 177 | "source": [
|
178 | 178 | "The output of this code clearly demonstrates how the CCC builds up. The first line of the output comes from adding the 1-cell $[1,2]$. This 1-cell is made up of two 0-cells - therefor the output says we have cells with ranks $[0,1]$ and these cells have sizes $[2,1]$. Sizes refers to the number of cells with that rank, so after our first line of input we have two 0-cells and one 1-cell.\n",
|
179 | 179 | "\n",
|
180 |
| - "Each futher line of input is adding another cell of varying rank. Finally, the last line of output is telling us that we have cells of rank 0, 1 and 2 and that they respectively have sizes of 6, 3 and 2. This is such that we have six 0-cells, three 1-cells and two 2-cells, just like our example figure does." |
| 180 | + "Each further line of input is adding another cell of varying rank. Finally, the last line of output is telling us that we have cells of rank 0, 1 and 2 and that they respectively have sizes of 6, 3 and 2. This is such that we have six 0-cells, three 1-cells and two 2-cells, just like our example figure does." |
181 | 181 | ]
|
182 | 182 | },
|
183 | 183 | {
|
|
198 | 198 | },
|
199 | 199 | {
|
200 | 200 | "cell_type": "code",
|
201 |
| - "execution_count": 3, |
| 201 | + "execution_count": 4, |
202 | 202 | "id": "43f9b5f6",
|
203 | 203 | "metadata": {},
|
204 | 204 | "outputs": [
|
|
207 | 207 | "output_type": "stream",
|
208 | 208 | "text": [
|
209 | 209 | "rank 0:\n",
|
210 |
| - "OrderedDict([(frozenset({1}), 0), (frozenset({2}), 1), (frozenset({3}), 2), (frozenset({4}), 3), (frozenset({5}), 4), (frozenset({6}), 5)])\n", |
| 210 | + "OrderedDict({frozenset({1}): 0, frozenset({2}): 1, frozenset({3}): 2, frozenset({4}): 3, frozenset({5}): 4, frozenset({6}): 5})\n", |
211 | 211 | "rank 1:\n",
|
212 |
| - "OrderedDict([(frozenset({1, 2}), 0), (frozenset({1, 3}), 1), (frozenset({2, 5}), 2)])\n", |
| 212 | + "OrderedDict({frozenset({1, 2}): 0, frozenset({1, 3}): 1, frozenset({2, 5}): 2})\n", |
213 | 213 | "rank 2:\n",
|
214 |
| - "OrderedDict([(frozenset({1, 2, 3, 4}), 0), (frozenset({2, 4, 6}), 1)])\n" |
| 214 | + "OrderedDict({frozenset({1, 2, 3, 4}): 0, frozenset({2, 4, 6}): 1})\n" |
215 | 215 | ]
|
216 | 216 | }
|
217 | 217 | ],
|
218 | 218 | "source": [
|
219 |
| - "row, column, B2 = example.incidence_matrix(0, 1, index=True)\n", |
| 219 | + "row, column, B1 = example.incidence_matrix(0, 1, index=True)\n", |
220 | 220 | "row1, column1, B2 = example.incidence_matrix(1, 2, index=True)\n",
|
221 | 221 | "print(\"rank 0:\")\n",
|
222 | 222 | "print(row)\n",
|
|
278 | 278 | },
|
279 | 279 | {
|
280 | 280 | "cell_type": "code",
|
281 |
| - "execution_count": 7, |
| 281 | + "execution_count": 5, |
282 | 282 | "id": "c4348e5b",
|
283 | 283 | "metadata": {},
|
284 | 284 | "outputs": [
|
|
293 | 293 | " [0 1 0 0 0 0]\n",
|
294 | 294 | " [0 0 0 0 0 0]]\n"
|
295 | 295 | ]
|
| 296 | + }, |
| 297 | + { |
| 298 | + "name": "stderr", |
| 299 | + "output_type": "stream", |
| 300 | + "text": [ |
| 301 | + "C:\\Users\\kkgg3\\AppData\\Roaming\\Python\\Python312\\site-packages\\scipy\\sparse\\_index.py:143: SparseEfficiencyWarning: Changing the sparsity structure of a csc_matrix is expensive. lil_matrix is more efficient.\n", |
| 302 | + " self._set_arrayXarray(i, j, x)\n" |
| 303 | + ] |
296 | 304 | }
|
297 | 305 | ],
|
298 | 306 | "source": [
|
|
315 | 323 | "\n",
|
316 | 324 | "Looking at the output, the $0^{th}$ row tells us that the $0^{th}$ 0-cell is adjacent to the $1^{st}$ and $2^{nd}$ 0-cells. That is, {1} is adjacent to {2} and {3} via some 1-cell. By looking at our list of 1-cells it is easy to see that {1,2} and {1,3} are the 1-cells that {1} is adjacent to {2}, {3} via. \n",
|
317 | 325 | "\n",
|
318 |
| - "The $2^{nd}$ row tell us that that $2^{nd}$ 0-cell is adjacent to the $0^{th}$ 0-cell. This is such that {3} is adjacent to {1} via a 1-cell. The rest of the entries in that row are 0, which means {3} is only adjacent via a 1-cell to {1}, this is evident by looking at the diagram of our example." |
| 326 | + "The $2^{nd}$ row tell us that $2^{nd}$ 0-cell is adjacent to the $0^{th}$ 0-cell. This is such that {3} is adjacent to {1} via a 1-cell. The rest of the entries in that row are 0, which means {3} is only adjacent via a 1-cell to {1}, this is evident by looking at the diagram of our example." |
319 | 327 | ]
|
320 | 328 | },
|
321 | 329 | {
|
322 | 330 | "cell_type": "code",
|
323 |
| - "execution_count": 8, |
| 331 | + "execution_count": 6, |
324 | 332 | "id": "2d4b7b29",
|
325 | 333 | "metadata": {},
|
326 | 334 | "outputs": [
|
|
329 | 337 | "output_type": "stream",
|
330 | 338 | "text": [
|
331 | 339 | "[[0 1 1 1 0 0]\n",
|
332 |
| - " [1 0 1 1 0 1]\n", |
| 340 | + " [1 0 1 2 0 1]\n", |
333 | 341 | " [1 1 0 1 0 0]\n",
|
334 |
| - " [1 1 1 0 0 1]\n", |
| 342 | + " [1 2 1 0 0 1]\n", |
335 | 343 | " [0 0 0 0 0 0]\n",
|
336 | 344 | " [0 1 0 1 0 0]]\n"
|
337 | 345 | ]
|
|
362 | 370 | },
|
363 | 371 | {
|
364 | 372 | "cell_type": "code",
|
365 |
| - "execution_count": 9, |
| 373 | + "execution_count": 7, |
366 | 374 | "id": "6c83e931",
|
367 | 375 | "metadata": {},
|
368 | 376 | "outputs": [
|
|
416 | 424 | "id": "5a4a8cc1",
|
417 | 425 | "metadata": {},
|
418 | 426 | "source": [
|
419 |
| - "A *co-adjacency matrix* is a matrix that compares a class of objects to them selves, by seeing if they are coadjacent via some cell of a lower rank. \n", |
| 427 | + "A *co-adjacency matrix* is a matrix that compares a class of objects to themselves, by seeing if they are coadjacent via some cell of a lower rank. \n", |
420 | 428 | "\n",
|
421 | 429 | "That is, do the two cells in the class being compared, both fully contain the same member of a lower class? Below is two examples that might make this concept clearer."
|
422 | 430 | ]
|
|
456 | 464 | },
|
457 | 465 | {
|
458 | 466 | "cell_type": "code",
|
459 |
| - "execution_count": 11, |
| 467 | + "execution_count": 8, |
460 | 468 | "id": "0a8ba26c",
|
461 | 469 | "metadata": {},
|
462 | 470 | "outputs": [
|
|
493 | 501 | },
|
494 | 502 | {
|
495 | 503 | "cell_type": "code",
|
496 |
| - "execution_count": 12, |
| 504 | + "execution_count": 9, |
497 | 505 | "id": "c28c6c59",
|
498 | 506 | "metadata": {},
|
499 | 507 | "outputs": [
|
500 | 508 | {
|
501 | 509 | "name": "stdout",
|
502 | 510 | "output_type": "stream",
|
503 | 511 | "text": [
|
504 |
| - "[[0 1]\n", |
505 |
| - " [1 0]]\n" |
| 512 | + "[[0 2]\n", |
| 513 | + " [2 0]]\n" |
506 | 514 | ]
|
507 | 515 | }
|
508 | 516 | ],
|
|
531 | 539 | },
|
532 | 540 | {
|
533 | 541 | "cell_type": "code",
|
534 |
| - "execution_count": 15, |
| 542 | + "execution_count": 10, |
535 | 543 | "id": "059ba518",
|
536 | 544 | "metadata": {},
|
537 | 545 | "outputs": [
|
|
564 | 572 | "\n",
|
565 | 573 | "*rank-2*: 0: {1,2,3,4}, 1: {2,4,6}.\n",
|
566 | 574 | "\n",
|
567 |
| - "Looking at these cells it is clear that both 2-cells do not share any 1-cells, given that {2,4,6} does nto fully contain a 1-cell this is inevitable. " |
| 575 | + "Looking at these cells it is clear that both 2-cells do not share any 1-cells, given that {2,4,6} does not fully contain a 1-cell this is inevitable. " |
568 | 576 | ]
|
569 | 577 | },
|
570 | 578 | {
|
|
600 | 608 | },
|
601 | 609 | {
|
602 | 610 | "cell_type": "code",
|
603 |
| - "execution_count": 16, |
| 611 | + "execution_count": 11, |
604 | 612 | "id": "b0c7d06e",
|
605 | 613 | "metadata": {},
|
606 | 614 | "outputs": [
|
|
644 | 652 | },
|
645 | 653 | {
|
646 | 654 | "cell_type": "code",
|
647 |
| - "execution_count": 17, |
| 655 | + "execution_count": 12, |
648 | 656 | "id": "61ed45e6",
|
649 | 657 | "metadata": {},
|
650 | 658 | "outputs": [
|
|
686 | 694 | },
|
687 | 695 | {
|
688 | 696 | "cell_type": "code",
|
689 |
| - "execution_count": 18, |
| 697 | + "execution_count": 13, |
690 | 698 | "id": "ea0d5a3e",
|
691 | 699 | "metadata": {},
|
692 | 700 | "outputs": [
|
|
765 | 773 | "name": "python",
|
766 | 774 | "nbconvert_exporter": "python",
|
767 | 775 | "pygments_lexer": "ipython3",
|
768 |
| - "version": "3.10.9" |
| 776 | + "version": "3.12.3" |
769 | 777 | },
|
770 | 778 | "vscode": {
|
771 | 779 | "interpreter": {
|
|
0 commit comments