{'fraction_non_alphanumeric': 0.0377643504531722, 'fraction_numerical': 0.009112172302894454, 'mean_word_length': 4.742165640738668, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Characterization and space embedding of directed graphs and social networks through magnetic Laplacians

Though commonly found in the real world, directed networks have received relatively less attention from the literature in which concerns their topological and dynamical characteristics. In this work, we develop a magnetic Laplacian-based framework that can be used for studying directed complex networks. More specifically, we introduce a specific heat measurement that can help to characterize the network topology. It is shown that, by using this approach, it is possible to identify the types of several networks, as well as to infer parameters underlying specific network configurations. Then, we consider the dynamics associated with the magnetic Laplacian as a means of embedding networks into a metric space, allowing the identification of mesoscopic structures in artificial networks or unravel the polarization on political blogosphere. By defining a coarse-graining procedure in this metric space, we show how to connect the specific heat measurement and the positions of nodes in this space.

Though commonly found in the real world, directed networks have received relatively less attention from the literature in which concerns their topological and dynamical characteristics. In this work, we develop a magnetic Laplacian-based framework that can be used for studying directed complex networks. More specifically, we introduce a specific heat measurement that can help characterizing the network topology. It is shown that, by using this approach, it is possible to identify the types of several networks, as well as to infer parameters underlying specific network configurations. Then, we consider the dynamics associated to the magnetic Laplacian as a means of embedding networks into a metric space, allowing the identification of mesoscopic structures in artificial networks or unravel the polarization on political blogosphere. By defining a coarse-graining procedure in this metric space, we show how to connect the specific heat measurement and the positions of nodes in this space.

I. INTRODUCTION
Data structures named graphs (a.k.a. network) can represent several real-world scenarios. Therefore, the analysis of these structures provides useful insights and a deep understanding of phenomena occurring in society or nature, such as in the analysis of crimes involving corruption [1] or in the field of quantum phase transitions [2,3]. Although many of these scenarios can only be faithfully modeled through directed networks [4], more effort has been spent in the development of methodologies for undirected networks [5,6]. Consequently, defining new measures and methodologies devoted to the directed case is of paramount importance for advancing of network science.
Here, using the formalism of magnetic Laplacians [7,8], we define new measures and methodologies which do not ignore the information about direction. In addition, these methodologies have a conceptual interpretation closely related to the concepts of quantum mechanics. We validate of these methodologies and measures by showing that they answer the following questions affirmatively: 1. Can we use the proposed approach to distinguish between networks generated by different models?
2. Is it possible to define an approach capable of inferring parameters of a model that created a certain network?
3. Can we extract information about structure and dynamics, as well the relationships between them?
If the answer to question 1 is positive, then measurements related to magnetic Laplacian can be used to classify networks generated by different models. For that purpose, we define a specific heat, , associated to a given graph. We obtain values for several categories * messias@ifsc.usp.br of complex networks and also use for training a Self-Organizing Map (SOM) [9,10], which is a type of neural network. SOM is able to learn which networks belong to the same network type without any previous knowledge. Therefore, can be understood as a spectral "fingerprint" of complex networks. The relationship between and the network model resembles those that are found in physical materials, where different types of materials have distinct behaviors.
For undirected networks, question 2 has been addressed previously using an informational point of view [11], focusing on the entropic distance and Kullback-Leibler divergence [6,12] between two networks. This point of view is extended in the present work for the directed case. The entropic distance or Kullback-Leiber divergence defined in [6,12] assumes that nodes have identity, i.e. permutations of rows and columns of the adjacaceny matrix matters. However, in case we are interested only on the topology of the networks, the aforementioned methodology will identify two topologically identical networks, labelled differently, as being distinct. In addition, it is verified that the entropic distance methods cannot guarantee high accuracy in the estimation of network topological properties for Barabási-Albert networks. So as to avoid these limitations, we develop a method to measure the dissimilarity between networks based on measures. As we show here, this new method achieves low relative errors (between 0% and 1%).
Question 3 was partially answered by Fanuel et al. [8,13] and others [7,14,15]. In order to improve the classical methods of community detection in directed networks, in [8] the authors defined a correlation measure between distinct vertices by using the formalism of magnetic Laplacian. Additionally, the same research group reported how each vertex of a directed graph could be mapped into a point of a T 2 [13] space. By employing this map, the authors were capable of unraveling mesoscale structures (topological) that occurs in real directed networks. The results obtained by Fanuel et al. [13] indicated that the magnetic Laplacian comprises information arXiv:1812.02160v2 [cs.SI] 9 Dec 2018 about the structure of directed graphs, providing an affirmative (partial) answer to question 3. The missing aspect is about the relationships between dynamics and structure. In this work, we address this problem by defining a dynamical system using the quantum evolution operator. This dynamical system can be used to map a directed (or undirected) graph into a hidden metric space defined by the diffusion. We show that this new hidden metric space can be used to detect communities in networks, and also to characterize mesoscopic structures in real-world networks, such as those related to political opinion.
As a mean to connect all concepts developed in this work, we propose a method resembling the geometric renormalization techniques [16] capable of deriving progressively simplified representations of complex networks.
This work starts by presenting the basic conceptsincluding the definition of the magnetic Laplacian, the statistical mechanics approach employed to graphs, and SOM networks, and follows by reporting developments related to entropy and specific heat inference methods for directed graphs. Then, we present an embedding procedure capable of mapping vertices of graphs into a hidden space underlain by magnetic Laplacian quantum dynamics. We then proceed by presenting and discussing the obtained result. First, we show that the SOM approach is able to identifying the types of complex networks. Subsequently, we show that the inference method, employing , exhibits better accuracy than the one via the entropic distance. The central issue of relating structure and dynamics of complex systems is addressed next, and we show that the geometry defined by quantum dynamics in modular networks has a similar behavior than a frustration-based approach reported previously [13], which is also capable of analyzing undirected graphs. An illustration of the potential of the quantum dynamics approach is also provided respectively to the classification of nodes in a political opinion network. Finally, we connect the behavior of the specific heat with the embedding of the topology of networks (consequently, with the dynamics associated with magnetic Laplacian) using a coarse-graining procedure.

A. Magnetic Laplacian and specific heat measure
A directed graph can be expressed by a tuple = ( , , ), where is the set of vertices; is the set of edges such that for each , ∈ the ordered tuple = ( , ) ∈ assigns a directed edge from vertex to and : → R. A directed graph can be associated with an undirected counterpart ( ) = ( , ( ) . However, the directionality of is lost in ( ) . In order to preserve the Hermiticity and the information about directionality , define , as : → , where is a group, such that ( , ) −1 = ( , ), choosing = (1) and expressing as where ∈ [0, 1] and ( , ) = ( , )− ( , ) represents the flow in a given vertex due to another vertex . The symmetric graph equiped with has information about directed edges and at the same time the adjacency matrix is Hermitian.
An operator named magnetic Laplacian [15,17], , can be associated with ( ( ) , ) . The reason for the term magnetic is that the operator can be used to describe the phenomenology of a quantum particle subject to the action of a magnetic field [7]. Due to this physical context, the parameter is named charge.
The magnetic Laplacian, expressed in terms of matrices, is given by where D is the degree matrix; By construction, D and W ( ) are both symmetric and Γ is Hermitian. Consequently, L is Hermitian. In addition, it is sometimes convenient to use a normalized version of L , which is given by where the H is defined only if the graph is at least weakly connected. A given eigenvector of H , | ( )⟩ , can be obtained as solution of where , ∈ R and 1, ≤ , ≤ · · · ≤ | |, It is possible to enhance the analogy with physical systems by including a temperature parameter ∈ R >0 . By using this parameter, the graph properties can be studied from the statistical mechanics viewpoint.
Here, we adopted the Boltzmann-Gibbs statistical mechanics formulation as a mens to associate the partition function with .
By using Eq.(5), the expected value at temperature T of a operator can be expressed in terms of its eigenvalues { } as In this work, we use the Eq.(6) to define the measure of specific heat, , associated with a graph. This novel measure is given by Observe that Eq.(7) has two free parameters, namely and . The value can be set so as to increase the quality of separability of modular structures of networks (see the discussion in supplemental material D). In addition, the parameter is used in order to investigate the multiscale structure of communities in directed networks [8]. Because of this free choice of parameters and, owing to the fact that we have a rotation associated with directed edges ( ), we plot in two dimensions , setting 2 as the polar coordinate, and as the radial one.

B. Self-Organized Maps (SOM)
SOM is a non-supervised approach to pattern recognition which was originally motivated by the way in which visual information is processed in the retina and visual cortex [18]. It uses a neuronal network associated topographically to the input space. During training, each input is mapped into the SOM by using some correlation measurement, such as the internal product. The neuron having the highest activation value is defined as the winner and its weights are modified so as to become more similar with the input data. The neighboring neurons are also modified in a similar manner by using a smoothing function .
In this way, the SOM approach involves competition and correlated learning, so that each neuron competes with the others.
The motivation for considering SOM in this work, instead of other neural network approaches derives from the fact that this specific neural network incorporates topographical mapping of the input space [10]. One interesting feature of SOM is that it is possible to infer information about how the trained database influenced the learning (e.g. in terms of distances between patterns). This is normally not possible in the Convolution Neural Network approach.

C. Directed Network Model Inference
Recent works reported how to use entropic measurements to quantify the distance between two undirected graphs [6,12]. The entropy of a graph is derived from the usual Laplacian spectrum (all eigenvalues are real). By contrast, these measurements cannot be used in the case of directed graphs because the adjacency matrix is not Hermitian. However, the magnetic Laplacian methodology yields a Hermitian operator , which is here used to define an entropic measurement for directed graphs.
Recall that a quantum system at finite temperature, , is defined by its respective density matrix, ( ) [19]. For a graph and charge , this operator can be expressed in terms of the eigenvalues and eigenvectors associated to as The previously defined density matrix can be used in order to define measurements associated with a directed (or undirected) graph. In the next subsections, we show how to perform some that new measurements.

Entropic distance methodology
There are several ways to define an entropy measure on a graph [20][21][22]. Here, we use the magnetic Laplacian to define a von Neumann entropy associated with a given graph for a given and . Such entropy is given by where Log is the matrix logarithm and Tr corresponds to the trace operation. Given two graphs˜and using Eq.(9), here we define an extension for the entropic distance [6,12] between the two directed graphs as The task of inferring the parameter of an observed graph˜, can be posed as finding the parameter ∈ { } that minimizes the entropic distance given a number of realizations for each value of , Although the entropic distance can be used to infer parameters of a generative model (directed or undirected), the inferred parameters can be somewhat inaccurate. This is due to the fact that the second term on the right-hand side of the Eq.(10) is not independent of permutations of the adjacency matrix (for a given graph with | | vertices, there are | |! possibilities of adjacency matrices) associated with˜. Furthermore, because the majority of the generative algorithms ignores the node indices, two identical graphs created with the same set of parameters, can result in different adjacency matrices (see the section F of the supplementary material for more details). Therefore, aiming at letting the entropic distance independent of permutations among the labels of the nodes and to improve the accuracy, we replace the second right-hand side of Eq.(10) by the following term

Specific heat deviation as a measure of dissimilarity
The methodology of entropic distance reported in [6,12] has two limitations concerning the inference of parameters. The first limitation is that this method is not able to compare networks with different number of nodes. This limitation can be a problem when this method is employed to compare a weakly-connected graph and a network generated by an algorithm. The second limitation consists in the fact that the entropic distance is dependent on permutations of the adjacency matrices associated with the graphs. For instance, two isomorphic graphs can have distinct adjacency matrices, which results in a non-null entropic distance. This limitation can be avoided by using the substitution presented in Eq. (12). However, this substitution causes lack of meaning of the expression "entropic".
Here, we propose a novel method that allows us to compare two networks avoiding the previous aforementioned limitations. This comparison is quantified by the relative deviation of the respective specific heats associated with the two networks. This relative deviation is given by where the integration region for charge and temperature can be chosen in arbitrary. Using Eq.(13), the solution for the inference problem of a parameter is given by the following equation

D. Graph Embedding
Graphs represent the relationships (edges) between entities (vertices). Such relations can be associated with scalar values (weights), which are not necessarily related to a distance measurement in a metric space. However, efforts have been made to derive methodologies aiming to embed vertices of a graph into some hidden metric space [23][24][25]. By doing so, it is possible to infer new insights about the studied graphs, such as vertex similarity, community structure, among other possibilities.
In addition, these embeddings can be employed for several practical applications, resulting in more efficient algorithms, such as node classification, community detection, link prediction [26] and routing algorithms [5].
Here, we propose an embedding methodology for directed networks through dynamics associated with magnetic Laplacian. Additionally, before presenting this novel methodology, we review the frustration based approach, which was proposed as a mechanism to visualize directed networks [13].

Magnetic Eigenmaps (Frustration-based) approach
In [13], the authors reported how to employ magnetic Eigenmaps to map vertices of a directed graph into points of a S 1 space through the solution of angular synchronization problem [27]. This problem consists of determining the set of angles { } that minimize the frustration measurement, which is defined as The approximate the solution of the synchronization problem [28]. Therefore, each vertex can be associated with a point in a S 1 space. The phases of the second eigenvector can be used to map the set of the vertices into a set of points in a different S 1 space. Thus, a directed graph can be embedded into T 2 = S 1 × S 1 [13]. However, this embedding procedure brings no information in the limit of = 0 or undirected networks, because for both cases, all vertices are mapped into the same point in the space.

Dynamics-based approach
To formulate a method capable of mapping directed or undirected networks into a hidden metric space, we propose a space embedding method based on the dynamics associated with the magnetic Laplacian. In order to do so, we build up a dynamical system with respective state space formed by vectors | ⟩ ∈ C | | , a evolution parameter ∈ R >0 , and use as evolution operator the evolution operator employed in quantum mechanics, which is smoothed by the Laplace transform (please refer to supplementary material C). This evolution operator is given by where G is known as a propagator in the literature of many body physics and quantum transport [29][30][31]. When this evolution operator is applied in a localized state in a vertex , which is given by it returns an evolved state This evolved state captures information about the network structure, and this information can be used to build up the embedding procedure. In order to filter which part of this information is used, we consider two aspects of magnetic Laplacians and its associated dynamics: the phase-shift, caused by directed edges, and its relationships with the Arahanov-Bohm effect [32]. Both aspects draw our attention to the importance of phases in the physics of directed complex networks. Remarkably, we can use the phases ( : → S | | ) associated with the evolved state, Eq. (18), to embed a graph in a hidden space. Due to this embedding, a graph can be associated with a set of points Θ = { ( )}. Unfortunately, due to the high dimensional characteristic, this embedding is not useful for visualization or many other practical applications.
Regardless of the difficulty of this high-dimension characteristic of phase-space, we can use the set Θ associated with that space to derive a new space with fewer dimensions. To accomplish this dimensionality reduction, we use the Diffusion Maps algorithm [33][34][35]. The first step to apply the diffusion map to the phase-space is to define a distance function between two vertices , ∈ . Here, we use a metric that is represented by Now, using this distance function, we define a similarity measurement between two vertices through a kernel function : Θ × Θ → R ≥0 as ( ( ), ( )) = exp where ∈ R > 0.
As can be noted, the kernel is positivity preserving, ( , ) ≥ 0. Therefore, we can use that function to define a transition probability from ( ) to ( ), where ( ) = ∑︀ ∈ ( ( ), ( )). This transition probability function can be represented by a transition matrix of a Markov chain on Θ. This matrix is given by, where K is a | | × | | matrix, in which [K ] , = ( , ) and N is a | | × | | diagonal matrix, such [N ] , = ( ).
Using the transition matrix, the transition probability to go from ( ) to ( ) through -steps ( ∈ N) is The previous equation can be used to define a diffusion distance at time between two vertices as follows The diffusion distance, Eq. (24), brings new information about the embedding into S | | space. However, it is still necessary to perform dimensionality reduction. Because the similarity measure is symmetric ( ( ( ), ( )) = ( ( ), ( )), ∀ , ∈ ), the diffusion distance can be expressed by the eigenvalues and eigenvectors of P as where is the th largest eigenvalue of P and ( ) is the th component of th eigenvector of P . As can be noted from Eq.(25), the diffusion distance between two vertices ( and ) is equivalent to a Euclidean distance between two points in a R | | space. Therefore, we define the function : → R | | as In addition, we define a truncated version of through the function : → R ; where 1 < ≤ | |. In this way, the matrix representation of for the vertex is given by The dimensionality reduction can be employed by considering that 1 ≥ 2 ≥> · · · ≥ | | and adjusting the parameter to approximate, with reasonable accuracy, the diffusion distance only with some initial components of r .
By choosing the appropriates parameters ( , and ) and removing the first coordinate of (the first eigenvector is trivial) through the map → 1 − , we can embed a graph (directed or undirected) into a lower dimensional Euclidean space.

A. Question 1 -Classification of directed graphs
The first question we address refers to the classification of networks (question 1): given a result of a measurement ℳ on a graph , which generative model created that graph? In this work, we opted to use the specific heat, , measurements on graphs in order to answer this question. As shown in Fig.1, the measures yields unique behavior for each generative model. Therefore, provides valuable information which can be used to classify and discriminate between different complex networks types.
As a mean to evaluate the efficiency of using as a fingerprint of a directed network, we created a dataset with 2000 samples. This dataset consists of extracted from networks of the following types: Erdős-Rényi (ER), Barabási (BA), scale-free (SF), Watts-Strogatz (WS), and modular directed networks with 3 (flux3) and 4 (flux4) modules, (please refer to the supplementary material A and E for more explanation about how the dataset and these modular structures were created). Then, a selforganizing map were trained with these samples, and the obtained regions were subsequently labeled. This labeling procedure was done by feeding each training data into the SOM and choosing the neuron that exhibited the highest activation. As indicated by the results, shown in Fig.2, networks belonging to the same class have been mapped into nearby neurons, defining respective clusters. So, the SOM was able to find the patterns of associated to the considered networks without considering previous knowledge (unsupervised recognition). Therefore, this results gives a positive answer to the question 1.

FIG. 1.
In (a), (b) and (c) it is shown the specific heat in terms of the charge 2 (polar coordinates) and temperature (radial coordinate) for a scale-free (SF) , Erdős-Rényi (ER) and Barabási-Albert (BA), network respectivaley. The parameters used for generate those networks was | | = 1000; the edge probability for ER was = 0.003; the number of outgoing edges for BA network were = 3. The temperature range and charge are uniformly sampled form interval [0.01, 0.15] and [0, 1/2] with 30 points each. As can be noted the shows a specific pattern for each network. This fingerprint pattern for each network explains why the SOM was so successful in the task of organizing networks belonging to the same classes onto the same groups using only the specific heat, without any knowledge about that classes (unsupervised learning). It follows from Eq.(1) that the eigenvalues, and therefore , are symmetric with respect to the addition of integer values to the charge = + ∀ ∈ Z, reflecting in the bilateral symmetry with respect to the horizontal axis in

B. Question 2 -Directed Network Model Inference
The results presented in Fig.2 attests that, given a network , we can determine which model generated it. Furthermore, to complete the characterization procedure of a network, it is necessary to find which parameter was used to generate that network. In this section, we explore this problem by using two methodologies developed in the current work: the extension for entropic distance for directed networks and the relative deviation of the specific heat. Figure 3 presents the inference results obtained by applying entropic distance methodology with the trick presented in, Eq.(10), for BA (a) and ER (b) network models. For each network model, six different networks were created. Each ER and BA networks were generated by using distinct connecting probabilities˜and out-degrees , respectively. The continuous vertical lines show the correct value of the parameter and the vertical dashed lines identify the position of the minimal entropic distance, which is the inferred value of the parameter. As it is seen in, the estimated results for ER are close to the correct values (around 4% of the relative error). However, the estimated parameter ( ) for BA networks resulted significantly divergent from the original settings (errors larger than 40%), indicating that the entropic distance is inadequate for estimating the out-degree parameter of BA model. Figure 4 presents the inference results when we employ the approach based on the specific heat measurements. As can be seen, the estimated parameters are close to the respective correct values for ER networks. Remarkably, in contrariwise to the results shown in Fig.3 (a), the values inferred ( ) for the number of outgoing edges for the BA networks, Fig.4(b), are exactly matched to the original counterparts.
As can be noted, the global minimum of the deviations of the specific heat measurements is in sharp contrast to the entropic inference method, which yields a flat minima. This distinct behavior benefits to infer the parameters because the minimum values tend to be more evident.

C. Question 3 -Structure and Dynamics
In this section we address the third question motivating the current work, namely the relationship between structure and dynamics in directed complex networks. Here, we propose that this type of relationships can be unraveled by exploiting the geometry brought about by quantum dynamics and diffusion coordinates system. However, before studying the dynamics-structure relationships we aim at connecting the geometry implied by the quantum dynamics (which is proposed in the present work) with the geometry induced by the frustration method [13]. In order to do so we created a modular (flux3) structure with = 3, = 100, = 0.5 and set = 0.8. Then, we constructed the magnetic Laplacian associated with that network by adopting = 1/3. By using Eq.(18) with = 0.01, we calculated the distance map between all nodes ( , ) assuming the metric defined by Eq. (19). The results are shown in Fig.6(a) and represent the distance between nodes embedded in phase space associated with quantum dynamics. In addition the results for frustration embedding are shown in Fig.6(b). As can be noticed, the same pattern of distance was obtained as before Fig.6(a). The distance maps indicate that if the nodes are separated by short distances in the frustration space (S 1 ), these nodes will have a similar dynamic behavior with respect to the phases space (S | | ). Therefore, for modular directed networks, the embedding generated by frustration and the embedding generated by dynamics are equivalent. However, we stress that the geometrization implemented by dynamics is based on a concept distinct from that underlying the frustration method. Therefore, this complementary approach has the benefit of providing different information about a given complex network.
The previous results indicates that the space embedding procedure can be employed to detect modular structures in complex networks. Therefore, it is reasonable to use the same framework while studying multilayer networks. Here, we focus on the task of inferring the layers which take part in a multilayer network using the embedding procedure. More specifically, we constructed a two-layered network where one layer was a BA network ( Fig. 5(a) blue diamonds) constructed with 500 nodes and = 3 and the other layer was an ER network ( Fig. 5(a) red circles) constructed with = 0.005 and 300 nodes. After the generation of the networks, the layers were randomly connected by using a probability of 10% for each pair of nodes belonging to different layers. Observe these edges are directed, meaning that ( , ) ̸ = ( , ). Subsequently, the specific heat map of the multilayer network was extracted and is presented in Fig.5(b). In order to realize the embedding procedure, instead of using the similarity matrix given by Eq.(20), we opted for using the matrix given by Note that this matrix implies in a much lower computational cost when compared with the matrix presented in Eq. (20). We used the matrix given by Eq. (28) and applied the diffusion mapping framework. This framework maps the nodes of the multilayer network into points of R 3 space, as shown in Fig.5(c). In the following, we applied a hierarchical clustering process in these points, which resulted in two clusters. Remarkably, the nodes of the layers were correctly separated into different clusters. Therefore, the specific heat of each cluster, see Fig.5(d) and Fig.5(e), represents the specific heat of each particular layer, exhibiting intrinsically different organizations.
Having shown that the dynamics of the magnetic Laplacian bears relationships with the abstract frustration approach and can be used to unravel community structures present in artificial networks, we use the same methodology to unravel patterns in real world networks. As a means to illustrate this possibility, we used a social network derived from the 2005 USA politic blogosphere [36] . In this network, the edges correspond to hyperlinks between blogs, while the vertices indicate the political trends of the blogs (blue circles = liberal and red diamonds = conservative). In Fig.7, it is presented the embedding of this network in the diffusion induced space, following Eq. (27). The obtained mapping allows a good separation between the two types of opinion. The results presented in Fig.6 and Fig.7 corroborate the hypothesis implied by question 3. More specifically, by using a physical analog (particle dynamics), we can define a geometry associated to a diffusive process so that this structure is capable of revealing structural and dynamical patterns in directed graphs.

D. Connecting concepts through geometric coarse-graining procedure
Going back to the three main questions motivating our approach, we observe that questions 1 and 2 are not immediately related to question 3.
However, it is possible to use a coarse-graining procedure in the adopted hidden spaces so as to derive a relationship among spectrum, structure and dynamics in complex networks using hidden metric spaces as a intermediary concept, as explained in the following.
Let us consider the problem of studying how a measurement ℳ on a graph (0) = ( , , ) is related to the adopted hidden spaces, and consequently with the respective dynamics whit generates the embedding into this space. First, we map into a metric space , so that each vertex ∈ becomes associated with a point r (0) ∈ . Therefore, the embedding yielding a set of points { (0) }, as shown in Fig.8(e). By construction, it follows that the proximity between vertices in this space is related to the similarity of some property (e.g. frustration or dynamics in phase space). Now, we can define a coarse-graining procedure resembling those used in statistical mechanics [5,16].
After make the measurement of ℳ in (0) , ℳ (0) , and embedding the graph in the hidden space, { (0) } we group vertices into super-vertices such that the sum of the distances (some metric must be used, here we are using the Euclidean metric) between its constituent elements be as small as possible. Each super-vertex represents a vertex of a new graph (1) (1) , (1) ), as illustrated in Figure Fig.8(c); where (1) and (1) can be defined so as to preserve some specific property of the original network. Now, we calculate ℳ in (1) , ℳ (1) , and map (1) into , defining a new set of positions associated to the vertices {r (1) }. This renormalization procedure can be repeated for a given number of stages, as shown in Fig.8(a). At the end, this coarse grained procedure provides the flow As a proof of concept of using aforementioned coarsegraining procedure we choose to better understand the relationship between the specific heat measurement and the hidden spaces of modular directed networks. In order to do so, we created a modular directed network with = 3, = 50%, = 70% and | | = 300. The mapping of this network is shown in Fig.8(f). The petal structures obtained for the specific heat are a consequence of modular structures (communities) in the network, as discussed in the Supplementary Material B. Therefore, we expect that petal structures must be preserved during coarse-graining procedure if this structures is correlated with the positions in the hidden metric space. In other words, if the behavior of is correlated with the macrostrutures in the hidden spaces, we expect then lows scales to vanish in this space, and, if connections among super-vertices are preserved, the behavior of also remains unchanged.
Recall that, as seen in Fig.6, the distances in the frustration-related space and in dynamics-based space present the same pattern. Consequently, it suffices to study the coarse-graining effect in just one of these spaces.
We applied the coarse-graining method so as to preserve the edges between the super-vertices. Therefore, the presence of an edge from super-vertex to in step + 1 is Using = 1/3 (please refer to the supplementary material D for reasons of choose this specific value of charge) we mapped the original graph into the space T 2 and applied the coarse-graining procedure twice. The specific heat obtained for the effective networks (1) e (2) is illustrated in Fig.8 (d) and Fig.8 (b), respectively. As it can be observed, the specific heat behavior (petals structure) was preserved. Thus, for this type of network, we conclude that the is correlated with the structures formed in the hidden metric spaces. Specific heats for each coarse graining-porcedure step are presented in (f), (d) and (b) for a modular directed network with three modules. Observe that the petals structure is preserved by the renormalization procedure.

IV. CONCLUSIONS
In the present work, we reported an approach to study directed networks that is based on concepts and measurements commonly used for materials characterization and transport in condensed matter. First, we proposed a new measurement related to the spectrum of a graph, namely the specific heat . We postulate that this measurement has a potential to identify network types and to infer respective parameters, which was confirmed in the reported experimental results. In particular, indications have been provided that this approach to graph charac-terization can be more accurate than by using entropic distances.
A graph-embedding approach based on quantum dynamics associated with magnetic Laplacian was also described. Experimental results have shown that this approach can reveal mesoscopic structure in both theoretical and real-world networks (a political opinion dataset). We also showed how the geometric structures in this hidden spaces can be associated with the specific heat according to a coarse-graining procedure.
Our contributions pave the way to a number of future developments and applications involving directed complex networks. For instance, these methods can be immediately applied to study several other theoretical and real-world structures, including fake news dissemination, metabolic networks, neuronal systems, to name but a few possibilities. Regarding the more conceptual aspects of the reported contributions, it would be interesting to consider alternative coarse-graining methodologies so as to preserve specific topology or dynamical behaviors in directed networks. It would also be interesting would be to consider geometrizations defined by dynamics that naturally incorporate temperature as a parameter. and the interblock defining the connections between the above structures is given as Plugging the two previous equations into Eq.(B11),H can be obtained as if is odd, the eigenvalues ofH are obtained as Replacing ℎ by their counterparts in Eq.(B16) the following eigenvalue equation can be obtained )︂ ( , , ) + Δ, Equation (B18) indicates a rotation symmetry related to charge in the modular directed network. These symmetries causes the petal structures in specific heat observed in main text and in Fig.9.

Origin of Asymmetries in the Specific Heat
The results obtained in the previous section paves the way to understanding the relationship between the modular directed networks (flux) and the magnetic Laplacian spectrum, as well as the specific heat symmetry. However, these results assume that the inner structures H in are undirected. The effect of directionality can be inferred by genearting random directions inside the intrablocks, i.e. by imposing that [W in ] , has probability to take value 1. Adopting = 30%, we calculate the specific heat by using numeric diagonalization, yielding the structures in Fig.10. We can observe that the obtained petals are not symmetric, unlike what had been observed for uniform connections.
FIG. 10. Specific heat (colors) in terms of the charge 2 (angle) and temperature (radius), for = 3(a), 4(b) and 5(c), assuming = 45. The networks were generated randomly, imposing the probability of having a directed edge as = 30%. Observe the obtained asymmetric petals contrasting with the results obtained previously for the uniform connections.

Appendix C: Frustration space and relationship with quantum dynamics
In order to measure the similarity between two nodes ( and ) we extend the analogy with quantum mechanics by defining a parameter ∈ R, time, and the well-studied quantum evolution operator [38] This operator maps a given state, | ⟩, into the corresponding time evolved state | ( )⟩ through | ( )⟩ = U ( )| ⟩.
(C2) Therefore, we have a dynamical system, (C | | , , R), which can be used to characterize a given node through the state dynamics of that node at = 0. We restrict our analysis to the dynamics of the phases of a given state, which is an essential entity for our dynamics because it reflects modifications of the directed edges on graph. In order to study the aforementioned dynamics, it is convenient to map the evolution operator into a smoothed version through Laplace transform, which can be performed by solving the integral where ∈ R.
Using the spectral representation of the evolution operator, the Eq.(C3) can be expressed as where G is known as a propagator in the literature of many body physics and quantum transport [29,30].

Appendix D: Relating charge and separability
In this section we study the relationship between the charge, , and the separability of nodes bellowing to different communities in the S 1 space (frustation space, see II D 1) embedded into R 2 . In order to do so, we create a network with = 3, = 45, = 50% and = 40%. For a given the position of th node is given by where , is the th component of first eigenvector of associated magnetic Laplacian. Using the formalism of scatter matrices [39] we can measure the quality of the separability for a given calculating the ratio In Eq.(D2) the numerator is the determinant of the between-class scatter matrix which is given as where ( ) is the mean position vector for all nodes inside the -th community.
In Fig.11 is shown in terms of . Note that the best value for maximize the ratio is obtained when ≈ 1 3 , 2 3 .  In the reported specific heat experiments, they are set in random fashion. | |, and are, respectively, the number of vertices (or network size); the number of outgoing edges (or out degree) for BA network and the edge probability for ER.
The specific heat for each network is calculated in the temperature range [0.01, 0.15] and charge [0, 1/2], with 25 points each.