Abstract
We introduce a novel computational methodology for indexing the Euler characteristics of \(\:N\)-dimensional objects by overlaying (\(\:N\)+1)-dimensional chiral vector fields. Analogous to how the skyrmion number characterizes a two-dimensional magnetic skyrmion through the integration of the solid angle of its spin field, we generalize this principle to arbitrary dimensions. By iteratively applying a simple numerical process, we generate (\(\:N\)+1)-dimensional chiral vector fields on \(\:N\)-dimensional objects. The Euler characteristics of these objects are calculated by aggregating the local solid angles subtended by neighboring chiral vectors. In this study, we focus on verifying our method in two and three dimensions. For dimensions higher than three, we conduct preliminary experiments on simple objects to explore potential applicability. Although our method shows promising potential in higher dimensions, further investigation is required to fully understand its applicability beyond three dimensions.
Similar content being viewed by others
Introduction
Topology, a fundamental branch of mathematics, is indispensable in various research fields for analyzing the intrinsic geometrical properties within diverse types of data1,2. It examines the relationships among geometric entities such as points, lines, and surfaces, focusing on how these elements remain interconnected and maintain their structural integrity under continuous deformations. Investigating topological invariants, properties that remain unchanged despite such transformations are essential for understanding the underlying topological characteristics of complex geometrical objects in scientific investigations and data analysis3,4,5,6,7. Among these invariants, Euler characteristics provide key numerical values that describe the topology of an object, including features like the number of holes or connected components.
The Euler characteristic (Euler number) is a primary example of a topological number used to describe the fundamental properties of shapes by abstracting their geometric structures into points, lines, and surfaces. However, calculating the Euler characteristic for complex shapes can be challenging and often requires specialized computational methods. To derive the Euler characteristics from both two- and three-dimensional objects, various algorithms have been developed, such as the border following algorithm8, perimeter-based algorithm9, labeling-based algorithm10, and voxel-pattern-based algorithm11,12.
Meanwhile, a recent study proposed a novel computational method that accurately identifies the Euler characteristics of objects from two-dimensional images using the concepts of magnetic skyrmion and skyrmion number13. A Magnetic skyrmion, a chiral spin structure exhibiting hedgehog or vortex-like textures, has unique topological properties that have been widely studied in two-dimensional magnetic systems14,15,16,17,18. This structure is characterized by a topological index called the skyrmion number. In the previous study13, gray-scale images were transformed into chiral spin structures using a machine learning model and skyrmion numbers were calculated to assign Euler characteristics to each image. The chiral field approach counting skyrmion numbers not only provides the correct Euler characteristics but also offers advantages over existing methods which often misinterpret a single noise pixel as an additional topological object and are therefore vulnerable to noise or artifacts in the image. It demonstrated the advantages of the chiral field approach, although it relies on neural networks trained with datasets obtained from physics simulation models and its application is limited to two-dimensional pixelated images.
In this study, we introduce a computational methodology for indexing the Euler characteristics of \(\:N\)-dimensional objects by generalizing the skyrmion number calculation for arbitrary dimensions. The skyrmion number is calculated by aggregating the local solid angles subtended by neighboring vectors in given area. We extend this principle to compute Euler characteristics for vector fields in arbitrary dimensions by generating (\(\:N\)+1)-dimensional chiral vector fields on \(\:N\)-dimensional objects through an iterative numerical process. Through detailed analysis of the computational results for various objects, we reveal the results efficiently calculate the Euler characteristics which are generally employed to discuss topological properties within the range of computational precision.
Strategies
To clearly demonstrate our methods, we first conceptualize an (\(\:N\)+1)-dimensional normalized vector \(\:\tilde S=\left(\overrightarrow{V},\:f\right)\), where the \(\:\overrightarrow{V}\) denotes the \(\:N\)-components corresponding to the spatial dimensions, i.e. \(\:\overrightarrow{V}=\left({S}_{1},{S}_{2},\dots\:,{S}_{N}\right)\), and \(\:f\) is the (\(\:N\)+1)-th component orthogonal to this space. For example, in the classical Heisenberg spin model represented in a two-dimensional system(\(\:x\text{y}\) plane), each Heisenberg spin \(\:\varvec{S}\) is considered as a three(2+1)-dimensional normalized vector with components \(\:\overrightarrow{V}=\left({S}_{x},\:{S}_{y}\right)\) and \(\:f={S}_{z}.\:\)We use both tilde(\(\:\tilde S\)) and arrow vector(\(\:\overrightarrow{V}\)) notations to clearly distinguish between \(\:\tilde S\) and \(\:\overrightarrow{V}\) in our discussion.
To achieve our goal for developing a computational methodology for indexing the Euler characteristics of \(\:N\)-dimensional objects, we extend the formalism of the skyrmion number which is commonly represented by the classical Heisenberg spin \(\:\varvec{S}\) in a two-dimensional system. The skyrmion number Q is given by: \(\:Q=\frac{1}{4\pi\:}\int\:\varvec{S}\cdot\:\left(\frac{\partial\:\varvec{S}}{\partial\:x}\times\:\frac{\partial\:\varvec{S}}{\partial\:y}\right)dxdy\). Through a series of mathematical steps, \(\:Q\) can be reformulated as \(\:Q=\frac{1}{4\pi\:}\int\:\text{sin}\theta\:\left(\frac{\partial\:\theta\:}{\partial\:x}\frac{\partial\:\varphi\:}{\partial\:y}-\frac{\partial\:\theta\:}{\partial\:y}\frac{\partial\:\varphi\:}{\partial\:x}\right)dxdy=\frac{1}{4\pi\:}\int\:\text{sin}\theta\:\:\text{J}\:dxdy=\frac{1}{{A}_{2}}\int\:\varDelta\:{\Omega\:}\:{d}^{2}r\), where \(\:\theta\:\) and \(\:\varphi\:\) are the angles defining \(\:\varvec{S}=\left(\text{cos}\varphi\:\text{sin}\theta\:,\text{sin}\varphi\:\text{sin}\theta\:,\text{cos}\theta\:\right)\) and \(\:\text{J}\) is the determinant of the Jacobian matrix for the change of variable from \(\:(x,y)\) to (\(\:\theta\:,\varphi\:\)), that is \(\:d\theta\:d\varphi\:=\text{J}\text{}dxdy\). Here \(\:{A}_{2}\) is the surface area of the unit \(\:2\)-sphere, {\(\:\varvec{S}\in\:{\mathbb{R}}^{2+1}\::\:\left\|\varvec{S}\right\|=1\)}, and the \(\:{d}^{2}r\) denotes the volume element of two-dimensional space representing the target systems or object. The \(\:\varDelta\:{\Omega\:}\) is the solid angle density, which is the spatial distribution of local solid angles subtended by neighboring spin \(\:\varvec{S}\). Notably, there is no cross product in the reformulated \(\:Q\) form. It only requires a vector field to calculate the solid angle and a space to represent it. This reformation facilitates the extension of the skyrmion number concept to arbitrary dimensions. Therefore, based on the generalized formalism of the skyrmion number, we define a topological number \(\:n=\frac{1}{{A}_{N}}\int\:\varDelta\:{\Omega\:}\:{d}^{N}r\:\) which is higher-dimensional generalization of the Euler characteristic. This is defined with (\(\:N\)+1)-dimensional normalized chiral vectors (\(\:\tilde S\)) represented in an \(\:N\)-dimensional space.
Generating a chiral vector field from an object and computing its Euler characteristic. (a–c) Illustrations of (a) a given example object, (b) an initial \(\:\tilde S\) configuration, and (c) a generated chiral \(\:\tilde S\) configuration. (d) A chiral vector mapped onto a shared origin. The vertices of cones in (b-d) indicate the direction of vectors. (e,f) Schematic representations of the partitioning simplexes from (e) a square in two-dimensional space and (f) a cube in three-dimensional space. (g) A hypercube in four dimensions. The \(\:{\tilde S}_{i}s\) shown in (e,f) denote the \(\:\tilde S\)s located at the vertices of a single simplex for each dimensional case, where the \(\:i\) denote the sequence of vertices connected to form a simplex. Blender version 3.6 was used to generate the 3D representations in (b–d).
We devise a straightforward method to implement (\(\:N\)+1)-dimensional normalized chiral vector fields onto \(\:N\)-dimensional objects. Figure 1a-c schematically illustrates how the method progresses for the case of \(\:N=\:\)2, though the concept applies to other dimensions as well. Suppose there is an \(\:N\)-dimensional object such as the disk shown in Fig. 1a. A vector configuration composed of \(\:\tilde S\)s is initialized as shown in Fig. 1b. The \(\:f\) value is set as \(\:+1\) to indicate the interior of the object, with the opposite value indicating the exterior of the object; since \(\:\tilde S\)s are unit vectors, all components in the \(\:\overrightarrow{V}\) are initially set to zero. Then, we iterate a simple numerical process to evolve the initial \(\:\tilde S\)s into a chiral structure shown in Fig. 1c. The fundamental mechanism underlying the formation of chiral vector fields in two-dimensional magnetic systems is the competition between isotropic and anisotropic exchange interaction terms19,20. This mechanism is adopted to develop our simple numerical process. Specifically, we introduce a vector field \(\tilde B\) which can be considered as a conceptual effective field applied on \(\:\tilde S\), as shown in Eqs. (1),
where \(\:\left(\overrightarrow{\nabla\:}\cdot\:\overrightarrow{\nabla\:}\right)\) is the Laplacian operator, \(\:\overrightarrow{\nabla\:\:}\)is the gradient operator, and α and β are constants controlling the strength of the anisotropic interactions. The terms \(\:(\overrightarrow{\nabla\:}\cdot\:\overrightarrow{\nabla\:})\overrightarrow{V}\) and\(\:\:(\overrightarrow{\nabla\:}\cdot\:\overrightarrow{\nabla\:})f\) originate from the isotropic exchange interaction, whereas \(\:-\alpha\:\overrightarrow{\nabla\:}f\) and \(\:\beta\:\nabla\:\cdot\:\overrightarrow{V}\) arise from the anisotropic interaction. On discretized spatial grids, the spatial derivatives can be approximated by first- and second-order central finite differences. For each iteration of our process, the direction of \(\:\tilde S\) is gradually updated to minimize \(\:-\tilde S\cdot\:\tilde B\). while maintaining the normalization condition ∥\(\:\tilde S\)∥=1. This is achieved by iteratively adjusting \(\:\tilde S\) to align with the effective field \(\:\tilde B\) through the update rule: \(\:{\tilde S}_{new}=\frac{\tilde S+\delta\:t\tilde B}{\left\|\tilde S+\delta\:t\tilde B\right\|}\), where \(\:\delta\:t\) is a small-time step ensuring numerical stability. Multiple iterations are conducted until the \(\:\tilde S\) vectors form a chiral vector field, as shown in Fig. 1c; the \(\:f\) values gradually change from the interior to the exterior of the object, and the \(\:\overrightarrow{V}\)s form a chiral configuration at the boundary between them. Figure 1d depicts the chiral configuration as shown in Fig. 1c mapped onto the sphere.
This chiral vector field is used to compute the local solid angle density \(\:\varDelta\:{\Omega\:}\). Practically, the chiral vector field is arranged on an \(\:N\)-dimensional hypercube grid, where each \(\:\tilde S\) is located at a vertex of a grid cell. For each grid cell, the \(\:\varDelta\:{\Omega\:}\) value is obtained by summing the solid angles subtended by neighboring \(\:\tilde S\) vectors within the grid cell. Specifically, an \(\:N\)-dimensional hypercube grid cell, simply called an \(\:N\)-cube, is divided into \(\:N\)! simplexes21. A simplex is defined by sequentially connecting a set of \(\:N\)+1 vertices, starting at one corner of a cell and extending to the farthest corner. We estimate the solid angle for each simplex by calculating \(\:\frac{1}{N!}\text{d}\text{e}\text{t}\left[{\tilde S}_{1},{\tilde S}_{2},\dots\:,{\tilde S}_{N+1}\right]\), where det is the determinant (\(\:N\)+1)\(\:\:\times\:\) (\(\:N\)+1) of matrix composed of \(\:\tilde S\) vectors and each \(\:{\tilde S}_{i}\) represents an (\(\:N\)+1)-dimensional vector located at \(\:i\)-th vertex of a simplex. Then, the \(\:\varDelta\:{\Omega\:}\) value for an \(\:N\)-cube is then obtained by summing the solid angles calculated from all the \(\:N\)! simplexes.
For example, the \(\:N\)-cubes and their simplexes for the cases of \(\:N\) = 2 and 3 are shown in Fig. 1e, f. A 2-cube can be divided into two simplexes (triangles) including three \(\:\tilde S\) vectors located at the vertices of each simplex. The solid angle for each simplex is given by \(\:\frac{1}{2!}\text{d}\text{e}\text{t}\:[{\tilde S}_{1},{\tilde S}_{2},{\tilde S}_{3}]\). A 3-cube can be divided into six simplexes (tetrahedra) including four \(\:\tilde S\) vectors, and the solid angle for each simplex is given by \(\:\frac{1}{6!}\text{d}\text{e}\text{t}\:[{\tilde S}_{1},{\tilde S}_{2},{\tilde S}_{3},{\tilde S}_{4}]\). Similarly, we define the simplexes from a 4-cube shown in Fig. 1g and calculate the solid angles. In the low-dimensional cases where the exact formulae of solid angle calculation are known, one can use them instead. For \(\:N=2\) case, the exact formula is \(\:\varDelta\:{\Omega\:}={2\times\:\text{t}\text{a}\text{n}}^{-1}\left(\text{d}\text{e}\text{t}\:[{\tilde S}_{1},{\tilde S}_{2},\:{\tilde S}_{3}]/\left(1+{\tilde S}_{1}\cdot\:{\tilde S}_{2}+{\tilde S}_{2}\cdot\:{\tilde S}_{3}+{\tilde S}_{3}\cdot\:{\tilde S}_{1}\right)\right)\)22, and it is consistent with our estimation when \(\:\tilde S\)vectors change their directions continuously.
After all, the Euler characteristic \(\:n\) is obtained by integrating \(\:\varDelta\:{\Omega\:}\) over the entire hypercube grid, resulting in \(\:n=\frac{\sum\:{\Delta\:}{\Omega\:}}{{A}_{N}}\); in continuum limit, it becomes the definition of \(\:n\) mentioned above, \(\:n=\frac{1}{{A}_{N}}\int\:\varDelta\:{\Omega\:}\:{d}^{N}r\). (See the Supplementary Material for a detailed mathematical derivation and further discussion of this relationship, including a specific example for \(\:N\)=2 on the S² sphere.) This Euler characteristic represents how many times the chiral vectors wrap around \(\:N\)-sphere in the manner of shared origin. In the case of chiral vector configuration shown in Fig. 1c, the vectors cover the entire surface of a 2-sphere once as shown in Fig. 1d, thereby establishing the Euler characteristic \(\:n=1\).
Results and discussion
To validate the effectiveness of our method, we first demonstrate it on several elementary objects represented in two-dimensional space. Figure 2a and b show the simple objects (a disk, an annulus, and a filled square) and the vector fields generated by our method, respectively. Note that, for the cases of the disk and filled square, the vector configurations are oriented outward at the boundary between the outer white regions and the inner black regions. Meanwhile, for the annulus, the vector configurations formed on the two boundaries (one between the outer white regions and the black regions, and the other between the black regions and the inner white regions) are oriented in opposite directions. In other words, our method yields chiral vector configurations that demonstrate continuity and topological distinguishability, both of which are fundamental characteristics of topological structures15,23.
Our method applied on simple two-dimensional objects. (a) A disk, an annulus, and a filled square. (b) Chiral vector fields generated on the simple objects with specific magnified views. The black-white contrast and the red arrows denotes the f and \(\:\overrightarrow{V}\) configurations, respectively. (c) The map of local solid angle density, \(\:\varDelta\:{\Omega\:}\), calculated from the chiral vector fields shown in (b). The values in parentheses indicate the \(\:n\) values calculated from the \(\:\varDelta\:{\Omega\:}\) maps within the range of computational precision, which are also represented as integer numbers by rounding. (d) The chiral vector fields generation on a filled square after 50 iterations for different values of the anisotropic exchange interaction parameters α and β. (e) The computed Euler characteristic values with respect to the vector field evolving iterations. Below, three blue panels highlight the top corner of the filled square in (a) at iterations 5, 10, and 50, respectively. The bottom row presents line-profile plots at these same iteration steps, sampling points along the rightmost pixel.
Figure 2c shows the maps of the local solid angle density, \(\:\varDelta\:{\Omega\:}\), calculated from the vector fields shown in Fig. 2b. For the circular objects, non-zero values of \(\:\varDelta\:{\Omega\:}\) are isotropically located along the boundaries of the objects. In the case of the annulus, the signs of \(\:\varDelta\:{\Omega\:}\) values at the inner and outer boundaries are opposite, reflecting the boundary curvature; a positive (negative) solid angle value correlates with positive (negative) curvature24,25. The \(\:\varDelta\:{\Omega\:}\) values of the filled square object are concentrated at its vertices, indicating that the solid angle contribution from the boundary corresponds to its curvature.
We calculate the Euler characteristics of each simple object using the definition of \(\:n\) shown in the Strategy section. It is confirmed that the \(\:n\) values are nearly integer numbers, within the range of computational precision; \(\:n\approx\:1\), \(\:0\), and 1 for the cases of the disk, the annulus, and the filled square, respectively. Notably the disk and filled square yield identical Euler characteristics, while the annulus does not. In the case of the annulus, the opposing contributions of \(\:\varDelta\:{\Omega\:}\) from its two boundaries cancel out. This distinct outcome underscores the topological difference between the annulus and the disk or square.
We investigated the effect of varying the asymmetric parameters α and β on the final chiral vector fields for the filled square object, as shown in Fig. 2d. Since the role of the parameters is to break symmetry, even when α and β are very small yet non-zero (e.g., 0.0001), a chiral boundary eventually emerges after sufficient iterations. We tested several cases of small positive α, β and checked that all cases compute the same Euler characteristic, indicating any non-zero small value break the chiral symmetry to generate a stable chiral configuration. We chose α = β = 0.1 as a convenient working point for all examples.
We also validate the stability of our method as shown in Fig. 2e. The computed \(\:n\) for each example rapidly saturates and remains consistent as an integer value within just a few iterations. Specifically, the top panel of Fig. 2e displays how \(\:n\) evolves over 50 iterations, confirming that the disk and filled square both converge to \(\:n=1,\) while the annulus remains at \(\:n=0\). Below the plot, three blue panels highlight the top corner of the filled square at iterations 5, 10, and 50, respectively. After a few iterations, the spatial component \(\:\overrightarrow{V}\) begins to emerge, leading to the formation of chiral structures. The graph below presents line-profile plots at these same iteration steps. These plots represent sampling points along the rightmost pixel, as indicated by the green arrow. In each plot, black markers indicate the \(\:f\)component, and red markers show \(\:\left|V\right|\). These profiles demonstrate how \(\:f\) gradually transitions across the boundary while the magnitude of \(\:\left|V\right|\) increases sharply from near zero to its final chiral alignment.
Since our method is based on the concept of the Euler characteristic\(\:n\) it is applicable to objects represented in arbitrary dimensions, including three-dimensional forms. Figure 3 presents the results of applying our method to several three-dimensional objects with various topological properties. As shown in the examples of two-dimensional objects, the \(\:\varDelta\:{\Omega\:}\) values calculated from these three-dimensional objects are concentrated at their surfaces. The magnitude and sign of the \(\:\varDelta\:{\Omega\:}\) values correspond to the Gaussian curvature present at the surfaces24,26.
Demonstration of our method on three-dimensional objects. The objects presented are (a) a ball, (b) a solid cone, (c) a sphere, (d) a solid cup, (e) a solid torus, (f) a solid double torus, (g) a torus (surface), and (h) a double torus (surface). Displayed information from left to right for each object includes a three-dimensional representation of an object, cross-sectional views of the generated chiral vector field, and the associated solid angle density maps. The borders of the cross-sectional visualizations are color-matched to the cutting surfaces indicated on the three-dimensional representations, illustrating the specific sections of the objects being visualized. The integer \(\:n\) values are obtained by rounding from the numerical calculation, similar to Fig. 2. Blender version 3.6 was used to generate the figures.
Figure 3a shows the results of our method for a Ball (a solid sphere). The surface of the ball is characterized by uniform positive Gaussian curvature, and the \(\:\varDelta\:{\Omega\:}\) maps display uniform distributions with positive values, yielding a Euler characteristic of \(\:n=1\). In Fig. 3b, we present the results for a solid cone. Although the cone has distinctive features such as a sharp apex and flat surface regions, it is homeomorphic to the ball. In the chiral vector field generated on the cone object, the sharp regions transform into smoothly changing configurations, resulting in a Euler characteristic of \(\:n=1\), the same as that of the ball. Notably, the \(\:\varDelta\:{\Omega\:}\) values calculated on flat surfaces, where the Gaussian curvature is nearly zero, are negligible.
Figure 3c displays the results for a sphere, specifically the hollow shell (surface) of a sphere. The Gaussian curvatures of both the inner and outer surfaces are positive. The \(\:\varDelta\:{\Omega\:}\) values calculated from the chiral vector configurations are uniformly distributed on both surfaces with positive values. As a result, the Euler characteristic of the sphere is calculated to be \(\:n=2\), reflecting the contributions from both the inner and outer surfaces. In Fig. 3d, we apply our method to a solid cup. The cup, despite its complex geometrical features, is homeomorphic to a solid torus (doughnut shape). Our method successfully establishes its Euler characteristic as \(\:n=0\), identical to that of the solid torus.
Figure 3e presents the results for a solid torus (a doughnut-shaped solid object). This object is characterized by a single continuous surface that exhibits both positive and negative Gaussian curvatures along its outer and inner regions, respectively. The positive and negative \(\:\varDelta\:{\Omega\:}\) values from these regions cancel each other out, yielding a Euler characteristic of \(\:n=0.\) In Fig. 3f, we examine a solid double torus, which features two holes. Each hole introduces additional surface regions of negative Gaussian curvature. As an expected result, the Euler characteristic is determined to be \(\:n=-1\), reflecting the increased number of holes compared to the solid torus.
Figure 3g and h show the results for the surfaces of a torus and a double torus, respectively. The torus surface (Fig. 3g) has a Euler characteristic of \(\:n=0\), while the double torus surface (Fig. 3h) has a Euler characteristic of \(\:n=-2\). These results correspond to the known Euler characteristics of the respective surfaces, emphasizing our method’s capability to capture the topological properties of both solid objects and their surfaces.
Considering that the number of holes in the structures of the ball, solid torus, and solid double torus increases by one for each, we observe that each additional hole contributes negatively to the Euler characteristic \(\:n\). The Euler characteristics of the ball, solid torus, and solid double torus are determined as \(\:n\) = 1, 0, and \(\:-1\), respectively. Similarly, for the surfaces, the sphere, torus, and double torus have Euler characteristics of \(\:n=2\), 0, and \(\:-2\), respectively.
In addition to our numerical tests, we verified the computed Euler characteristics by cross-checking against a commonly used SciPy‐based routine27,28, which is available for two- and three-dimensional objects. We confirm that the integer values from our approach match the established results across all tested objects in Fig. 3. Moreover, our method shares advantages with the chiral field approach counting skyrmion numbers technique of reference13, such as robustness to small boundary anomalies and straightforward extension to arbitrary dimensions. While the method13 in specifically targets two‐dimensional gray‐scale images, our generalized chiral‐vector formulation method applies to \(\:N\)‐dimensional objects retaining the same noise tolerance and yielding consistent Euler characteristics even in higher‐dimensional settings.
Lastly, we test our method across a variety of geometric configurations in various dimensions, as shown in Table 1. We utilize an \(\:N\)-dimensional ball, \(\:{B}_{N}\), subtracted by a region \(\:{E}_{N,m}\), where \(\:{E}_{N,m}\) is an m-dimensional ball of smaller radius within the \(\:N\)-dimensional space. Specifically, \(\:{B}_{N}\) is the region defined by \(\:\sum\:_{i=1}^{N}{x}_{i}^{2}<{R}_{\text{O}}^{2}\) and \(\:{E}_{N,m}\) is the region defined by \(\:\sum\:_{i=1}^{m}{x}_{i}^{2}<{R}_{\text{I}}^{2}\), where \(\:{R}_{\text{I}}<{R}_{\text{O}}\). For example, \(\:{B}_{3}-{E}_{\text{3,3}}\) represents three-dimensional ball with a spherical void, \(\:{B}_{3}-{E}_{\text{3,2}}\) represents a ball with a cylindrical hole, and \(\:{B}_{3}-{E}_{\text{3,1}}\) represents a bisected ball resulting in two half-balls. When\(\:\:m=1\), the \(\:N\)-dimensional ball is bisected into two separate entities, similar to slicing a solid object in half. Our method successfully determines the Euler characteristics for all the cases with \(\:m=1\) as \(\:n\) = 2, regardless of dimensionality. The object \(\:{B}_{N}-{E}_{N,\:N}\) forms an \(\:N\)-dimensional spherical shell. The computed Euler characteristics of \(\:n\) yield a value of 0 for even dimensionality and 2 for odd dimensionality. Notably, these results align with the known Euler characteristics. In general, we expect the Euler characteristic of \(\:n\) for \(\:{B}_{N}-{E}_{N,m}\) to be \(\:1-{\left(-1\right)}^{m}\).
In the 4-dimensional case, we additionally include two 2-dimensional manifolds, the Real Projective Plane (\(\:\text{R}{\text{P}}^{2}\)) and the Klein Bottle, both of which are embeddable in 4D space. The Real Projective Plane has a Euler characteristic of \(\:n=1\), while the Klein Bottle has a Euler characteristic of \(\:n=0\). These results further demonstrate our method’s applicability to a variety of topological structures, encompassing both familiar surfaces like a Ball and more complex surfaces such as the Klein Bottle and \(\:\text{R}{\text{P}}^{2}\)
The summarized results shown in Table 1 reflect the intricate relationship between dimensions and topology confirming the robustness of our computational approach across diverse dimensionalities.
We address the main limitations of this study. The Euler characteristic inherently aggregates multiple topological features into a single integer value. There are cases where the Euler characteristics cannot distinguish topological classes because the Euler characteristics represent the Betti numbers of topological classes into a single integer. For instance, both two disjoint balls and a single spherical sphere have a Euler characteristic of 2. This limitation primarily emerges in higher-dimensional spaces. This simplification necessitates the analysis of additional topological invariants. Nonetheless, in a two-dimensional setting, the same integer can still be leveraged to count the number of disconnected objects, suggesting potential applicability to 2D object-counting tasks; exploring such extensions is part of our future work.
Conclusions
In this study, we proposed a computational methodology for determining the Euler characteristic of objects in arbitrary dimensions. Inspired by the concept of the magnetic skyrmion number, a topological index used to characterize magnetic skyrmions, we generalized this concept to higher dimensions. The skyrmion number is based on the aggregation of local solid angles subtended by chiral vectors. We devised a simple numerical process to generate (\(\:N\)+1)-dimensional chiral vector fields onto \(\:N\)-dimensional objects and subsequently calculated the solid angle densities to obtain the corresponding. Euler characteristics.
Our approach successfully applied to two- and three-dimensional objects, yielding the Euler characteristics that align with those obtained from an existing method and established topological theories. Furthermore, we extended our method to 4D objects, where conventional computational methods are lacking. The resulting Euler characteristics were consistent with theoretically predicted values, highlighting the potential of our method to explore higher-dimensional topological spaces. These findings not only validate our approach but also suggest its superiority in handling complex, high-dimensional structures. We expect that this novel approach will serve as a valuable tool for computing the Euler characteristics of high-dimensional objects and analyzing their intricate topological properties.
Data availability
The Python code to implement the method within this study are available from GitHub (https://github.com/NanomagLab/Computing-Topological-Number-of-N-Dimensional-Objects).
References
Carlsson, G. Topology and data. Bull. Am. Math. Soc. 46, 255–308 (2009).
Chazal, F. & Michel, B. An introduction to topological data analysis: fundamental and practical aspects for data scientists. Front. Artif. Intell. 4, 667963. https://doi.org/10.3389/frai.2021.667963 (2021).
Kindelan, R., Frías, J., Cerda, M. & Hitschfeld, N. A topological data analysis based classifier. Adv. Data Anal. Classif. https://doi.org/10.1007/s11634-023-00548-4 (2023).
Yun, J., Kim, S., So, S., Kim, M. & Rho, J. Deep learning for topological photonics. Adv. Phys. X. 7, 2046156. https://doi.org/10.1080/23746149.2022.2046156 (2022).
de Blanco, M. et al. Tutorial: computing topological invariants in 2D photonic crystals. Adv. Quantum Technol. 3, 1900117 (2020).
Zomorodian, A. & Carlsson, G. Computing persistent homology. Discrete Comput. Geom. 33, 249–274 (2005).
Edelsbrunner, H., Letscher, D. & Zomorodian, A. Topological persistence and simplification. Discrete Comput. Geom. 28, 511–533 (2002).
Suzuki, S. & be, K. A. Topological structural analysis of digitized binary images by border following. Comput. Vis. Graph Image Process. 30, 32–46 (1985).
Bribiesca, E. Computation of the Euler number using the contact perimeter. Comput. Math. Appl. 60, 1364–1373 (2010).
He, L. & Chao, Y. A very fast algorithm for simultaneously performing connected-component labeling and Euler number computing. IEEE Trans. Image Process. 24, 2725–2735 (2015).
Morgenthaler, D. G. & Rosenfeld, A. Surfaces in three-dimensional digital images. Inf. Control 51, 226–235 (1981).
Yao, B., He, H., Kang, S., Chao, Y. & He, L. Efficient strategies for computing Euler number of a 3D binary image. Electronics 12, 1726 (2023).
Park, S. M., Moon, T. J., Yoon, H. G., Kwon, H. Y. & Won, C. Indexing topological numbers on images by transferring chiral magnetic textures. Adv. Mater. Technol. https://doi.org/10.1002/admt.202400172 (2024).
Kwon, H. Y. et al. High-density Néel-type magnetic skyrmion phase stabilized at high temperature. NPG Asia Mater. 12, 86 (2020).
Mühlbauer, S. et al. Skyrmion lattice in a chiral magnet. Science 323, 915–919 (2009).
Tonomura, A. et al. Real-space observation of skyrmion lattice in helimagnet MnSi thin samples. Nano Lett. 12, 1673–1677 (2012).
Yu, X. Z. et al. Real-space observation of a two-dimensional skyrmion crystal. Nature 465, 901–904 (2010).
Chen, G., Mascaraque, A., N’Diaye, A. T. & Schmid, A. K. Room temperature skyrmion ground state stabilized through interlayer exchange coupling. Appl. Phys. Lett. 106, 242408 (2015).
Moriya, T. New mechanism of anisotropic superexchange interaction. Phys. Rev. Lett. 4, 228 (1960).
Dzyaloshinsky, I. A thermodynamic theory of ‘weak’ ferromagnetism of antiferromagnetics. J. Phys. Chem. Solids 4, 241–255 (1958).
Hopf, H. Selected chapters of geometry. Proofs (2002).
Eriksson, F. On the measure of solid angles. Math. Mag 63, 184–187 (1990).
Kwon, H. Y., Kang, S. P., Wu, Y. Z. & Won, C. Magnetic vortex generated by Dzyaloshinskii-Moriya interaction. J. Appl. Phys. 113, 133911 (2013).
Duffy, D. et al. Shape programming lines of concentrated Gaussian curvature. J. Appl. Phys. 129, 224701 (2021).
Kang, S. P. et al. The spin structures of interlayer coupled magnetic films with opposite chirality. Sci. Rep. 8, 2361 (2018).
Chen, L. & Rong, Y. Digital topological method for computing genus and the Betti numbers. Topol. Appl. 157, 1931–1936 (2010).
Ohser, J., Nagel, W. & Schladitz, K. The Euler number of discretized Sets — On the choice of adjacency in homogeneous lattices. (2002). https://doi.org/10.1007/3-540-45782-8_12
Acknowledgements
This research was supported by the National Research Foundation (NRF) of Korea funded by the Korean.
Government (NRF-2023R1A2C1006050) and (NRF-2021R1C1C2093113).
Author information
Authors and Affiliations
Contributions
T.J.M. developed the algorithms and performed the experiments. Mathematical analysis was carried out by T.J.M. and S.M.P. S.M.P., H.G.Y., G.H.Y. contributed to the discussion and interpretation of the main results. The research was supervised jointly by H.Y.K. and C.W. All authors contributed to the final version of the manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Electronic supplementary material
Below is the link to the electronic supplementary material.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Moon, T.J., Park, S.M., Yoon, H.G. et al. Computing Euler characteristic of \({N}\)-dimensional objects via a Skyrmion-inspired overlaying (\({N}\)+1)-dimensional chiral field. Sci Rep 15, 11259 (2025). https://doi.org/10.1038/s41598-025-95495-9
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41598-025-95495-9





