ORIGINAL ARTICLE: Gisela D. Charó, Christophe Letellier, Denisse Sciamarella (2022); Templex: A bridge between homologies and templates for chaotic attractors. Chaos, 32 (8): 083108. DOI: https://doi.org/10.1063/5.0092933
Article Abstract: The theory of homologies introduces cell complexes to provide an algebraic description of spaces up to topological equivalence. Attractors in state space can be studied using Branched Manifold Analysis through Homologies: this strategy constructs a cell complex from a cloud of points in state space and uses homology groups to characterize its topology. The approach, however, does not consider the action of the flow on the cell complex. The procedure is here extended to take this fundamental property into account, as done with templates. The goal is achieved endowing the cell complex with a directed graph that prescribes the flow direction between its highest-dimensional cells. The tandem of cell complex and directed graph, baptized templex, is shown to allow for a sophisticated characterization of chaotic attractors and for an accurate classification of them. The cases of a few well-known chaotic attractors are investigated—namely, the spiral and funnel Rössler attractors, the Lorenz attractor, the Burke and Shaw attractor, and a four-dimensional system. A link is established with their description in terms of templates.
This notebook computes templex properties (homologies, orientability chain, generatex, stripex) from a given generating 2-complex and its associated digraph following definitions in [Charó et al, 2022] Charó, G. D., Letellier, C., & Sciamarella, D. (2022). Templex: A bridge between homologies and templates for chaotic attractors. Chaos: An Interdisciplinary Journal of Nonlinear Science, 32(8), 083108 (https://doi.org/10.1063/5.0092933).

Templexes from Charó et al, 2022

These examples are discussed in the paper introducing the templex. The correspond to the Lorenz 63 attractor, to the Rössler spiral attractor, to the Rössler funnel attractor and to the Burke-Shaw attractor.
LorenzAttractor={{2,7,6,5,0},{5,6,9,8},{6,7,10,9},{8,9,12,11},{9,10,13,12},{2,0,11,12},{12,13,4,2},{2,16,15,14,4},{14,15,18,17},{15,16,19,18},{17,18,21,20},{18,19,22,21},{20,21,2,4},{21,22,0,2}};​​GraphLorenzAttractor={12,13,24,35,46,57,61,78,89,810,911,1012,1113,1214,138,141};​​​​RosslerAttractor={{1,3,2,0},{2,3,6,5,4},{4,5,8,7},{5,6,9,8},{7,8,1,0},{1,8,9,0}};​​GraphRosslerAttractor={12,23,24,35,46,51,61};​​​​Rossler3Attractor={{0,1,3,2},{2,3,5,4},{4,5,9,8,7,6},{6,7,1,0},{7,8,0,1},{8,9,1,0}};​​GraphRossler3Attractor={12,23,34,35,36,41,51,61};​​​​BurkeShaw={{0,4,5,1},{4,6,7,8,5},{8,7,10,11},{7,6,9,10},{11,10,3,2},{10,9,2,3},{13,12,3,2},{13,16,15,14,12},{15,16,19,18},{14,15,18,17},{18,19,0,1},{17,18,1,0}};​​GraphBurkeShaw={12,23,24,35,46,57,67,78,89,810,911,1012,111,121};

Choose templex for properties computation

Below we are choosing the LorenzAttractor as an example.
In[]:=
Poligonos=LorenzAttractor;​​Inputflow=GraphLorenzAttractor;​​tot=Count[Poligonos,x_];​​Graph3D[Inputflow,VertexLabelsTable[i
γ
i
,{i,tot}],VertexLabelStyle->Directive[Black,Italic,10]]
Out[]=

Launch computations involving generating cell complex

These commands follow [Sciamarella & Mindlin, 1999 & 2001].
Organizing cell data for the cell complex: S0 : list of 0 - cells, S1 : list of 1 - cells, S2 : list of 2 - cells with last cell repeating first cell
Datos=Flatten[Poligonos];​​DatosO=Sort[Datos];​​ltedt=Count[Datos,x_];​​For[i=2;S0={DatosO[[1]]},​​i<=ltedt,Increment[i],​​If[MemberQ[S0,DatosO[[i]]],,S0=AppendTo[S0,DatosO[[i]]]]];​​lteS0=Count[S0,x_];​​​​pS2=Poligonos;​​ltepS2=Count[Poligonos,x_];​​​​For[​​i=1;correccion={};S2={},i<=ltepS2,Increment[i],​​If[Count[Poligonos[[i]],x_]>=3,​​correccion=Join[Poligonos[[i]],{Poligonos[[i]][[1]]}];​​S2=AppendTo[S2,correccion]]];​​lteS2=Count[S2,x_];​​​​For[​​i=1;S1={},i<=lteS2,Increment[i],​​For[j=2,j<=Count[S2[[i]],x_],Increment[j],​​par=Sort[{S2[[i]][[j-1]],S2[[i]][[j]]}];​​If[MemberQ[S1,par],,S1=AppendTo[S1,par]]]]​​​​S1=Sort[S1];​​lteS1=Count[S1,x_];
Constructing boundary matrices : bordes1 : matrix with S0 elements as columns and S1 elements as rows, (-1) in the first vertex and (+1) in the second vertex bordes2 : matrix with S2 elements as columns and S1 elements as rows.
For[​​i=1;bordes1={},i<=lteS1,Increment[i],​​fila1=Insert[Insert[Table[0,{lteS0-2}],-1,Position[S0,S1[[i]][[1]]]],1,​​Position[S0,S1[[i]][[2]]]];​​bordes1=AppendTo[bordes1,fila1]]​​​​For[i=1;bordes2={},i<=lteS2,​​Increment[i],​​For[j=2;Instruccion={},j<=Count[S2[[i]],x_],Increment[j],​​par={S2[[i]][[j-1]],S2[[i]][[j]]};​​pospar=Position[S1,Sort[par]][[1]][[1]];​​If[par==Sort[par],sgpar=1,sgpar=-1];​​Instruccion=​​AppendTo[Instruccion,Insert[Table[0,{lteS1-1}],sgpar,pospar]]];​​fila2=Sum[Instruccion[[k]],{k,1,Count[Instruccion,x_]}];​​bordes2=AppendTo[bordes2,fila2]]
Summing all boundaries of 2 - cells in a single 1 - chain called “sumabordes2” & looking fo the coefficient with higher absolute value “eldemayormodulo”. If this coefficient is greater than one, information for the torsion group is computed and saved .
prueba="si";​​calculoprevio="";calculotorsion="";torsiongroup="";coeftesnonulos={};​​​​If[prueba=="si",​​​​sumabordes2=Sum[bordes2[[i]],{i,Count[bordes2,x_]}];​​eldemayormodulo=Abs[sumabordes2[[1]]];​​If[eldemayormodulo>0,AppendTo[coeftesnonulos,Abs[sumabordes2[[1]]]]];​​​​For[r=2,r<=Count[sumabordes2,x_],Increment[r],​​​​If[Abs[sumabordes2[[r]]]>0,AppendTo[coeftesnonulos,Abs[sumabordes2[[r]]]]]​​;​​​​If[Abs[sumabordes2[[r]]]>eldemayormodulo,​​eldemayormodulo=Abs[sumabordes2[[r]]]]];​​​​escribirciclosnulos="";escribirgeneradortorsion=" ";O1={};​​​​If[​​eldemayormodulo>1,​​​​​​columnas=Count[sumabordes2,x_];​​For[n=1;​​,​​n<=columnas,Increment[n],​​discriminante=sumabordes2[[n]];​​simplices=S1[[n]];(*"simplices"containsthe1-celland"discriminante"itssigninsumabordes2*)​​p=discriminante/eldemayormodulo;​​​​If[IntegerQ[p],,torsiongroup=""];​​​​If[discriminante≠0,AppendTo[O1,simplices]];​​If[discriminante==0,,​​If[discriminante>0,​​calculoprevio=​​StringJoin[calculoprevio,​​StringJoin["+",ToString[discriminante],ToString[simplices]]];​​calculotorsion=​​StringJoin[calculotorsion,​​StringJoin["+",ToString[simplices]]];​​,​​calculoprevio=​​StringJoin[calculoprevio,​​StringJoin[ToString[discriminante],ToString[simplices]]];​​calculotorsion=​​StringJoin[calculotorsion,​​StringJoin["+",ToString[Reverse[simplices]]]];​​]​​];​​​​If[n==columnas,calculoprevio=StringJoin[calculoprevio," "]]];​​If[n==columnas,calculotorsion=StringJoin[calculotorsion," "]]];​​escribirciclosnulos=​​StringJoin[escribirciclosnulos,calculoprevio," "];​​escribirgeneradortorsion=​​StringJoin[escribirgeneradortorsion,calculotorsion," "];​​]
Computing H2 and H1
Z2 is the nullspace of the transpose of bordes2 and it equals H2
Z1 the nullspace of the transpose of bordes1
B1 is given by the linearly independent rows of bordes2
X1 solves Z1 X1 == B1
FACTOR1 saves the multiples of X1 in terms of its row - reduced form XR1
H1comp saves the cycles that are trivial
H1 contains only the cycles not stored in H1comp
Computing H0
Z0 is the identity matrix of v0
B0 is given by the linearly independent rows of bordes1
X0 solves Z0 X0 == B0
H0comp saves the cycles that are trivial
H0 contains only the cycles not stored in H0comp
Formatting Hk and torsion groups results to be screen - printed outputting generators

Launch templex computations (involving generating complex and digraph)

These commands follow [Charó et al, 2022] and Sciamarella, D. & Charó, G. D. in: Topological Methods for Delay and Ordinary Differential Equations with Applications to Continuum Mechanics, Advances in Continuum Mechanics, Springer, to appear.
Computation of JOINING NODES
Computation of JOINING SUBGRAPH, Ingoing and Outgoing cells, Reoriented Joining Chain and Splitting 0 - cells
Computation of GENERATEX AND STRIPEX SETS

CITE THIS NOTEBOOK

Templex: A bridge between homologies and templates for chaotic attractors​
by Denisse Sciamarella​
Wolfram Community, STAFF PICKS, December 7, 2023
​https://community.wolfram.com/groups/-/m/t/3079776