# Echo chambers in the Ising model and implications on the mean magnetization

Talia Baravi, Ofer Feinerman, Oren Raz

###### Abstract

The echo-chamber effect is a common term in opinion dynamic modeling to
describe how a person’s opinion might be artificially enhanced as it is
reflected back at her through social interactions. Here, we study the
existence of this effect in statistical mechanics models, which are commonly
used to study opinion dynamics. We show that the Ising model does not exhibit
echo-chambers, but this result is a consequence of a special symmetry. We then
distinguish between three types of models: (i) those with a strong echo-
chamber symmetry, that have no echo-chambers at all; (ii) those with a weak
echo-chamber symmetry that can exhibit echo-chambers but only if there are
external fields in the system, and (iii) models without echo-chamber symmetry
that generically have echo-chambers. We use these results to construct an
efficient algorithm to efficiently and precisely calculate magnetization in
arbitrary tree networks. Finally, We apply this algorithm to study two
systems: phase transitions in the random field Ising model on a Bethe lattice
and the influence optimization problem in social networks.

##  1 Introduction

The formation of echo-chambers in social media [1, 2] is thought to strongly
affect how opinions spread across a social network and contribute to increased
social polarity. This occurs as like-minded people cluster in disjoint
networks wherein information produced by any individual is reflected back at
her [3] to increase her confidence artificially. This effect is countered, to
a degree, by the diversity of opinions in a network which, naturally, exceeds
that of any single individual [4, 5, 6]. Indeed, the formation of echo-
chambers appears to depend on the specific interaction rules adopted by
different platforms [3, 7].

In this paper, we explore the existence of echo-chambers in statistical
mechanics models that are often used to study opinion and influence dynamics
but are common in many additional contexts – from magnetic systems to neural
networks. We focus most of our attention on the famous Ising model, which
describes a ferromagnet as a network of coupled spins [8]. This model was
originally developed to describe equilibrium magnetic systems in statistical
mechanics, but is often used to explore how interactions between the
individual entities reflect on large-scale system properties, for example, in
the context of influence dynamics [9, 10, 11, 12, 13]. A natural question is
therefore whether echo chambers exist in this model. We would say that a spin
experiences an _echo chamber_ effect if, when exposed to an external local
field, its mean magnetization depends on whether it is isolated or linked to a
neutral network. Here, a _neutral network_ with respect to the specific spin
means a network that does not bias the mean magnetization of this spin when no
external field is applied on it. In other words, the spin echo-chamber effect
occurs when the connection with the network does not bias an unbiased spin but
amplifies the influence of any external field applied on the spin.

Intuitively, one might expect the Ising model to display spin echo-chambers:
Consider a spin connected to a network with no external fields on any of its
spins and is, therefore, a neutral network. An external field on the specific
spin connected to the network biases it in a certain direction and produces
mean magnetization. Once this spin is connected to the network, this
magnetization breaks the $\pm$ symmetry and biases the neighboring spins in
the same direction. The network then has non-zero magnetization. One might
expect it would feedback on the local spin to change its bias and mean
magnetization, generating an echo-chamber in the system. Surprisingly, we find
that although it might exist in other models, this effect is absent from the
Ising model. We then identify three cases that can occur in different models:
(i) Strong echo-chamber symmetry – models in which echo-chambers never appear
in a neutral network. The Ising model belongs to this class; (ii) Weak echo-
chamber symmetry – where there are no echo chambers in networks that do not
have external fields other than on the specific spin, but there might be echo-
chambers in networks that have additional biasing fields that balance each
other on the specific spin, generating a neutral network. The XY, the vector
Potts, and the Heisenberg models belong to this class; (iii) Models without
any echo-chamber symmetry, which generically include the echo-chamber effect.
For example, the spin $1$ Blume-Capel model belongs to this class.

To prove the absence of spin echo chambers in the Ising model, we use a simple
but powerful tool – the _effective field method_. The mean magnetization of a
spin is affected by the external field applied to it and its interactions with
the other spins. We show that the two effects decouple and that the
interactions with the rest of the network can be fully described by an
_effective field_. While an effective field could always be defined for any
model, in the Ising model, it is independent of the external field applied on
the spin itself. This property turns out to prevent the spin echo chamber
effect. Loosely speaking, an effective field implies the lack of echo chambers
even in non-neutral networks.

The implications of the effective field method go beyond the proof that some
models do not exhibit a spin echo chamber effect. To demonstrate this, we
applied it to construct an efficient computational algorithm for an exact
calculation of the mean magnetization of each spin in tree networks with
general interaction strengths, local external fields, and temperature.
Although Monte-Carlo and similar methods are usually efficient in
approximating the mean magnetization in such systems to high accuracy, exact
calculations as in our algorithm are typically limited by the fact that the
partition function grows exponentially with system size. As a proof of
concept, we demonstrate this algorithm by calculating the quenched average of
the random field Ising model on the Bethe lattice [14, 15, 16]. This system is
known to have a phase transition as a function of the temperature and the
magnitude of the quenched disordered field. Our method enabled us to exactly
calculate the mean magnetization in each realization of the random field and
average these to directly demonstrate quenched averaged magnetization on a
relatively large system.

Finally, we connect our findings back to the field of social influence
networks [17]. Specifically, we consider the optimal ways to exert influence
on a network given limited resources [18, 11]. Using the analogy between
social networks and the Ising model [11, 19] it was recently shown that, to
maximize influence, either hubs or leaf nodes should be targeted [20, 21]. We
validate and expand on these results on a large Barabasi-Albert network [22],
and without the mean-field approximation, [23] commonly used to analyze such
systems.

##  2 The basic model

We start by considering the Ising spin model on a general undirected graph $G$
in which at each node $i$ there is a spin, denoted by $\sigma_{i}$. We assume
an arbitrary symmetric interaction term $J_{ij}=J_{ji}$ between spins
$\sigma_{i}$ and $\sigma_{j}$, if the nodes $i$ and $j$ are connected in the
the graph $G$. Furthermore, we allow the external field $h_{i}$ to differ
between nodes. The Hamiltonian of this model is given by:

$\mathcal{H}(\vec{\sigma})=-\sum_{\\{i,j\\}\in
G}J_{ij}\sigma_{i}\sigma_{j}-\sum_{i}h_{i}\sigma_{i},$ (1)

where $\vec{\sigma}=(\sigma_{1},...,\sigma_{N})$ is a specific configuration
of the spins, $J_{ij}$ is the coupling strength between the spin $i$ and spin
$j$, $h_{i}$ is the external field on the spin $i$, the first summation is
over all the edges of the graph and the last summation is over all spins.

For a system described by the above Hamiltonian, the average magnetization of
the $k^{th}$ spin in thermal equilibrium is given by:

$\braket{\sigma_{k}}=\frac{\sum_{\\{\sigma\\}}\sigma_{k}e^{\mathcal{-\beta
H}(\vec{\sigma})}}{\sum_{\\{\sigma\\}}e^{\mathcal{-\beta
H}(\vec{\sigma})}}=\frac{\partial_{h_{k}}Z}{\beta Z},$ (2)

where $\sum_{\\{\sigma\\}}$ is a summation over all spin configurations,
$\beta=T^{-1}$ is the inverse temperature in units where the Boltzmann
constant is set to 1, and

$\displaystyle Z=\sum_{\\{\sigma\\}}e^{\mathcal{-\beta H}(\vec{\sigma})}$ (3)

is the partition function associated with the model. For the specific case of
a single spin, which is used in the definition of the spin echo-chamber
effect, the partition function is

$\displaystyle Z_{1}=2\cosh(\beta h),$ (4)

and the mean magnetization is given by

$\displaystyle\braket{\sigma}=\tanh(\beta h).$ (5)

Even though we focus much of our work on this basic model to demonstrate our
findings, some of our results hold for a more general class of models, which
we call “echo-chamber symmetric” models, as discussed in Sec.(4.3).

##  3 Illustrative examples in two spin systems

To demonstrate the echo chamber effect, we start by looking at the simplest
network graph, which includes two connected nodes. We show that the Ising
model does not exhibit an echo chamber in this example, while a spin $1$ model
does. In addition, we provide some heuristic intuition to these results. A
more comprehensive analysis expands these simple examples in the following
sections.

###  3.1 The Ising model lacks an echo chamber

Let us start by considering a single Ising spin, $\sigma_{1}$, in an external
field of $h_{1}=1$ and inverse temperature $\beta=1$. As stated above, the
mean magnetization of this spin is simply :

$\displaystyle\braket{\sigma_{1}}=\tanh(\beta h_{1})=\tanh(1)\sim 0.76.$ (6)

Next, we connect $\sigma_{1}$ to the simplest possible network by adding just
one more spin, $\sigma_{2}$, coupled with $J_{12}=1$. There is no external
field on $\sigma_{2}$, namely $h_{2}=0$. The Hamiltonian in this case, is
simply

$\mathcal{H}(\vec{\sigma})=-\sigma_{1}\sigma_{2}-\sigma_{1}.$ (7)

Let us calculate the mean magnetization of this second spin. Direct
calculation shows that in this case:

$\displaystyle\braket{\sigma_{2}}=\frac{e^{2}+e^{-2}-2}{e^{2}+e^{-2}+2}\sim
0.58.$ (8)

Although no field is directly applied to $\sigma_{2}$, its coupling with
$\sigma_{1}$ leads to a mean magnetization which agrees with the sign of the
external field $h_{1}$. Since $\braket{\sigma_{2}}>0$, one might expect that
this magnetization may feedback onto $\sigma_{1}$ and increase its alignment
with the field $h_{1}$. Indeed, if one replaces $\sigma_{2}$ with a fixed
magnet of constant magnetization equal to $\braket{\sigma_{2}}$ then this
would increase the mean magnetization of $\sigma_{1}$.

Directly calculating the mean magnetization of $\sigma_{1}$ in the coupled
system we obtain:

$\displaystyle\braket{\sigma_{1}}=\frac{e^{2}-e^{-2}}{e^{2}+e^{-2}+2}\sim
0.76,$ (9)

which is exactly equal to its mean magnetization in the uncoupled system.
Therefore, the expectation for positive feedback does not hold and this system
does not exhibit an echo chamber.

The effect of $\sigma_{2}$ on $\sigma_{1}$ deviates from that of a constant
magnet with the same mean magnetization. Therefore, it must be the
fluctuations of $\sigma_{2}$ responsible for the absence of echo-chamber.
Using the ergodicity of the system, which implies that the ensemble average is
identical to the time average, we can interpret $\braket{\sigma_{2}}>0$ as if,
on average, $\sigma_{2}$ spends time $t_{+}$ in the $\sigma_{2}=+1$ state and
time $t_{-}$ in the $\sigma_{2}=-1$ state, such that

$\displaystyle\frac{t_{+}-t_{-}}{t_{+}+t_{-}}=\braket{\sigma_{2}}.$ (10)

Figure 1: The blue line is the function $\tanh(\beta h)$, which relates
between average magnetization and external field in the Ising model. The red
point is $\braket{\sigma_{1}}$ for an isolated spin with $\beta=h=1$. Coupling
this spin to a second spin, $\sigma_{2}$, with coupling constant $J=1$,
changes the external influence on $\sigma_{1}$ to $\beta(h+J)$ when
$\sigma_{2}=+1$ and to $\beta(h-J)$ when $\sigma_{2}=-1$ (dark blue and black
points, respectively). The concave nature of the hyperbolic tangent implies
that for $h>0$ the $\sigma_{2}=-1$ cause a larger change in the mean
magnetization compared to $\sigma_{2}=+1$ (compare the magnitudes of the red
arrows). The time difference $\sigma_{2}$ spends on each of these states
exactly cancels this bias so that the two spin Ising model,lacks an echo-
chamber.

A key point in this intuitive explanation is then to note that because of the
external field $h_{1}$, $\sigma_{2}$ affects the mean magnetization of
$\sigma_{1}$ stronger when $\sigma_{2}=-1$ in comparison to the case
$\sigma_{2}=+1$. This is a result of the concave nature of Eq.(5) for $h>0$
(see Fig. 1): Since $h_{1}>0$, a bias towards $h_{1}+J$ when $\sigma_{2}=+1$
has a smaller effect on $\braket{\sigma_{1}}$ in comparison to the bias
towards $h_{1}-J$ that happens for $\sigma_{2}=-1$. The surprising fact is
that the temporal bias towards $t_{+}$ is exactly canceled by the smaller
effect of $\sigma_{2}=+1$ on the magnetization of $\sigma_{1}$. This exact
cancellation is special for models that have the echo-chamber symmetry, as we
discuss below.

###  3.2 The Blume-Capel model displays an echo chamber

We have seen a simple example of the lack of echo chambers in the Ising model
and provided a heuristic argument to explain it. However, the exact
cancellation between the fluctuations and bias in the Ising model is somewhat
special and does not exist in other models. We, therefore, demonstrate the
existence of an echo chamber with a second simple example. To this end, we
consider a similar two spin system, but with spin-1 objects, instead of the
spin-$\frac{1}{2}$ used in the Ising model. The spin-1 objects $\sigma$ can
take the values $1$, $0$ or $-1$. We start with a single particle system. Its
Hamiltonian is given by

$\displaystyle\mathcal{H}(\sigma_{1})=-h\sigma_{1}.$ (11)

The partition function of this system is given by

$\displaystyle Z=e^{-\beta h}+e^{\beta h}+1=2\cosh(\beta h)+1.$ (12)

The mean magnetization is given by

$\displaystyle\braket{\sigma_{1}}=\frac{\partial_{h}Z}{\beta
Z}=\frac{\sinh(\beta h)}{\cosh(\beta h)+\frac{1}{2}},$ (13)

which for $h>0$ is convex in $h$. Next, consider a system of two coupled spins
of this type, namely a Hamiltonia

$\displaystyle\mathcal{H}(\\{\sigma\\})=-J\sigma_{1}\sigma_{2}-h_{1}\sigma_{1}-h_{2}\sigma_{2}.$
(14)

The partition function is now

$\displaystyle Z$ $\displaystyle=$ $\displaystyle 2\left(\cosh(\beta
h_{1})+\cosh(\beta h_{2})+e^{\beta
J}\cosh\left(\beta(h_{1}+h_{2})\right)+e^{-\beta
J}\cosh\left(\beta(h_{1}-h_{2})\right)\right)+1,$ (15)

and the mean magnetization of say $\sigma_{1}$ is given by

$\displaystyle\braket{\sigma_{1}}=\frac{2\left(\sinh(\beta h_{1})+e^{\beta
J}\sinh\left(\beta(h_{1}+h_{2})\right)+e^{-\beta
J}\sinh\left(\beta(h_{1}-h_{2})\right)\right)}{2\left(\cosh(\beta
h_{1})+\cosh(\beta h_{2})+e^{\beta
J}\cosh\left(\beta(h_{1}+h_{2})\right)+e^{-\beta
J}\cosh\left(\beta(h_{1}-h_{2})\right)\right)+1}.$ (16)

Using these we can easily check if there is a spin echo-chamber effect in the
system. Namely, we can compare the mean magnetization of $\sigma_{1}$ at some
field $h_{1}$ when the spin is coupled or uncoupled to the second spin with
$h_{2}=0$. Plugging $h_{2}=0$ in Eq.(16) gives:

$\displaystyle\braket{\sigma_{1}}=\frac{\sinh(\beta h_{1})}{\cosh\left(\beta
h_{1}\right)+\frac{3}{2\left(1+2\cosh({\beta J})\right)}}$ (17)

Since this is different from the single spin mean magnetization (Eq. 13), we
see that this model indeed has an echo-chamber effect – the mean magnetization
is larger when the spin is connected to additional spin, and is only equal to
it in the case $J=0$ where there is no interaction between the spins. It
implies that while the different time fraction that $\sigma_{2}$ spends at
each possible spin value decreases the echo chamber effect, it does not
exactly compensate for the convexity of $\braket{\sigma(h)}$. Therefore, there
is some degree of the echo chamber effect in the system.

##  4 The Effective field

The examples considered above give some insight into the echo-chamber effect.
To further explore this effect in the different models, it is useful to
introduce first the notion of an effective field which we present next.

Generally speaking, the mean magnetization of any specific spin at a fixed
temperature $\beta$, $\langle\sigma_{k}\rangle$, is a function of both the
magnetic field on this spin, $h_{k}$, and the magnetic fields on all other
spins, namely on $h_{j}$ for all $j\neq k$. Given the mean magnetization of
spin $k$, we can invert Eq.(5) (or the corresponding relation between mean
magnetization and external field for other models) and define the total
effective field on this spin as:

$\displaystyle
h_{k}^{tot}=\beta^{-1}\tanh^{-1}\left(\braket{\sigma_{k}}\right).$ (18)

$h_{k}^{tot}$ has the following physical interpretation: when $\sigma_{k}$ is
decoupled from the network, $h_{k}^{tot}$ would make its mean magnetization
identical to $\braket{\sigma_{k}}$. The mean magnetization
$\braket{\sigma_{k}}$ is affected by both the actual field on the spin,
$h_{k}$, and the interactions with the rest of the network. Thus, it is useful
do define the “network field” which captures the latter, as

$\displaystyle
h_{k}^{network}=h_{k}^{tot}-h_{k}=\beta^{-1}\tanh^{-1}\left(\braket{\sigma_{k}}\right)-h_{k},$
(19)

which can also be written as

$\displaystyle\langle\sigma_{k}\rangle=\tanh\left(\beta(h_{k}+h_{k}^{network})\right).$
(20)

An analogous network field can be defined for any spin model. However, it is
not a useful quantity in most cases (unless some echo-chamber symmetry
discussed below exists in the system). This is because $h_{k}^{network}$ is,
in general, a non-trivial function of $h_{k}$ itself. It implies that, for a
general model, the external field on a spin influences the feedback that this
spin receives from the network. Hence, the spin is subject to an “echo-
chamber”.

In models where $h_{k}^{network}$ is independent of $h_{k}$, we call it the
_effective field_ and denote it by $h^{eff}$. In these cases it can also be
defined as

$h_{k}^{eff}=\beta^{-1}\tanh^{-1}(\braket{\sigma_{k}[h_{k}=0]}),$ (21)

namely as the total effective field when the external field on the specific
spin is zero, and $[h_{k}=0]$ is short-hand notation for the external field
configuration $(h_{1},h_{2},...,h_{k}=0,...h_{N})$.

As we next show, the Ising model displays this special property and, as a
result, lacks a spin echo-chamber effect.

###  4.1 Effective field in the Ising model

In this subsection, we prove that one can define an effective field in the
Ising model on an arbitrary network. In other words, we show that
$h_{k}^{eff}$, as defined in Eq.(19), is not a function of $h_{k}$. We do this
by showing that Eq.(21) holds, regardless of the value of $h_{k}$. To this
end, we first define the following quantities:

$\mathcal{H}^{\prime}_{k}(\vec{\sigma})=\mathcal{H}(\vec{\sigma})+\sigma_{k}h_{k}=-\sum_{\\{i,j\\}\in
G}J_{ij}\sigma_{i}\sigma_{j}-\sum_{i\neq k}h_{i}\sigma_{i},$ (22)

and

$\displaystyle A_{+}$ $\displaystyle=$
$\displaystyle\sum_{\\{\sigma\neq\sigma_{k}\\}}e^{\mathcal{-\beta
H}^{\prime}(\vec{\sigma},\sigma_{k}=1)};$ (23) $\displaystyle A_{-}$
$\displaystyle=$
$\displaystyle\sum_{\\{\sigma\neq\sigma_{k}\\}}e^{\mathcal{-\beta
H}^{\prime}(\vec{\sigma},\sigma_{k}=-1)},$ (24)

where the summation in the definitions of $A_{\pm}$ is over all configurations
of all the spins except $\sigma_{k}$, and
$\mathcal{H}^{\prime}(\vec{\sigma},\sigma_{k}=\pm 1)$ is calculated at the
corresponding configuration but forcing $\sigma_{k}=\pm 1$, respectively. With
this notation, we can write

$\displaystyle Z$ $\displaystyle=$ $\displaystyle e^{\beta
h_{k}}A_{+}+e^{-\beta h_{k}}A_{-},$ $\displaystyle\partial_{h_{k}}Z$
$\displaystyle=$ $\displaystyle\beta\left(e^{\beta h_{k}}A_{+}-e^{-\beta
h_{k}}A_{-}\right),$ (25)

and the mean magnetization can be written as

$\braket{\sigma_{k}}=\frac{e^{\beta h_{k}}A_{+}-e^{-\beta
h_{k}}A_{-}}{e^{\beta h_{k}}A_{+}+e^{-\beta h_{k}}A_{-}}.$ (26)

Manipulating the above equation:

$\braket{\sigma_{k}}=\frac{e^{\beta h_{k}}A_{+}-e^{-\beta
h_{k}}A_{-}}{e^{\beta h_{k}}A_{+}+e^{-\beta h_{k}}A_{-}}=\frac{(e^{\beta
h_{k}}-e^{-\beta h_{k}})(A_{+}+A_{-})+(e^{\beta h_{k}}+e^{-\beta
h_{k}})(A_{+}-A_{-})}{(e^{\beta h_{k}}+e^{-\beta
h_{k}})(A_{+}+A_{-})+(e^{\beta h_{k}}-e^{-\beta h_{k}})(A_{+}-A_{-})},$ (27)

where in the right hand side $e^{-\beta h_{k}}A_{+}$ and $e^{\beta
h_{k}}A_{-}$ were added and subtracted from both the numerator and
denominator. Next, we multiply the numerator and the denominator by $\beta/2$,
and use the identity $A_{+}+A_{-}=Z(h_{k}=0)$ as well as
$\beta\left(A_{+}-A_{-}\right)=\partial_{h_{k}}Z(h_{k}=0)$, where $Z(h_{k}=0)$
is the partition function of the same system with $h_{k}$ set to be zero (See
Eq. 4.1). With these we get:

$\braket{\sigma_{k}}=\frac{\beta\sinh(\beta h_{k})Z(h_{k}=0)+\cosh(\beta
h_{k})\partial_{h_{k}}Z(h_{k}=0)}{\beta\cosh(\beta
h_{k})Z(h_{k}=0)+\sinh(\beta h_{k})\partial_{h_{k}}Z(h_{k}=0)}.$ (28)

Dividing numerator and denominator by $\cosh(h_{k})\beta Z(h_{k}=0)$ and using
Eq.(2), we get:

$\braket{\sigma_{k}}=\frac{\tanh(\beta
h_{k})+\braket{\sigma_{k}[h_{k}=0]}}{1+\tanh(\beta
h_{k})\braket{\sigma_{k}[h_{k}=0]}}.$ (29)

To continue, we use the following identity for hyperbolic tangent:

$\displaystyle\tanh(a+b)=\frac{\tanh(a)+\tanh(b)}{1+\tanh(a)\tanh(b)},$ (30)

to get:

$\braket{\sigma_{k}}=\frac{\tanh(\beta
h_{k})+\braket{\sigma_{k}[h_{k}=0]}}{1+\tanh(\beta
h_{k})\braket{\sigma_{k}[h_{k}=0]}}=\tanh\left(\beta
h_{k}+\tanh^{-1}\braket{\sigma_{k}[h_{k}=0]}\right).$ (31)

Lastly, we note that by definition (see Eq.20), the above equation implies
that

$\displaystyle h_{k}^{network}=\tanh^{-1}\braket{\sigma_{k}[h_{k}=0]}.$ (32)

However, in this case, $h_{k}^{network}$ is calculated using the mean
magnetization of the system when replacing the actual value of $h_{k}$ with
$h_{k}=0$. This completes the proof that $h_{k}^{network}$ is $h_{k}$
independent. Therefore, in the Ising model $h_{k}^{network}$ can indeed be
termed $h^{eff}_{k}$ as defined above.

We note that this result (and thus everything that follows), fails in the
thermodynamic limit if the system has two distinct phases, where ergodicity
breaking dictates averaging over a subspace of all micro-states, and one
cannot evaluate the mean magnetization using Eq.(2). As we discuss in what
follows, the property we just proved stems from a symmetry of the spin
interactions. However, before showing this, we first explain why the existence
of an effective field implies that the Ising model has no spin echo-chambers.

###  4.2 The Ising model does not display spin echo-chambers

As discussed above, a spin echo-chamber effect occurs when the coupling of a
spin to a neutral network affects its response to an external magnetic field.
To explain the effect, consider first the general case of a spin, $\sigma_{1}$
that can be coupled to a general network of spins $G$. When no external field
is applied on any of the spins in the system, the average magnetization of
$\sigma_{1}$ is zero (as is the case for any other spin in the system), namely
$\braket{\sigma_{1}}=\braket{\sigma_{k}}=0$. We define a network to be
_neutral with respect to $\sigma_{1}$_, or _$\sigma_{1}$ -neutral_, in the
following case: if no external field is applied on $\sigma_{1}$, its mean
magnetization is zero regardless of it being connected or disconnected from
the network. In other words, the connection to the network does not bias the
mean value of $\sigma_{1}$. We note that by definition, a network is
$\sigma_{k}$-neutral exactly when $h_{k}^{network}=0$ for $h_{k}=0$. If there
is an effective field in this model, as is the case for the Ising model, then
a network is $\sigma_{k}$-neutral when $h_{k}^{eff}=0$.

Employing this definition and the effective field described above, it is now
straightforward to show that there is no spin echo-chamber effect in the Ising
model. Assume that a spin, which without loss of generality we denote by
$\sigma_{1}$, is coupled to a $\sigma_{1}$-neutral network, and is subject to
some external field $h_{1}$. By the effective field result, the mean
magnetization of the spin is given by

$\displaystyle\langle\sigma_{1}\rangle=\tanh\left(\beta(h_{1}+h_{1}^{eff})\right),$
(33)

but based on Eq.(21) and the fact that the network is $\sigma_{1}$-neutral, it
must be that $h_{k}^{eff}=0$ . Therefore,

$\displaystyle\langle\sigma_{1}\rangle=\tanh\left(\beta(h_{1}+h_{1}^{eff})\right)=\tanh(\beta
h_{1})=\braket{\sigma_{1}}_{uncoupled},$ (34)

where $\braket{\sigma_{1}}_{uncoupled}=\tanh(\beta h_{1})$ is the single spin
equilibrium average of $\sigma_{1}$, namely its mean when it is not connected
to any network. In other words, the above argument shows that the mean
magnetization of the spin $\sigma_{1}$ is not affected by a connection to any
$\sigma_{1}$-neutral network, and there is no spin echo-chamber effect in this
model.

###  4.3 Echo chambers in other models

The argument used above to show that there are no echo-chambers in the Ising
model, can be applied to any model with the property that the network
influence on a spin is independent of the local field. Namely, there is an
effective field in the model. In models for which an effective field can be
defined, the mean magnetization of $\sigma_{1}$ can be written as

$\displaystyle\langle\sigma_{1}\rangle=f\left(\beta(h_{1}+h_{1}^{eff})\right),$
(35)

where, as in the Ising model – $h_{1}$ is the field on the spin $\sigma_{1}$,
$h^{eff}_{1}$ is the influence of the network on the mean magnetization of
$\sigma_{1}$ and it is independent on $h_{1}$, and $f$ is the function that
relates the external field and the mean magnetization in an uncoupled spin for
the specific model – for example, in the Ising model $f(x)=\tanh(x)$. Since by
its definition, the effective field is independent of $h_{1}$, then without
loss of generality it can be calculated for the case $h_{1}=0$. But for
$\sigma_{1}$-neutral network $h_{1}^{eff}=0$ in this case. Thus, we have in
the above equation

$\displaystyle\langle\sigma_{1}\rangle=f\left(\beta
h_{1}\right)=\braket{\sigma_{1}}_{uncoupled},$ (36)

which implies that there is no spin echo-chamber effect in models for which an
effective field can be consistently defined. This also implies that models
with an echo-chamber effect would, in general, have no effective field as
defined above. However, it is not always easy to understand if an effective
field exists in the model or not – in fact, we are not familiar with other
models that have this property. Therefore, we next discuss a different
approach towards investigating the existence of the echo-chamber effect.

To directly test the existence of an echo-chamber in a model, we compare two
systems. In the first one there is a single, uncoupled spin. Its Hamiltonian
is therefore given by

$\displaystyle\mathcal{H}_{1}(\sigma_{1})=-\bar{h}_{1}\cdot\bar{\sigma}_{1}.$
(37)

In the general case $\bar{\sigma}_{1}$ is a vector or a tensor, and
$\bar{h}_{1}\cdot\bar{\sigma}_{1}$ is a scalar constructed from
$\bar{\sigma}_{1}$ and the vector or tensor $\bar{h}_{1}$. The partition
function, in this case is:

$\displaystyle Z_{1}=\sum_{\sigma_{1}}e^{\beta\bar{\sigma}_{1}\cdot\bar{h}},$
(38)

where the sum signifies either discrete summation over all possible spin
states (e.g.$\\{-1,0,1\\}$ for the case of spin $1$) or integration in the
case of a continuous variable (e.g. angles for the $XY$ model).

We compare this scenario to a second scenario in which the spin
$\bar{\sigma}_{1}$ is embedded in a network $G$ of spins with general coupling
$J_{i,j}$ and fields $\bar{h}_{i}$. We denote the full Hamiltonian as

$\displaystyle\mathcal{H}_{N}(\vec{\sigma})=-\sum_{i}\bar{h}\cdot\bar{\sigma}_{i}-\sum_{i,j}J_{i,j}\bar{\sigma}_{i}\cdot\bar{\sigma}_{j},$
(39)

where again $\vec{\sigma}=(\bar{\sigma}_{1},...\bar{\sigma}_{N})$, and the
partition function is

$\displaystyle Z_{N}$ $\displaystyle=$
$\displaystyle\sum_{\bar{\sigma}_{i}}e^{\beta\bar{\sigma}_{1}\cdot\bar{h}_{1}+\beta\sum_{i,j}J_{i,j}\bar{\sigma}_{i}\cdot\bar{\sigma}_{j}+\beta\sum_{i\neq
1}\bar{h}_{i}\cdot\bar{\sigma}_{i}}$ (40) $\displaystyle=$
$\displaystyle\sum_{\bar{\sigma}_{1}}e^{\beta\bar{\sigma}_{1}\cdot\bar{h}}\sum_{\sigma\neq\sigma_{1}}e^{\beta\sum_{i,j}J_{i,j}\bar{\sigma}_{i}\cdot\bar{\sigma}_{j}+\beta\sum_{i\neq
1}\bar{h}_{i}\cdot\bar{\sigma}_{i}}\left(e^{\beta\bar{\sigma}_{1}\cdot\sum_{\sigma_{k}\in
G_{1}}J_{1,k}\bar{\sigma}_{k}}\right).$

We define _strong echo-chamber symmetric models_ as models in which the term

$\displaystyle Z_{N-1}^{eff}(\bar{\sigma}_{1})=\sum_{\\{\bar{\sigma}_{k\neq
1}\\}}e^{\beta\sum_{i,j}J_{i,j}\bar{\sigma}_{i}\cdot\bar{\sigma}_{j}+\beta\sum_{i\neq
1}\bar{h}_{i}\cdot\bar{\sigma}_{i}}\left(e^{\beta\bar{\sigma}_{1}\cdot\sum_{\bar{\sigma}_{k}\in
G_{1}}J_{1,k}\bar{\sigma}_{k}}\right)$ (41)

is independent of the specific value of $\sigma_{1}$ for every neutral
network. In such models, $Z_{N-1}^{eff}(\sigma_{1})$ is not a function of
$\sigma_{1}$ and it is therefore possible to factorise the partition function:

$\displaystyle
Z_{N}=\left(\sum_{\bar{\sigma}_{1}}e^{\beta\bar{\sigma}_{1}\cdot\bar{h}_{1}}\right)\left(\sum_{\sigma\neq\sigma_{1}}e^{\beta\sum_{i,j}J_{i,j}\bar{\sigma}_{i}\cdot\bar{\sigma}_{j}+\beta\sum_{i\neq
1}\bar{h}_{i}\cdot\bar{\sigma}_{i}}\left(e^{\beta\bar{\sigma}_{1}\cdot\sum_{\sigma_{k}\in
G_{1}}J_{1,k}\bar{\sigma}_{k}}\right)\right)=Z_{1}\cdot Z_{N-1}^{eff}.$ (42)

This factorization of $Z_{N}$ implies that the magnetization of
$\bar{\sigma}_{1}$ is independent of the existence of the rest of the network,
and hence there is no echo-chamber effect in the model. To show this, we use,
again, the relation between the mean magnetization and partition function in
Eq.(2):

$\displaystyle\braket{\sigma_{1}}=\frac{\partial_{\bar{h}_{1}}Z}{\beta
Z}=\frac{\partial_{\bar{h}_{1}}Z_{1}\cdot Z_{N-1}^{eff}}{\beta Z_{1}\cdot
Z_{N-1}^{eff}}=\frac{\partial_{\bar{h}_{1}}Z_{1}}{\beta Z_{1}},$ (43)

which is identical to the single spin magnetization, and therefore implies
that there is no echo-chamber effect in the model.

As we have already seen by using the effective field method, the Ising model
is a rare example of a model with a strong echo-chamber symmetry. However,
there are several models with a _weak echo-chamber symmetry_ : in such models
$Z_{N-1}^{eff}$ is $\bar{\sigma}_{1}$ independent for networks where $h_{i}=0$
for all $i\neq 1$. In such models, There are no echo-chambers for spins
connected to networks that do not have additional local fields. Nevertheless,
they may still display an echo-chamber effect in $\sigma_{k}$-neutral networks
where the magnetic fields on different spins balance each other out. We next
discuss each of these different cases.

####  4.3.1 Models with strong Echo-chamber symmetry

We first show that the Ising model has strong echo-chamber symmetry. We do
this without employing effective field considerations, which turns out to be
instructive when considering other models. To this end, we use the fact that
the network is $\bar{\sigma}_{1}$-neutral. Therefore

$\displaystyle\braket{\bar{\sigma}_{1}}=\left.\frac{\partial_{\bar{h}_{1}}Z_{N}}{\beta
Z_{N}}\right|_{h_{1}=0,h_{2},h_{3}...h_{N}}=0,$ (44)

which implies that

$\displaystyle\left.\beta^{-1}\frac{\partial
Z_{N}}{\partial{\bar{h}_{1}}}\right|_{h_{1}=0,h_{2},h_{3}...h_{N}}=0.$ (45)

Substituting the expression for the partition function, we get that:

$\displaystyle\sum_{\sigma_{1}}\bar{\sigma}_{1}\sum_{\sigma\neq\sigma_{1}}e^{\beta\sum_{i,j}J_{i,j}\bar{\sigma}_{i}\cdot\bar{\sigma}_{j}+\beta\sum_{i\neq
1}\bar{h}_{i}\cdot\bar{\sigma}_{i}}\left(e^{\beta\bar{\sigma}_{1}\cdot\sum_{\sigma_{k}\in
G_{1}}J_{1,k}\bar{\sigma}_{k}}\right)=\sum_{\sigma_{1}}\sigma_{1}Z_{N-1}^{eff}(\sigma_{1})=0.$
(46)

Carrying out the sum over the two possibilities $\sigma_{1}=\pm 1$, we obtain:

$\displaystyle Z_{N-1}^{eff}(\sigma_{1}=+1)=Z_{N-1}^{eff}(\sigma_{1}=-1),$
(47)

and therefore a neutral network implies that $Z_{N-1}^{eff}$ is not a function
of $\sigma_{1}$, hence there is a strong echo-chamber symmetry in this model.

We note, however, that we do not expect many other models to be in the class
of the strong echo-chamber symmetry, as in general, Eq.(46) does not imply
Eq.(42) holds. Therefore, neutral networks in other models do not generally
imply the separability of the partition function.

####  4.3.2 Models with weak Echo-chamber symmetry

Whereas a $\sigma_{k}$-neutral network is not enough to eliminate the echo-
chamber effect in most models, a special case of interest is when the network
is $\sigma_{k}$-neutral because there are no magnetic fields in the system on
any spin except $\sigma_{k}$. The class of models that have the echo-chamber
symmetry in this special case but not for general $\sigma_{k}$-neutral
networks, which is the class of weak echo-chamber symmetric models, includes
models with the following spin-symmetry: for any change
$\sigma_{1}\to\hat{\sigma}_{1}$, there exist a one-to-one transformation
$\hat{\sigma}_{k}=F_{\sigma_{1}\to\hat{\sigma}_{1}}[\sigma_{k}]$ such that
$\sigma_{i}\sigma_{j}=\hat{\sigma}_{i}\hat{\sigma}_{j}$ for any $i$ and $j$.
Mathematically, this implies a symmetry group $F$ of invertible
transformations on the possible values of $\sigma$, such that the spin
multiplication in the Hamiltonian is invariant under the action of elements of
$F$. In this case, $Z_{N-1}^{eff}(\sigma_{1})$ is $\sigma_{1}$ independent
regardless of the specific values of $J_{ij}$.

To show that models with a symmetry transformation $F$ have the weak echo-
chamber symmetry, we note that a transformation
$\sigma_{1}\to\hat{\sigma}_{1}$ generally changes all the elements in the sum
over $\\{\sigma_{k\neq 1}\\}$ in the definition of $Z_{N-1}^{eff}$ (Eq. 41),
but each of them is equal to another element in the sum, given by the
realization corresponding to the transformation in which $\sigma_{k}\to
F_{\sigma_{1}\to\hat{\sigma}_{1}}[\sigma_{k}]$. Therefore, the contribution of
each configuration $\\{\sigma_{k\neq 1}\\}$ with $\sigma_{1}$ is equal to the
contribution of the configuration $\\{\hat{\sigma}_{k\neq 1}\\}$ with
$\hat{\sigma}_{1}$. This is a result of the multiplication between spins being
invariant under any group action, so replacing $\sigma_{i}\sigma_{j}$ with
$F_{\alpha}\sigma_{i}F_{\alpha}\sigma_{j}$ in $Z_{N-1}^{eff}$ does not change
its value for any $F_{\alpha}$ in the group. Therefore, the total sum is
independent of the value of $\sigma_{1}$. In other words, changing the value
of $\sigma_{1}$ reshuffles the order of the elements in the sum, but does not
change the summation value. We note, however, that even models that have no
such a transformation might nevertheless have the echo-chamber symmetry for
some specific realizations of $J_{ij}$.

An example for a model with a weak echo-chamber symmetry is the $XY$ model,
where $\sigma_{i}=(\cos\theta_{i},\sin\theta_{i})$. In this case, any change
of $\sigma_{1}\to\hat{\sigma}_{1}$ corresponds to some change in the angle
$\theta_{1}\to\hat{\theta}_{1}=\theta_{1}+\Delta\theta$. We can define the
transformation

$\hat{\theta}_{k}=F_{\theta_{1}\to\theta_{1}+\Delta\theta}[\theta_{k}]=F_{\Delta\theta}\theta_{k}=\theta_{k}+\Delta\theta,$

where $F_{\Delta\theta}$ is a rigid rotation of a spin by the corresponding
angle $\Delta\theta$. In this case the symmetry group is $SO(2)$, and it
preserves the multiplication in the Hamiltonian. In the absence of external
fields, a realization $\\{\theta_{k\neq 1}\\}$ contributes with $\theta_{1}$
exactly as the realization $\\{\hat{\theta}_{k\neq 1}\\}$ with
$\hat{\theta}_{1}$, and therefore the contribution of $Z_{N-1}^{eff}$ is
independent of the specific angle of $\sigma_{1}$. In this case, a change in
$\sigma_{1}$ can be viewed as a change in the reference frame, which does not
change $Z_{N-1}^{eff}$. However, this is not the case in the presence of
external fields $\vec{h}$, and therefore the model has only the weak but not
the strong echo-chamber symmetry. We note that any model with a similar
symmetry group that respects the two spins interaction (e.g., the Heisenberg
model and the vector Potts model [24]) has a weak echo-chamber symmetry that
protects the model from echo-chambers in the absence of external fields.
However, we also note that models with weak echo chamber symmetry generally do
not have an effective field, as this would imply that they have the strong
rather than the weak echo-chamber symmetry.

####  4.3.3 Models without Echo-chamber symmetry

Last, we note that many models of interest have neither the strong nor the
weak echo-chamber symmetry. Correspondingly, these models have an echo-chamber
effect for most realizations of neutral networks. An example for such a model
is the spin-1 Blume-Capel model [25, 26], where an echo chamber effect was
explicitly demonstrated in Sec. 3.2 .

##  5 Precise calculation of effective field and magnetization on tree
networks

In the previous section, we have shown that, for models with a strong echo-
chamber symmetry, the mean magnetization of each spin can be calculated using
an effective field approach, where the effective field is not a function of
the field on the spin itself. In this section, we show that in the case of the
Ising model on tree networks, the effective field can be calculated using a
relatively simple, closed formula. We then introduce an efficient algorithm
that uses this formula to calculate the mean magnetization on each spin and
the entire system.

###  5.1 Effective Field Formula

####  5.1.1 Leaf Spins:

To explain how the effective field developed above can be used to construct an
efficient algorithm to calculate the mean magnetization on a tree, consider
first a “leaf” edge on a tree, namely a spin connected to only one other spin.
Without loss of generality, let us denote the leaf spin as $\sigma_{1}$, and
the spin connected to is as $\sigma_{2}$. Using the effective field approach,
we know that

$\displaystyle\braket{\sigma_{1}}=\tanh\left(\beta(h_{1}+h^{eff}_{1})\right),$
(48)

and therefore our aim is to calculate $h^{eff}_{1}$, which can be done by
calculating $\braket{\sigma_{1}}$ with $h_{1}=0$. The latter is given by:

$\braket{\sigma_{1}}[h_{1}=0]=\frac{\sum_{\\{\sigma\\}}\sigma_{1}e^{\beta(\sum_{i}h_{i}\sigma_{i}+\sum_{\\{i,j\\}\in
G}J_{ij}\sigma_{i}\sigma_{j})}}{\sum_{\\{\sigma\\}}e^{\beta(\sum_{i}h_{i}\sigma_{i}+\sum_{\\{i,j\\}\in
G}J_{ij}\sigma_{i}\sigma_{j})}}.$ (49)

Next, we perform the summation over $\sigma_{1}=\pm 1$, and get:

$\braket{\sigma_{1}}[h_{1}=0]=\frac{\sum_{\\{\sigma_{k}\neq\sigma_{1}\\}}e^{\beta(\sum_{i\neq
1}h_{i}\sigma_{i}+\sum_{\\{i\neq 1,j\neq 1\\}\in
G}J_{ij}\sigma_{i}\sigma_{j})}\left(e^{\beta J_{1,2}\sigma_{2}}-e^{-\beta
J_{1,2}\sigma_{2}}\right)}{\sum_{\\{\sigma_{k}\neq\sigma_{1}\\}}e^{\beta(\sum_{i\neq
1}h_{i}\sigma_{i}+\sum_{\\{i\neq 1,j\neq 1\\}\in
G}J_{ij}\sigma_{i}\sigma_{j})}\left(e^{\beta J_{1,2}\sigma_{2}}+e^{-\beta
J_{1,2}\sigma_{2}}\right)}.$ (50)

We note that the term $\left(e^{\beta J_{1,2}\sigma_{2}}+e^{-\beta
J_{1,2}\sigma_{2}}\right)$ in the denominator is independent on the specific
value of $\sigma_{2}$, and is equal to $2\cosh(\beta J_{1,2})$. Similarly, the
term $\left(e^{\beta J_{1,2}\sigma_{2}}-e^{-\beta J_{1,2}\sigma_{2}}\right)$
is equal to $2\sigma_{2}\sinh(\beta J_{1,2})$ as $\sigma_{2}$ can only be $\pm
1$. We can therefore write:

$\braket{\sigma_{1}}[h_{1}=0]=\tanh(\beta
J_{1,2})\frac{\sum_{\\{\sigma_{k}\neq\sigma_{1}\\}}\sigma_{2}e^{\beta(\sum_{i\neq
1}h_{i}\sigma_{i}+\sum_{\\{i\neq 1,j\neq 1\\}\in
G}J_{ij}\sigma_{i}\sigma_{j})}}{\sum_{\\{\sigma_{k}\neq\sigma_{1}\\}}e^{\beta(\sum_{i\neq
1}h_{i}\sigma_{i}+\sum_{\\{i\neq 1,j\neq 1\\}\in
G}J_{ij}\sigma_{i}\sigma_{j})}}=\tanh(\beta
J_{1,2})\braket{\tilde{\sigma}_{2}}$ (51)

where $\braket{\tilde{\sigma}_{2}}$ is, by the expression in the middle, the
mean magnetization of $\sigma_{2}$ in a system where the spin $\sigma_{1}$ is
deleted, namely the leaf is trimmed from the graph. In terms of the effective
field, we can write:

$\displaystyle h_{1}^{eff}=\beta^{-1}\tanh^{-1}\Big{(}\tanh(\beta
J_{1,2})\braket{\tilde{\sigma}_{2}}\Big{)}$ (52)

This structure, in which $h_{1}^{eff}$ is calculated from a trimmed version of
the same tree, naturally calls for a recursion process. However, caution must
be made when using the above procedure, since (say in the above example)
$\sigma_{2}$ may be connected to more than two spins, so trimming $\sigma_{1}$
does not make $\sigma_{2}$ a leaf spin. As we next show, this result can be
generalized to non-leaf spins.

####  5.1.2 Non-Leaf Spins:

Consider a non-leaf spin; namely, it is connected to several spins. Let us
denote the specific spin by $\sigma_{k}$, and its neighboring spins by
$\sigma_{m}$…$\sigma_{n}$. Since the spin interaction network is a tree graph,
deleting the node associated with $\sigma_{k}$ would make each of the spins
connected with it $\sigma_{m}$…$\sigma_{n}$, part of a disconnected tree. We
denote these trees by the $G_{m}$…$G_{n}$ correspondingly, and with this
notation, we can write the Hamiltonian as:

$\displaystyle\mathcal{H}(\\{\sigma\\})=\left(\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}\left(\\{\sigma\\}\right)-J_{ki}\sigma_{k}\sigma_{i}\right)-h_{k}\sigma_{k},$
(53)

where

$\displaystyle\mathcal{H}_{i}(\\{\sigma\\})=-\sum_{\\{l,j\\}\in
G_{i}}J_{lj}\sigma_{l}\sigma_{j}-\sum_{j\in G_{i}}h_{j}\sigma_{j}.$ (54)

In other words, $\mathcal{H}_{i}(\\{\sigma\\})$ is the contribution to the
Hamiltonian from the sub-tree $G_{i}$.

Using the notation above, the mean magnetization of the non-leaf spin can be
written as:

$\braket{\sigma_{k}}[h_{k}=0]=\tanh\left(\sum_{h\in\\{m...n\\}}\tanh^{-1}(\tanh(\beta
J_{hk})\braket{\tilde{\sigma}_{h}})\right),$ (55)

which in terms of the effective field can be written as:

$\displaystyle
h_{k}^{eff}=\beta^{-1}\sum_{h\in\\{m...n\\}}\tanh^{-1}\Big{(}\tanh(\beta
J_{hk})\braket{\tilde{\sigma}_{h}}\Big{)}.$ (56)

In the above equation, $\braket{\tilde{\sigma}_{h}}$ is the mean of
$\sigma_{h}$ calculated using $\mathcal{H}_{h}$, namely as if we cut the
connection between the spins $k$ and $h$. The proof of this result involves
cumbersome, though straightforward algebra, and is therefore left to the
appendix (See appendix A).

As in the case of the leaf spin, here too the mean magnetization and effective
field on the spin $k$ can be calculated from the mean magnetization of the
sub-trees connected to the spin $k$. This enables a recursive and efficient
calculation of the mean magnetization of each spin, as described in the next
section.

###  5.2 Algorithm for precise magnetization calculation

The recursion formula for the effective field, as formulated above, allows
fast and precise calculation of the mean magnetization of any spin and over
the tree network as a whole. For clarity of presentation, the algorithm
described below is sub-optimal in terms of running time and memory allocation
but is simpler to implement. In this algorithm, we first reshape the tree
using the Breadth-first search (BFS) algorithm [27], such that the
calculations only involve leaf nodes, and never the more complicated case,
whereby trimming the node the tree becomes a set of disconnected trees.

To calculate the mean magnetization of a given spin, the algorithm first
reshapes the tree such that this spin is the tree root, using the BSF
algorithm, which for completeness is provided as a pseudo-code in Appendix B
(Algorithm 3). The effective field is then calculated recursively (Algorithm 2
in Appendix B), starting from the leaves of the resulting tree, removing them
after taking into account their effective field and its influence on their
neighbors using Eq.(56), and then repeating the same process with the
remaining tree until the root is the only node in the graph. By scanning the
mean magnetization of all the spins (Algorithm 1 in Appendix B), the mean
magnetization over the network can be calculated.

The time complexity of this procedure can be compared to the complexity of the
direct calculation of the total magnetization by averaging over all
microstates, namely all configurations of the system. The time it takes to
calculate the mean magnetization in the latter case scales as the number of
microstates of the networks, therefore it grows at least exponentially with
the number of spins $N$, namely it is $\mathcal{O}(e^{N})$. On the other hand,
the algorithm presented above includes, for each node, a BFS step required to
calculate the depth and parents structure given a specific root and then
backtracking over the resulting structure to calculate the effective field.
Both of these scale with the number of nodes in the system as $\mathcal{O}(N)$
[27]. Since this process is repeated for each node the resulting time
complexity is $O(N^{2})$ (shown in figure 2), which is significantly faster
than direct averaging over the microstates. The algorithm may be made more
efficient if one exploits the fact that the trees with nearby roots are very
similar in structure. We leave such improvements to later work.

To summarize, the lack of echo-chamber effect in the Ising model translates
into a significant decrease in the complexity for calculating the mean
magnetization.

Figure 2: Run time of the algorithm as a function of the number of spins in
the tree (in thousands). As expected, an $\mathcal{O}(N^{2})$ dependence is
observed.

##  6 Employing the effective field algorithm

In this section, we demonstrate the strength of the method presented above on
two examples that incorporate large tree networks with hundreds of nodes.

###  6.1 Random Field Ising Model on the Bethe Lattice

Let us demonstrate the algorithm developed above on the famous problem of the
Random Field Ising Model (RFIM) on the Bethe lattice [14, 15, 16]. The RFIM is
described by the following Hamiltonian,

$\displaystyle\mathcal{H}=-J\sum_{\\{i,j\\}\in
G}\sigma_{i}\sigma_{j}-\sum_{i}h_{i}\sigma_{i}.$ (57)

Specifically, we are interested in the case where $G$ is the Bethe lattice, a
tree-graph where each spin is connected to the same number of other spins. The
number of neighbors each spin has in the tree is called _the coordination
number_ of the graph. The left panel of Fig.(3) depicts the Bethe lattice with
coordination number 4. In the thermodynamic limit, this model exhibits a phase
transition from a ferromagnetic phase for small random fields to a
paramagnetic phase for large fields [14, 15]. It is, therefore, a good example
where averaging the magnetization over different realizations of the quenched
disorder can be useful. To this end, we performed the following calculation on
a Bethe lattice with 485 spins, coordination number 4 (each spin in the bulk
has four neighbors), and five shells, namely from the center of the graph
there are five steps until the boundary is reached (see Fig.3). For each value
of the temperature $T$ and standard deviation $h_{0}$ of the random fields
$h_{i}$, we chose 100 different realizations of $\vec{h}$, and for each of
these realizations the mean magnetization in the lattice was calculated. The
right panel in Fig.(3) shows the quenched mean magnetization. We note that in
order not to average positive and negative magnetization in the ordered phase,
we average over $m=|N^{-1}\sum_{i}\sigma_{i}|$, but in a finite system, the
absolute value implies that $m$ is not zero, but rather scales as $N^{-0.5}$
even in the disordered phase.

In this example, we used the algorithm developed above to exactly calculate
the magnetization in each realization, as a “tour de force” application on a
system where much is known on its phase diagram [15]. However, the algorithm
is quite general and can be used on many other applications, as we show below.

Figure 3: RFIM on the Bethe lattice. Left panel: the Bethe lattice with
coordination number 4 and 5 shells on which the mean magnetization was
calculated. Right panel: the mean magnetization on this lattice, with random
fields sampled from a Gaussian distribution with variance $h_{0}$ and
temperature $T$.

###  6.2 Influence maximization

In this section, we use the algorithm introduced earlier to solve a problem
with a similar flavor to the echo-chamber effect, which is the main motivation
in this manuscript: influence maximization for large social network [11, 23,
20]. In this problem, the goal is to find a small seed in a social network
that could maximize the spread of influence. We assume a network of agents
with two competing opinion states, such that “+1” represents the preferred
opinion, and “-1” the opposite opinion. The agents have social interaction
that tends to “align" their opinions; namely, an agent tends to change its
opinion towards the mean opinion of the agents it is socially connected with.
Two additional influences on each agent are: (i) some internal tendency to
switch opinion, which we assume to be uniform among all agents. This mechanism
is commonly modeled as random fluctuations induced by the physical temperature
of the system; (ii) External influence on each agent that can come from
advertisements or any other source. This influence is commonly modeled as an
external magnetic field on each network node.

Such problems are commonly analyzed using the ferromagnetic Ising model
described above, where the mean opinion in the network is given by the mean
magnetization at thermal equilibrium [28, 23, 20, 29, 30, 21]. The main
question is then as follows: given a limited budget of external influence (say
a limit budget for advertisement), modeled as a limited amount of external
field denoted by

$H=\sum_{i}h_{i},$

where $h_{i}$ is the local external influence on the site $i$ and $H$ is the
total external influence, how should one partition the external influence
between the different spins as to maximize mean network magnetization. In
other words, find the set $\\{h_{i}\\}$ that maximizes
$\braket{m}=\braket{\sum_{i}\sigma_{i}}$ under the constraints
$\sum_{i}h_{i}=H$ and $h_{i}>0$. Mathematically, this can be phrased as:

$h_{i}=\arg\underset{h_{i}>0}{\text{max }}\text{ }\langle
m[h_{i},J,H,\beta]\rangle$ (58) $\text{ s.t. }\sum_{i=0}^{N}h_{i}=H$

This problem was already addressed in the literature, using mean-field
approximation or numerical simulations [28, 23, 20, 29]. In the limit of weak
field (small $H$), it was shown that the optimal field is strongest at the
hubs. Conversely, the optimal field is stronger on the leaves in the strong
field limit (large $H$). Using the above method, we calculated the exact
magnetization on a large network for different values of the magnetic field on
each node. Using the recursive algorithm introduced in Sec.5.2, we can
efficiently calculate the exact value of the total magnetization for each set
of local fields $h_{i}$. Therefore, we could use the Sequential
Linear/Quadratic Programming (SLQP) method for optimization [31], with which
we found the set $\\{h_{i}^{opt}\\}$ that maximizes magnetization for a given
total field H. Here we choose to work with a Barabasi-Albert random graph,
where the degree (the number of neighbors each spin has) is distributed as a
power-law [22], to decrease the probability for loops. The specific graphs we
chose (see example in figure 4) do not contain any loops, so the solution
provided by the recursive method is the exact solution.

In general, one may still use this method to approximate non-tree graphs. In
such cases, when the algorithm encounters a node that closes a loop, it
considers it as connected separately to the first neighbor and then separately
to the second one. The second-order connection between the neighbors are
ignored, which provide a small correction that can be negligible in the case
of very few loops.

Earlier work [28, 23, 20, 29, 30, 21] has shown that the optimal field should
be stronger for the high-connectivity nodes where the total field H is small
and stronger on the lower-degree nodes where H is large. In figure 4 we plot
the normalized optimal field for each node vs. the node’s degree for three
different values of the total field H. The presented results depict averages
over $R=12$ realizations of Barabasi-Albert graphs with $N=100$ spins and
overall nodes with similar degrees (error bars represent the standard error of
the mean). As expected, when the total field is weak (H=1) the optimal field
is concentrated mostly on the hubs, and when the total field is stronger
(H=30), it is concentrated mostly on the leaves. For an intermediate fields
strength (H=3), we find that the optimal influence is obtained by
concentrating the external field on nodes of intermediate degree (rather than
dividing it it between hubs and leaves). Note that these results are general,
and are not limited to the BA network [28, 23, 20, 29, 30, 21]. The assumption
in previous work was that the qualitative behavior of the optimal field
depends mostly on a node’s degree and less so on the structure of the network.
Our results show that, even though the average behavior matches with the above
assumption, there is significant variation between the optimized local fields
on different nodes with the same degree. Our method does not require symmetry
assumption and allows for more accurate influence maximization schemes rather
than general behaviors.

We note in passing that the dual problem, namely influence minimization, has a
somewhat simpler solution: the convexity of the mean magnetization of a spin
as a function of the field on it implies that focusing all the field on the
spin that has the least effect on the network minimizes the influence of the
field on the network.

Figure 4:  Influence maximization on a social network. Left panel: A sample of
a scale-free network with $N=100$ nodes. The graph was generated using the
Barabashi-Albert model. Right panel: Optimal local field for each node in the
network, averaged over 12 different graphs (with $N=100$ nodes each,
altogether 1200 nodes). The different colors stand for different value of the
total field H (see legend). The results are binned by node degree (the
x-axis), allowing us to compare data from networks with different degree
distributions. The horizontal error bars are the standard deviation of the
degrees of the nodes around each specific bin. We find that the optimal field
shift from focusing on the hubs at the weak total field to the leaves at the
strong total field. The vertical error bars represent the standard error of
the mean across all nodes in a bin and show a significant deviation in the
local field between nodes with similar (as well as equal) degrees. Since we
consider a power-law graph, the number of nodes with a high degree is much
smaller than the number of nodes with a low degree, which means that for H=1
(magenta) the field on the hubs is macroscopic, while for H=30 (black) where
the field focus on the leaves, it is divided between many nodes, thus for each
leaf, it is quite small.

##  7 Conclusions

In this manuscript, we have shown that there is no echo-chamber effect in the
Ising model. For other spin models, we identified symmetry that forbids the
existence of echo-chambers. This symmetry can be strong – as in the Ising
model, and then it prevents any echo-chambers, or it can be weak – in this
case echo-chambers may exist, but only when there are additional fields in the
system. A consequence of the lack of echo-chambers in the Ising model is that
the mean magnetization of such networks can be efficiently solved in tree
graphs, based on effective field calculations. We used this technique to
construct an algorithm for finding the mean magnetization in tree graphs. We
demonstrated it in two applications: the RFIM on the Bethe lattice and
influence maximization.

When an external field is applied on a spin, it biases the spin itself and all
the spins connected to it towards the states that minimize the energy at this
field. Nevertheless, this bias does not generate echo-chambers in the Ising
model. The lack of echo-chamber effect and the existence of an effective
field, in this case, are a consequence of the exact cancellation of two
different effects: (i) Even in the presence of the external bias, the states
of neighboring spins fluctuate, such that they spend more time in the low
energy state; (ii) The low energy states of the neighboring spins generate a
smaller bias on the spin, in comparison to the high energy states. The fact
that these two factors exactly cancel each other is not guaranteed in all
models. In fact, the Ising model is a unique case, such that this cancellation
occurs even in the presence of additional fields. Other models, such as the
XY, Heisenberg, and the vector Potts models, display a weak echo-chamber
symmetry, where such cancellations occur only in the absence of external
fields in the network.

The existence of an effective field in the Ising model can be interpreted as a
stronger version of a “no echo-chambers” result, since it implies that an
effective field can describe the impact of the network on the spin,
$h^{eff}_{1}$, which is independent of the field on the specific spin,
$h_{1}$. This is true even if the network is not $\sigma_{1}$-neutral, and
therefore can be viewed as a generalization of the no echo-chambers result:
the mean magnetization of the spin does not feedback through the network to
change its magnetization, even if the network is not neutral for that spin.

The expression for the effective field turned out to have a simple recursion
structure in tree networks. Although we have shown that the effective field
exists even in non-tree graphs (namely graphs that have loops), the general
expression of the effective field for such graphs is not yet known. Extending
our result to general graphs is expected to be quite difficult, as the problem
of finding the mean magnetization of every spin in a general network is
equivalent, in the low-temperature limit, to finding the ground state of the
network – a problem which is known to be NP-complete [32]. Similarly, the
separability of the partition function in Eq.(42) only holds for
$\sigma_{1}$-neutral networks; therefore, generally, it cannot be applied
iteratively since $Z^{eff}_{N-1}$ does not correspond to a neutral network.

Applications of our results for physical systems, especially magnets, are of
interest: do physical magnets display an echo-chamber effect? This question is
interesting in both macroscopic systems, where ergodicity breaking implies
that our results do not hold, as well as in microscopic systems (e.g., trapped
ions [33]) where applying a magnetic field on each spin separately is often
used, and the existence or non-existence of echo-chamber effect is therefore
of interest.

A natural question that we did not address concerns the cases where a spin
echo-chamber effect exists, as in the spin-1 Blum-Capel model: does the
existence of the effect imply that the mean magnetization of a spin coupled to
a $\sigma_{k}$-natural network is always larger than the mean magnetization of
a single spin (as in the example in section 3.2), or is it possible that
coupling with a $\sigma_{k}$-natural network reduces the mean magnetization of
$\sigma_{k}$? Additional questions of similar interest are the existence of
the effect in non-equilibrium systems (e.g., a network with different
temperatures for different spins) which is natural for influence maximization
problem, or in the thermodynamic limit where phase transitions and the
corresponding ergodicity breaking might change our results even in models that
do have the echo-chamber symmetry defined above. It would also be of interest
to understand the role of echo-chamber effect on opinion dynamic models, for
example, by comparing models with and without the echo-chamber symmetry.

We note that the algorithm we constructed is not optimal in terms of run-time,
memory allocation, or any other standard performance measure. For example, it
might be improved by optimizing its traverse over the tree when calculating
the effective field.

Lastly, we note that the Ising model is quite special in that it lacks echo-
chambers regardless of the network: most other models do contain echo-
chambers, even in neutral networks. This special feature must be considered
when using Ising spins in modeling opinion dynamics, especially when echo-
chamber effects can play an essential role in the results.

## Acknowledgements

We would like to thank David Mukamel for useful discussions. We thank Anton
Charkin-Gorbulin for help with the BFS algorithm. O.R. is the incumbent of the
Shlomo and Michla Tomarin career development chair, and is supported by the
Abramson Family Center for Young Scientists, the Minerva and by the Israel
Science Foundation, Grant No. 950/19. O.F. is the incumbent of the of the
Henry J Leir Professorial chair and is supported by the Israel Science
Foundation, Grant No. 1727/20, the Minerva Foundation, and the European
Research Council (ERC) under the European Unions Horizon 2020 research and
innovation program (Grant agreement No. 770964).

## References

  * [1] Kathleen Hall Jamieson and Joseph N Cappella.  Echo chamber: Rush Limbaugh and the conservative media establishment.  Oxford University Press, 2008.
  * [2] Christopher Currin, Sebastian Vallejo Vera, and Ali Khaledi-Nasab.  Depolarization of echo chambers by random dynamical nudge.  arXiv preprint arXiv:2101.04079, 2021.
  * [3] Matteo Cinelli, Gianmarco De Francisci Morales, Alessandro Galeazzi, Walter Quattrociocchi, and Michele Starnini.  The echo chamber effect on social media.  Proceedings of the National Academy of Sciences, 118(9), 2021.
  * [4] Elizabeth Dubois and Grant Blank.  The echo chamber is overstated: the moderating effect of political interest and diverse media.  Information, communication & society, 21(5):729–745, 2018.
  * [5] Axel Bruns, Brenda Moon, Felix Münch, and Troy Sadkowsky.  The australian twittersphere in 2016: Mapping the follower/followee network.  Social Media+ Society, 3(4):2056305117748162, 2017.
  * [6] Marc Esteve Del Valle and Rosa Borge Bravo.  Echo chambers in parliamentary twitter networks: The catalan case.  International journal of communication, 12:21, 2018.
  * [7] Ferenc Huszár, Sofia Ira Ktena, Conor O’Brien, Luca Belli, Andrew Schlaikjer, and Moritz Hardt.  Algorithmic amplification of politics on twitter.  Proceedings of the National Academy of Sciences, 119(1), 2022.
  * [8] Raj Kumar Pathria and Paul D Beale.  Statistical mechanics, 2011.
  * [9] Mauro Mobilia, Anna Petersen, and Sidney Redner.  On the role of zealotry in the voter model.  Journal of Statistical Mechanics: Theory and Experiment, 2007(08):P08029, 2007.
  * [10] Andrew T Hartnett, Emmanuel Schertzer, Simon A Levin, and Iain D Couzin.  Heterogeneous preference and local nonlinearity in consensus decision making.  Physical review letters, 116(3):038701, 2016.
  * [11] Shihuan Liu, Lei Ying, and Srinivas Shakkottai.  Influence maximization in social networks: An ising-model-based approach.  In 2010 48th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pages 570–576. IEEE, 2010.
  * [12] David Kempe, Jon Kleinberg, and Éva Tardos.  Maximizing the spread of influence through a social network.  In Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 137–146, 2003.
  * [13] S Galam.  Universality of group decision making.  In Traffic and Granular Flow’99, pages 57–67. Springer, 2000\.
  * [14] R Bruinsma.  Random-field ising model on a bethe lattice.  Physical Review B, 30(1):289, 1984.
  * [15] Thomas Nowotny, Heiko Patzlaff, and Ulrich Behn.  Phase diagram of the random field ising model on the bethe lattice.  Physical Review E, 65(1):016127, 2001.
  * [16] Pavel M Bleher, J Ruiz, and Valentin A Zagrebnov.  On the phase diagram of the random field ising model on the bethe lattice.  Journal of statistical physics, 93(1):33–78, 1998.
  * [17] Noah E Friedkin and Eugene C Johnsen.  Social positions in influence networks.  Social networks, 19(3):209–222, 1997.
  * [18] Wan-Shiou Yang, Jia-Ben Dia, Hung-Chi Cheng, and Hsing-Tzu Lin.  Mining social networks for targeted advertising.  In Proceedings of the 39th Annual Hawaii International Conference on System Sciences (HICSS’06), volume 6, pages 137a–137a. IEEE, 2006\.
  * [19] Dietrich Stauffer.  Social applications of two-dimensional ising models.  American Journal of Physics, 76(4):470–473, 2008.
  * [20] Christopher W Lynn and Daniel D Lee.  Statistical mechanics of influence maximization with thermal noise.  EPL (Europhysics Letters), 117(6):66001, 2017.
  * [21] Guillermo Romero Moreno, Long Tran-Thanh, and Markus Brede.  Continuous influence maximisation for the voter dynamics: Is targeting high-degree nodes a good strategy?  In Proceedings of the 19th International Conference on Autonomous Agents and MultiAgent Systems, pages 1981–1983, 2020.
  * [22] Albert-László Barabási.  Network science book.  Network Science, 625, 2014.
  * [23] Christopher Lynn and Daniel D Lee.  Maximizing influence in an ising network: A mean-field optimal solution.  Advances in neural information processing systems, 29:2495–2503, 2016.
  * [24] Fa-Yueh Wu.  The potts model.  Reviews of modern physics, 54(1):235, 1982.
  * [25] M Blume.  Theory of the first-order magnetic phase change in u o 2.  Physical Review, 141(2):517, 1966.
  * [26] HW Capel.  On the possibility of first-order phase transitions in ising systems of triplet ions with zero-field splitting.  Physica, 32(5):966–988, 1966.
  * [27] Jaime Silvela and Javier Portillo.  Breadth-first search and its application to image processing problems.  IEEE Transactions on Image Processing, 10(8):1194–1199, 2001.
  * [28] Markus Brede, Valerio Restocchi, and Sebastian Stein.  Transmission errors and influence maximization in the voter model.  Journal of Statistical Mechanics: Theory and Experiment, 2019(3):033401, 2019.
  * [29] Christopher W Lynn and Daniel D Lee.  Maximizing activity in ising networks via the tap approximation.  In Thirty-Second AAAI Conference on Artificial Intelligence, 2018\.
  * [30] Guillermo Romero Moreno, Long Tran-Thanh, and Markus Brede.  Shielding and shadowing: A tale of two strategies for opinion control in the voting dynamics.  In International Conference on Complex Networks and Their Applications, pages 682–693. Springer, 2019.
  * [31] Sven Leyffer and Ashutosh Mahajan.  Nonlinear constrained optimization: methods and software.  Argonee National Laboratory, Argonne, Illinois, 60439, 2010.
  * [32] Francisco Barahona.  On the computational complexity of ising spin glass models.  Journal of Physics A: Mathematical and General, 15(10):3241, 1982\.
  * [33] Shlomi Kotler, Nitzan Akerman, Nir Navon, Yinnon Glickman, and Roee Ozeri.  Measurement of the magnetic interaction between two bound electrons of two separate ions.  Nature, 510(7505):376–380, 2014.

## Appendices

##  Appendix A Detailed proof for the formula of the effective field in a
junction

In this appendix, we give the detailed calculation that proves the effective
field formula for a junction,

$\braket{\sigma_{k}}[h_{k}=0]=\tanh\left(\sum_{h\in\\{m...n\\}}\tanh^{-1}(\tanh(\beta
J_{hk})\braket{\tilde{\sigma}_{h}})\right),$ (59)

where again $k$ is the junction spin index, and $m...n$ are the indices of the
spins connected to the junction, and as before $\braket{\tilde{\sigma}_{h}}$
is the mean magnetization of the spin $h$ when the connection to the spin $k$
does not exist.

We can write the mean magnetization for $h_{k}=0$, using the decomposition of
the Hamiltonian as in the main text, namely

$\displaystyle\mathcal{H}(\\{\sigma\\})=\left(\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}\left(\\{\sigma\\}\right)-J_{ki}\sigma_{k}\sigma_{i}\right)-h_{k}\sigma_{k}$
(60)

where

$\displaystyle\mathcal{H}_{i}(\\{\sigma\\})=-\sum_{\\{l,j\\}\in
G_{i}}J_{lj}\sigma_{l}\sigma_{j}-\sum_{j\in G_{i}}h_{j}\sigma_{j}.$ (61)

The mean magnetization of $h_{k}$ is:

$\braket{\sigma_{k}}[h_{k}=0]=\frac{\sum_{\\{\sigma\\}}\sigma_{k}e^{-\beta\mathcal{H}(\\{\sigma\\})}}{\sum_{\\{\sigma\\}}e^{-\beta\mathcal{H}(\\{\sigma\\})}}=\frac{\sum_{\\{\sigma\\}}\sigma_{k}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}-J_{ki}\sigma_{k}\sigma_{i}}}{\sum_{\\{\sigma\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}-J_{ki}\sigma_{k}\sigma_{i}}}$
(62)

Now, we can perform the summation over $\sigma_{k}=\pm 1$. Let us do that
first for the denominator:

$\displaystyle\sum_{\\{\sigma\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}-J_{ki}\sigma_{k}\sigma_{i}}$
$\displaystyle=$
$\displaystyle\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}+J_{ki}\sigma_{i}}+\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}-J_{ki}\sigma_{i}}$
(63) $\displaystyle=$
$\displaystyle\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}}\cosh\left(\beta\sum_{i\in\\{m...n\\}}J_{ki}\sigma_{i}\right)$

and similarly to the numerator:

$\displaystyle\sum_{\\{\sigma\\}}\sigma_{k}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}+J_{ki}\sigma_{k}\sigma_{i}}$
$\displaystyle=$
$\displaystyle\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}+J_{ki}\sigma_{i}}-\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}-J_{ki}\sigma_{i}}$
(64) $\displaystyle=$
$\displaystyle\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}e^{-\beta\sum_{i\in\\{m...n\\}}\mathcal{H}_{i}}\sinh\left(-\beta\sum_{i\in\\{m...n\\}}J_{ki}\sigma_{i}\right)$

The above expressions involve hyperbolic cosine and sine of sums. We therefore
next use the relations $\cos({\bf i}x)=\cosh(x)$ and $\sin({\bf i}x)={\bf
i}\sinh({\bf i}x)$ where ${\bf i}=\sqrt{-1}$, and the known identities for
$\cos$ and $\sin$ of sum of angles, to write:

$\displaystyle\cosh\left(\beta\sum_{i\in\\{m...n\\}}J_{ki}\sigma_{i}\right)=\cos\left({\bf
i}\beta\sum_{i\in\\{m...n\\}}J_{ki}\sigma_{i}\right)=\sum_{r\hbox{
even}}(-1)^{r/2}\sum_{A\subseteq\\{1,2,...\\},|A|=r}\left(\prod_{h\in
A}\sin({\bf i}\beta J_{kh}\sigma_{h})\prod_{h\not\in A}\cos({\bf i}\beta
J_{kh}\sigma_{h})\right)$ $\displaystyle=$ $\displaystyle\sum_{r\hbox{
even}}(-1)^{r/2}\sum_{A\subseteq\\{m...n\\},|A|=r}{\bf i}^{r}\left(\prod_{h\in
A}\sinh(\beta J_{kh}\sigma_{h})\prod_{h\not\in A}\cosh(\beta
J_{kh}\sigma_{h})\right)$ (65) $\displaystyle=$
$\displaystyle\sum_{A\subseteq\\{m...n\\},|A|\hbox{ even}}\left(\prod_{h\in
A}\sigma_{h}\sinh(\beta J_{kh})\prod_{h\not\in A}\cosh(\beta J_{kh})\right)$

where we have used ${\bf i}^{r}=(-1)^{r/2}$, and in the last line that
$\cosh(\beta J_{kh})=\cosh(\beta J_{kh}\sigma_{h})$ and $\sinh(\beta
J_{kh}\sigma_{h})=\sigma_{h}\sinh(\beta J_{kh})$for both $\sigma_{h}=1$ and
$\sigma_{h}=-1$. A similar expression for $\sinh$ of a sum is given by:

$\displaystyle\sinh\left(-\beta\sum_{i\in\\{m...n\\}}J_{ki}\sigma_{i}\right)$
$\displaystyle=$ $\displaystyle-{\bf i}\sinh\left(-{\bf
i}\beta\sum_{i\in\\{m...n\\}}J_{ki}\sigma_{i}\right)$ (66) $\displaystyle=$
$\displaystyle-{\bf i}\sum_{r\hbox{
odd}}(-1)^{(r-1)/2}\sum_{A\subseteq\\{m...n\\},|A|=r}\left(\prod_{h\in
A}\sin(-{\bf i}\beta J_{kh}\sigma_{h})\prod_{h\not\in A}\cos(-{\bf i}\beta
J_{kh}\sigma_{h})\right)$ $\displaystyle=$ $\displaystyle{\bf i}\sum_{r\hbox{
odd}}(-1)^{(r-1)/2}\sum_{A\subseteq\\{m...n\\},|A|=r}\left(\prod_{h\in A}{\bf
i}\sinh(\beta J_{kh}\sigma_{h})\prod_{h\not\in A}\cosh(\beta
J_{kh}\sigma_{h})\right)$ $\displaystyle=$ $\displaystyle\sum_{r\hbox{
odd}}(-1)^{(r-1)/2}\sum_{A\subseteq\\{m...n\\},|A|=r}{\bf
i}^{r+1}\left(\prod_{h\in A}\sinh(\beta J_{kh}\sigma_{h})\prod_{h\not\in
A}\cosh(\beta J_{kh}\sigma_{h})\right)$ $\displaystyle=$
$\displaystyle-\sum_{A\subseteq\\{m...n\\},|A|\hbox{ odd}}\left(\prod_{h\in
A}\sigma_{h}\sinh(\beta J_{kh})\prod_{h\not\in A}\cosh(\beta J_{kh})\right)$

Using the above in Eq.(62), we can write

$\displaystyle\braket{\sigma_{k}}[h_{k}=0]$ $\displaystyle=$
$\displaystyle\frac{\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}\sum_{A\subseteq\\{m...n\\},|A|\hbox{
odd}}\left(\prod_{h\in A}\sigma_{h}\sinh(\beta
J_{kh})e^{-\beta\mathcal{H}_{h}}\prod_{h\not\in A}\cosh(\beta
J_{kh})e^{-\beta\mathcal{H}_{h}}\right)}{\sum_{\\{\sigma_{j}\neq\sigma_{k}\\}}\sum_{A\subseteq\\{m...n\\},|A|\hbox{
even}}\left(\prod_{h\in A}\sigma_{h}\sinh(\beta
J_{kh})e^{-\beta\mathcal{H}_{h}}\prod_{h\not\in A}\cosh(\beta
J_{kh})e^{-\beta\mathcal{H}_{h}}\right)}$ (67) $\displaystyle=$
$\displaystyle\frac{\sum_{A\subseteq\\{m...n\\},|A|\hbox{
odd}}\left(\prod_{h\in A}\braket{\tilde{\sigma}_{h}}\sinh(\beta
J_{kh})\tilde{Z}_{h}\prod_{h\not\in A}\cosh(\beta
J_{kh})\tilde{Z}_{h}\right)}{\sum_{A\subseteq\\{m...n\\},|A|\hbox{
even}}\left(\prod_{h\in A}\braket{\tilde{\sigma}_{h}}\tilde{Z}_{h}\sinh(\beta
J_{kh})\prod_{h\not\in A}\cosh(\beta J_{kh})\tilde{Z}_{h}\right)}$
$\displaystyle=$
$\displaystyle\frac{\left(\prod_{h\in\\{m...n\\}}\tilde{Z}_{h}\right)\sum_{A\subseteq\\{m...n\\},|A|\hbox{
odd}}\left(\prod_{h\in A}\braket{\tilde{\sigma}_{h}}\sinh(\beta
J_{kh})\prod_{h\not\in A}\cosh(\beta
J_{kh})\right)}{\left(\prod_{h\in\\{m...n\\}}\tilde{Z}_{h}\right)\sum_{A\subseteq\\{m...n\\},|A|\hbox{
even}}\left(\prod_{h\in A}\braket{\tilde{\sigma}_{h}}\sinh(\beta
J_{kh})\prod_{h\not\in A}\cosh(\beta J_{kh})\right)}$ $\displaystyle=$
$\displaystyle\frac{\sum_{A\subseteq\\{m...n\\},|A|\hbox{
odd}}\left(\prod_{h\in A}\braket{\tilde{\sigma}_{h}}\sinh(\beta
J_{kh})\prod_{h\not\in A}\cosh(\beta
J_{kh})\right)}{\sum_{A\subseteq\\{m...n\\},|A|\hbox{ even}}\left(\prod_{h\in
A}\braket{\tilde{\sigma}_{h}}\sinh(\beta J_{kh})\prod_{h\not\in A}\cosh(\beta
J_{kh})\right)}$

where $\tilde{Z}_{h}$ is the partition function associated with
$\mathcal{H}_{h}$.

Next, we show that this expression is also equal to

$\braket{\sigma_{k}}[h_{k}=0]=\tanh\left(\sum_{h\in\\{m...n\\}}\tanh^{-1}(\tanh(\beta
J_{hk})\braket{\tilde{\sigma}_{h}})\right)$ (68)

Let us open this expression using the formula for
$\tanh\left(\sum\theta_{i}\right)$, which can be derived from those of $\sinh$
and $\cosh$ of sums we used above. The general formula is given by

$\tanh\left(\sum\theta_{i}\right)=\frac{\sum_{\text{odd
r}}\sum_{A\subseteq\\{1,2,3...\\},|A|=r}\prod_{i\in
A}\tanh(\theta_{i})}{\sum_{\text{even r}\geq
0}\sum_{A\subseteq\\{1,2,3...\\},|A|=r}\prod_{i\in A}\tanh(\theta_{i})}$ (69)

and applying it to our case gives:

$\displaystyle\tanh\left(\sum_{h\in\\{m...n\\}}\tanh^{-1}(\tanh(\beta
J_{hk})\braket{\tilde{\sigma}_{h}})\right)=\frac{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{
odd}}\prod_{h\in A}\tanh(\beta
J_{hk})\braket{\tilde{\sigma}_{h}}}{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{
even}}\prod_{h\in A}\tanh(\beta J_{hk})\braket{\tilde{\sigma}_{h}}}$
$\displaystyle=\frac{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{ odd}}\prod_{h\in
A}\frac{\sinh(\beta J_{hk})\braket{\tilde{\sigma}_{h}}}{\cosh(\beta
J_{hk})}}{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{ even}}\prod_{h\in
A}\frac{\sinh(\beta J_{hk})\braket{\tilde{\sigma}_{h}}}{\cosh(\beta J_{hk})}}$
$\displaystyle=\frac{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{
odd}}\left(\prod_{h\in\\{m...n\\}}\cosh^{-1}(\beta J_{hk})\right)\prod_{h\in
A}\sinh(\beta J_{hk})\braket{\tilde{\sigma}_{h}}\prod_{h\not\in A}\cosh(\beta
J_{hk})}{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{
even}}\left(\prod_{h\in\\{m...n\\}}\cosh^{-1}(\beta J_{hk})\right)\prod_{h\in
A}\sinh(\beta J_{hk})\braket{\tilde{\sigma}_{h}}\prod_{h\not\in A}\cosh(\beta
J_{hk})}$ $\displaystyle=\frac{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{
odd}}\prod_{h\in A}\sinh(\beta
J_{hk})\braket{\tilde{\sigma}_{h}}\prod_{h\not\in A}\cosh(\beta
J_{hk})}{\sum_{A\subseteq\\{m...n\\},|A|=r\hbox{ even}}\prod_{h\in
A}\sinh(\beta J_{hk})\braket{\tilde{\sigma}_{h}}\prod_{h\not\in A}\cosh(\beta
J_{hk})}$ (70)

which is exactly the end result of Eq.(67). We therefore proved Eq.(59), as
required.

##  Appendix B Pseudo-code for the algorithm that finds the mean magnetization

1

Input: Graph,field_array

Output: total_mag

2

3total_mag = 0

4 for  _node $\in$ Graph_ do

5 BFS(Graph,node)

6 total_mag+=$\tanh(node.h+Recursive\\_Effective\\_Field(\textit{node}))$

7

8return total_mag

Algorithm 1 Network Total Magnetization

1

Input: root

Output: node_effective_field

2

3node_mag = root.h

4for  _children in root.children_ do

5 h=Recursive_Effective_Field(children.h)

6 node_mag +=$\tanh^{-1}(\tanh(\beta J)\tanh(\beta h))$

7

8return node_effective_field

Algorithm 2 Recursive_Effective_Field

1

Input: Graph,root

2 nodes_to_visit = []

3 visited_nodes = [] nodes_to_visit.add_element(root)

4 visited_nodes.add_element(root)

5while  _nodes_to_visit is not empty_ do

6 parent = nodes_to_visit.first_element()

7 visited_nodes.add_element(parent)

8 nodes_to_visit.delete_first_element()

9 for  _neighbor in parent.neighbours()_ do

10 if  _neighbor $\not\in$ visited_nodes_ then

11 parent.children.add_element(neighbor)

12

13 neighbor.parent = parent

14 nodes_to_visit.add_element(neighbor)

15

return visited_nodes

Algorithm 3 BFS algorithm