Inferring Quantum Network Topology using Local Measurements

Statistical correlations that can be generated across the nodes in a quantum network depend crucially on its topology. However, this topological information might not be known a priori, or it may need to be verified. In this paper, we propose an efficient protocol for distinguishing and inferring the topology of a quantum network. We leverage entropic quantities -- namely, the von Neumann entropy and the measured mutual information -- as well as measurement covariance to uniquely characterize the topology. We show that the entropic quantities are sufficient to distinguish two networks that prepare GHZ states. Moreover, if qubit measurements are available, both entropic quantities and covariance can be used to infer the network topology without state-preparation assumptions. We show that the protocol can be entirely robust to noise and can be implemented via quantum variational optimization. Numerical experiments on both classical simulators and quantum hardware show that covariance is generally more reliable for accurately and efficiently inferring the topology, whereas entropy-based methods are often better at identifying the absence of entanglement in the low-shot regime.


Introduction
Quantum entanglement [1] is a static resource that can be shared between parties and used to generate correlations.In nature, entanglement leads to interesting physical phenomena in quantum many-body systems [2], while from an engineering perspective, quantum entanglement offers operational advantages in communication, cryptography, computation, and sensing technologies [3].
We focus on quantum communication networks in which entanglement can be generated and distributed to different parties [4][5][6].The entanglement can then be used to assist in a variety of networking applications [6].The first quantum networks have been developed and will continue to scale [7][8][9][10]; therefore, to harness the power of quantum networks, it is important to characterize different types of entanglement structures.
The functionality of a quantum network will depend crucially on its topology, which is the particular connectivity structure between the sources and the measurement devices.While significant effort has been dedicated to detecting multipartite entanglement [11][12][13][14][15][16][17], less is known about inferring a network's topology.In practice, we need an efficient procedure for inferring network topology from the experimental data.Furthermore, such a procedure must be compatible with existing quantum systems, meaning it does not rely upon quantum memory or complex multi-qubit measurements.
In a separate approach, the von Neumann entropy of independent measurement devices was used to infer whether two networks of GHZ states are equivalent under local unitary transformations [32].Since each qubit in a GHZ state has a maximally mixed reduced density matrix, an analysis of the local von Neumann entropy alone will fail to distinguish between two networks whose measurement nodes receive the same Figure 1: We consider the problem of inferring the topology (covered by the grey cloud) of a quantum network using measurement data on qubits received from the sources.In addition to not knowing the exact connectivity or whether all links are functioning properly, the senders and receivers may have misaligned Bloch spheres used for qubit encoding/decoding.Lastly, we also consider noise corruption when sending qubits via connecting links.number of qubits (see Figure 3b).As a solution, Yang et al. [32] proposed using the multipartite Shannon mutual information in addition to the von Neumann entropy, however, this solution might be challenging to scale to networks with n ≫ 0 nodes since it requires computing the joint entropy of all 2 n subsets of parties.
The main problem we consider is depicted in Figure 1.The network is assumed to have a two-layered structure, the first layer consisting of quantum sources, and the second layer consisting of measurement nodes.However, the particular connectivity between these two layers is unknown and our goal is to identify this structure by studying the measurement statistics at the nodes.Furthermore, we do not assume that all nodes on the network share the same reference frame for the encoded information, which means that arbitrary local unitary rotations are permitted at either the source or measurement layers.As a final complication, we also consider the scenario of noisy connecting links.
We demonstrate two approaches to solving the above problem.First, we show that networks of different topologies can be distinguished using only local measurements, albeit requiring trustworthy sources to prepare GHZ states.Building upon Yang et al. [32], we use the von Neumann entropy to count the number of sources linked to each node, while we use the measured mutual information-the maximum mutual information observed between two parties using measurements local to each-between two nodes to count the number of sources they share.We extend our analysis to the case where qubit-wise uniform depolarizing noise is applied to the sources.We show that the protocol can be useful for comparing network topologies when the noise strength is known, but limited in utility otherwise.On the other hand, when each node measures one qubit, we show that a network's topology can be fully characterized also with measurements local to each node, and in a manner robust to noise (we place no assumptions on the noise model).Furthermore, our approach is practical because it scales quadratically with the number of qubits, uses only qubit measurements, and does not require a quantum memory.We also demonstrate empirically a topology inference algorithm that can be implemented on quantum hardware using variational quantum optimization methods [33].The variational optimization approach improves inference capabilities by maximizing the observed correlations Figure 2: A quantum network is composed of sources (green circles), links (edges), and measurement nodes (blue squares).Each link sends one qubit from a source to a node.Viewing the nodes and sources jointly as the vertex set, a quantum network can be interpreted as a bipartite graph.
while allowing numerical estimations of the Von Neumann entropy and measured mutual information, which are entropic quantities that are otherwise expensive to compute.We conduct numerical experiments on simulators and quantum hardware to contrast the choice of correlation measures, namely, mutual information and covariance.In general, covariance-based protocols are better at detecting entanglement structures while optimizing more efficiently.However, we also find that entropic methods tend to more reliably identify the absence of entanglement, particularly in the low-shot regime.The organization of the paper is as follows.In Section 2, we formally introduce quantum networks and their relevant entropic quantities, while establishing the notation that we use throughout the manuscript.Section 3 introduces protocols for distinguishing the topology of two quantum networks.With state preparation assumptions, we show that two networks can be distinguished by observing entropic quantities admitted by individual/pairs of measurement nodes.We also discuss instances where the protocol breaks down under noisy channels.Then, Section 4 briefly discusses variational optimization algorithms for estimating entropic quantities.Lastly, Section 5 extends our previous protocol to measurements on individual qubits, which gives a polynomial-time algorithm for inferring the topology of quantum networks.This algorithm does not depend on a priori knowledge of the prepared states and is robust to noise.We implement and test the algorithm on both simulator and quantum hardware to study the practical performance with respect to channel and statistical shot noise.

Preliminary on quantum networks
This section introduces formally n-local quantum networks.These networks contain several components (sources, nodes, and links) as well as important measurable quantities that can be used to infer the topology of the network.

n-local quantum networks
An n-local quantum network, the object of interest in this paper, is an N q -qubit system, where N q denotes the number of qubits.Each qubit is indexed by an integer k ∈ {1, 2, . . ., N q } ≡ [N q ].A quantum network is characterized by sources Λ i , measurement nodes A j , and links L k .Furthermore, we let N denote the number of a quantity, for example, N s denotes the number of sources and N m the number of measurement nodes.
More specifically, we can concisely interpret quantum networks as a directed bipartite graph G = ({Λ, A}, L).The vertices are partitioned into the sources Λ = {Λ i } Ns i=1 and measurement nodes A = {A j } Nm j=1 .The edges connect sources to nodes, L = {(Λ i , A j )}, and represent the movement of qubits.See Figure 2 for an example quantum network and an enumeration of its respective parts.
Sources A source, indexed by an integer i ∈ [N s ], is characterized by the subset of qubits it acts on, Λ i ⊆ [N q ].In a quantum network, N s sources collectively prepare a state |ψ⟩ = Ns i=1 |ψ Λi ⟩ where H is a 2 Nq -dimensional Hilbert space and |ψ⟩ ∈ H.There are two frequently used states in the remainder of the manuscript (particularly in Section 3).The first is the Greenberger-Horne-Zeilinger (GHZ) state, which takes the form where n denotes the number of qubits.When n = 2, GHZ states are equivalent to Bell states, denoted by |Φ⟩.Moreover, partial traces of the GHZ state results in a shared classical random bit, denoted by σ n , defined as This shared random bit is the other frequently used state.The density matrices of these two states differ by their off-diagonal entries.
Links Links L k , for k ∈ [N q ], can be represented graph-theoretically as an edge that connects a source node to a measurement node, L k = (Λ i , A j ).Each link transmits exactly one qubit; hence, there are as many links as qubits.Physically, they are modeled as a quantum, possibly noisy, channel.A quantum channel is mathematically defined as a completely-positive trace-preserving (CPTP) map [34] where D(H) denotes the space of density matrices of states in H.Alternatively, the channel can be expressed in the operator-sum representation [34,35] where {K i } are Kraus operators [35].For example, the depolarizing channel for a one-qubit system ρ with strength γ has the following Kraus operators, where I 2 is a 2 × 2 identity matrix and σ y , σ y , σ z are the Pauli matrices.Note, here we are assuming that the channel noise in each link acts independently of each other.
Measurement nodes Measurement nodes receive the incoming qubits and output the corresponding measurement outcomes.For a node A j ⊆ [N q ], j ∈ [N m ], we consider a projection-valued measure (PVM) {Π Aj aj } that forms a set of orthogonal projectors satisfying aj Π Aj aj = I 2 |A j | .The node measures its local qubits ρ Aj ∈ D(H Aj ) that were received from its linked sources.We assume measurement nodes are independent of one another, and the network applies the projector Π ⃗ a = Nm j=1 Π Aj aj .Upon measurement, the classical output ⃗ a is obtained with probability, where ρ tot designates the total state generated by all the sources and E tot is the joint channel across all edges.It is worth noting that any permutations needed to map the joint Hilbert space of sources to that of the measurement nodes are included implicitly.

Entropic quantities on quantum networks
The paper focuses on two entropic quantities observed on networks: the von Neumann entropy and the measured mutual information.Both quantities convey important information about the topology of the network and will be discussed in more detail in the next section.

Von Neumann entropy
The von Neumann entropy for a quantum state ρ is defined as where the log(•) above refers to the matrix logarithm and we use the convention that log 0 = 0. So, any pure state ρ = |ψ⟩⟨ψ| has a von Neumann entropy of zero.Recall that the Shannon entropy of a probability distribution µ on support X is defined as When measured in the eigenbasis of ρ, the von Neumann entropy coincides with the Shannon entropy of the distribution over measurement outcomes [34], with all randomness coming from the superposition of pure states in ρ [34].When measured in any other basis, the Shannon entropy calculated from measurement results is strictly greater than the von Neumann entropy because measurements only add noise.Thus, the von Neumann entropy can be calculated by minimizing the Shannon entropy over the measurement basis, i.e.,

S(ρ) = min
where {Π ⃗ a } is a complete set of projections and P(⃗ a) is the probability distribution upon measuring the quantum state in basis {Π ⃗ a }.

Measured mutual information
Intuitively, the mutual information between two random variables quantifies the amount of correlation between them.However, the conventional mutual information defined for quantum systems involves joint measurement between the two parties.Let A i and A j be two measurement devices.We introduce the measured mutual information as the maximal mutual information between local measurements distributions generated by A i and A j , If the two measurement nodes are not correlated, then we can decompose the joint distribution into products.Furthermore, since the Shannon entropy of independent random variables is additive, the measured mutual information will go to zero if no correlation-quantum or classical-is shared.

Distinguishing network topology
We first are interested in protocols that can distinguish two network topologies.We define two networks to be the same if they are related by a graph isomorphism, formally defined below.
Definition 1 (Network Topology).Two quantum networks, N (1) and N (2) , have the same topology if there exists bijections ϕ : φ(j) ).Note that in the above definition, we gave two bijections ϕ and φ separately for sources and measurement nodes.Conventionally, one bijective map is sufficient to describe the relabeling of vertices.In the context of quantum networks, the two maps are necessary to ensure sources and measurement nodes remain distinct.
Yang et al. gave a protocol for distinguishing the topology of quantum networks using GHZ states [32].More specifically, they proved that the von Neumann entropies measured at each node are the same between two networks, up to a permutation of node indices, if and only if the topologies of the two networks are the same.However, this theorem only holds if no two measurement nodes share more than one source.We find this class of network restricting.In this section, we will introduce an alternative protocol that removes this restriction and distinguishes the topology of two networks where any pairs of nodes can share any number of sources.

Topology classification using von Neumann entropy
We begin by reviewing one of the results from Yang et al. [32] that we will be extending.Consider an n-local quantum network N where no two nodes share more than one source.They constructed the characteristic vector V N = S(A 1 ) S(A 2 ) . . .S(A Nm ) (10) to store the von Neumann entropy measured on each node.Then, a quantum network can be uniquely characterized by its characteristic vector.
Lemma 1 (Theorem 6 of [32]).Let N (1) and N (2) be two quantum networks preparing GHZ states and for any two parties A i and A j , they share no more than one source, that is, Then, N (1) and N (2) have the same topology if and only if their characteristic vectors are equal to each other.
It would be helpful to establish a graphical interpretation of the von Neumann entropy.We want to first establish assumptions on the class of network to be considered for the remainder of the section, enumerated below.

Assumption 1. We assume:
A. Each source prepares maximally entangled states (GHZ states) up to local unitary transformations.
Without loss of generality, assume states are prepared in the form specified in Equation (1) (see remark below).

B.
Each source sends at most one qubit to any given measurement device.
C. Only measurements local to each measurement device can be performed.
Remark 1. Item B of Assumption 1 was primarily to avoid "parallel edges."Note that the statistics obtained from multiple maximally entangled qubits are identical to those obtained with just one qubit.Therefore, along with the assumption that each link represents the movement of a single qubit, having parallel edges will generate the same statistics at the measurement node and multiple networks can reproduce the same measurement outcome.However, if we allow multiple qubits from the same source to be transmitted in one link, we can relax Item B of Assumption 1 at no cost to the protocol's correctness.
Remark 2. As mentioned previously, the basis of choice at the sources can be different than the choice at measurement nodes.However, since calculating the von Neumann entropy and the measured mutual information requires optimization over basis sets at the end of each measurement node, the optimal basis will match the reference frame of the sources.Implementation of such a procedure can be achieved via differential programming (cf.Section 4 or [33]).Thus, for the remainder of the manuscript, the term "computational basis" would be used synonymously with "the source's reference frame" without loss of generality.
Following Assumption 1.B, we can interpret the von Neumann entropy as a graph-theoretic quantity.
Lemma 2. Let a quantum network satisfy Assumption 1.Then, for any node A i , S(A i ) = N Ai s , where N Ai s denotes the number of sources A i is connected to.
Proof.Since only GHZ states are prepared and each source can send at most one qubit, the qubits received at node A i are all maximally entangled with another qubit that is not present in A i .Thus, the state at node A i is maximally mixed and has a von Neumann entropy (which, in this case, is equivalent to the Shannon entropy) of A i is the number of qubits received, N Ai s .Thus, in light of the graph-theoretic interpretation, Lemma 1 states that knowing the number of sources connected to each node is sufficient for knowing the topology of a quantum network.However, the assumption that nodes share no more than one entanglement is crucial and restrictive, as emphasized in the following example.Example: triangle networks Consider the two networks as shown in Figure 3.The first network satisfies the assumption Yang et al. [32] made.Each node receives two qubits, each from two different sources.Since the subsystem of any maximally entangled state is a maximally mixed one, the von Neumann entropy at each node is 2. On the other hand, the second network consists of only two preparation nodes, each preparing a 3-qubit GHZ state.Each node in network 2 also receives two qubits, one from each source.Again by property of maximally entangled states, the von Neumann entropy at each node is 2. One could take a step further and study the von Neumann entropy of the joint state of two measurement nodes only to find out that the two networks yield the same statistics.Thus, observing the von Neumann entropy alone cannot distinguish networks.
As a solution, Yang et al. [32] show that the Shannon mutual information can distinguish between the two networks in Figure 3.Although the Shannon mutual information is evaluated from classical data, this entropic quantity must be evaluated for all groupings of parties where the number of groupings scales exponentially with the number of parties.Thus, this approach is not practical for large networks.
We propose the addition of the measured mutual information.We claim that the basis that maximizes the Shannon entropy is the computational basis, which will be formally proven later.Take any two nodes in network 1.The Shannon entropy at each node will be 2 since a maximally mixed state is informationtheoretically equivalent to a fair classical coin flip.The joint state of the nodes can be written as which acts equivalently as three independent fair coin flips.This yields a joint Shannon entropy of 3 with measurements local to each node.Thus, the measured mutual information will be 1 for all pairs of nodes in network 1.The same does not hold for network 2! The joint state of any pair of nodes in network 2 has a Shannon entropy of 2 upon measuring separately in the respective nodes.Thus, the measured mutual information in network 2 is 2.

Protocol for distinguishing network topology
The example above gave evidence for a graph-theoretic interpretation of both entropic quantities-the von Neumann entropy of a node gives the number of sources the node is connected to, whereas the measured mutual information gives the number of sources the two nodes share.We formally present this in the lemma below, whose proof is deferred to Appendix A.
Figure 4: Example quantum network and its respective characteristic matrix M N .Theorem 1 shows that M N uniquely characterizes a quantum network.However, inferring the network from M N is nontrivial.
Lemma 3. Let a quantum network satisfy Assumption 1.Then, for any two measurement nodes A i and , where N Ai,Aj s denote the number of sources they share.
The interpretation presented in Lemma 2 and Lemma 3 will be useful for proving the correctness of our protocol.Furthermore, in spirit the characteristic vector in [32], we define the characteristic matrix of a quantum network to be where the diagonal is the characteristic vector V N containing the von Neumann entropy and the off-diagonals are the measured mutual information.Note that the matrix is symmetric, M N = M ⊺ N .By introducing the off-diagonal terms, we can quantify the number of sources two nodes share.This addition allows us to extend the previous network classification protocol to include cases where more than one entanglement is shared between nodes.
We note that the characteristic matrix bears resemblance to the covariance matrix used in the semidefinite tests for network compatibility [27][28][29] where the off-diagonals of the covariance matrix are nonzero if and only if a source correlates two measurements.A key distinction is that the covariance matrix is evaluated from the classical data sampled from the network, whereas the characteristic matrix is evaluated by optimizing the measurements with respect to von Neumann entropy and measured mutual information.Indeed, it is significantly more efficient to evaluate the covariance matrix, however, having control over the measurement apparatus improves our ability to probe the strength of the correlation between measurement devices.Thus, the characteristic matrix might give a more detailed view of the network's topology.We study the differences between entropic and covariance methods later in the manuscript (cf.Section 5) for inferring the topology of quantum networks using qubit measurements.
We now show that the topology of an n-local quantum network can be fully characterized by the characteristic matrix M N , which specifies the von Neumann entropy at each node and the measured mutual information of each pair of nodes.
Theorem 1.Let two quantum networks, N (1) and N (2) , satisfy Assumption 1. N (1) and N (2) have the same topology (cf.Definition 1) if and only if S(A j ) for all pairs of nodes A i , A j .We defer the proof of the theorem to Appendix B. The theorem states that one can uniquely find the topology of a network from its characteristic matrix.Suppose entropic quantities can be reliably calculated, verifying if two networks have the same topology requires only that the number of queries grows polynomially with respect to the number of nodes.
Inferring the topology from the characteristic matrix remains a difficult task.See Figure 4 for an example network and its corresponding characteristic matrix M N .Knowing the topology, M N can be straightforwardly obtained using Lemma 2 and Lemma 3.However, we encourage the reader to try the other direction.Even though M N indicates whether A i and A j share a source(s), finding the correct number of sources N s and assigning nodes to the respective sources appear to be highly nontrivial.Naively, one could search through all possible quantum networks with N s sources, for all possible N s .The search space grows exponentially and would not be tractable for large networks.Thus, we defer the existence of a polynomial-time algorithm for decoding the characteristic matrix M N as a future direction.

Distinguishing the topology of noisy networks
Maximally entangled states such as GHZ states are fragile and easily corrupted by noise.In this section, we hope to establish robustness for the classification protocol introduced subjected to depolarizing noise, that is, for a quantum state ρ, a depolarizing channel E γ performs the map where γ ∈ [0, 1] is the parameter of the channel, and n is the number of qubits involved in state ρ.In the quantum network setting, depolarizing noise acts jointly on qubits prepared by a source, and sources are affected independently.
Example: triangle network revisited Consider the triangle network 1 shown in Figure 3a.Like in the noiseless case, the Shannon entropy at each measurement device is independent of the choice of measurement basis, and H(A i ) = S(A i ) = 1 for all measurement nodes in the network.In an attempt to characterize the topology, we look at the measured mutual information between devices A i and A j , where the joint state is If each qubit is sent through a depolarizing channel of the same noise parameter, then the joint state received E γ (ρ Ai∪Aj ) becomes which yields the Shannon entropy of when measured using the computational basis for both devices.When the channel is noiseless, i.e. γ = 0, then I m (A i ; A j ) = 1 and we recover the results shown in Section 3.1.However, if the channel is completely noisy, meaning that γ = 1 , then H(E γ (ρ Ai∪Aj )) = 4 and the measured mutual information is zero, which can lead one at the receiver end to think that qubits received at A i and A j are independent of one another.
The same calculation can be applied to network 2 in Figure 3. Let σ 2 = (|00⟩⟨00| + |11⟩⟨11|)/2.Knowing that the joint system ρ Ai∪Aj = σ 2 ⊗ σ 2 , we focus on the behavior of one σ 2 knowing that the remaining system behaves identically and independently.We can find the noisy joint system of σ 2 to be The above state yields the following Shannon entropy when measured in the computational basis.
Since the joint system is separable, the entropy of the joint system simply adds.
Again, we can cover the noiseless and completely random behavior when γ = 0 or γ = 1, respectively.However, we are interested in determining if the two systems are ever indistinguishable due to noise.
Claiming the computational basis is again the basis of choice that maximizes the mutual information and from Equations ( 18) and ( 21), the measured mutual information is, respectively, We can see that the measured mutual information of the first network is half of the second one.Consequently, this means that for depolarizing of strength γ ∈ [0, 1), the measured mutual information will always have a non-zero gap and we will be able to distinguish the two networks through local measurements.
We extend Theorem 1 to the case of applying uniform global noise on sources.To do so, we first want to show that the same strategy of measuring in the computational basis in the noiseless case is still valid in the presence of noise (which is an extension of Lemmas 5 and 6 in the appendix to the noisy case).
Lemma 4. Consider a quantum network satisfying Assumption 1, measurement nodes A i and A j .Moreover, the network is made up of depolarizing channels that act on each qubit with strength γ.Then, the local measurement basis that maximizes the Shannon mutual information, that is is the computational basis.
Proof.Let ρ be either a Bell pair |Φ⟩⟨Φ| or shared random bits σ 2 .Under depolarizing noise on the source, the state becomes Note that for any unitary U applied onto the noisy state, the effect of the noise stays unchanged, that is Thus, the measurement basis maximizing the Shannon entropy of ρ remains the same for all γ > 0.
We are interested in whether there exists a γ ∈ [0, 1) such that the measured mutual information of two networks is the same.If such γ exists, denote γ * , then the two networks are identical according to the protocol within some small neighborhood of γ * .On the other hand, if the measured mutual information remains distinct for all γ and pairs across two networks, then the protocol will be applicable for any noise level that is not completely depolarizing while assuming an infinite precision.Below, we provide one condition that guarantees such robustness to noise.Theorem 2. Consider two quantum networks N (1) and N (2) satisfying Assumption 1.For depolarizing channels with known strength γ ∈ [0, 1), we can distinguish the topology of N (1) from N (2) .
Proof.Under the assumption that each preparation node can send at most one qubit, for any two measurement nodes A i and A j , the joint state ρ AiAj will be the tensor product of I 2 , σ 2 , and Bell pairs.In particular, the von Neumann entropy of each device is invariant with respect to noise.Moreover, the measured mutual information of σ 2 and |Φ⟩⟨Φ| is the same for all γ ∈ ), the measured mutual information as a function of γ will be I m (A i ; A j ) = N Ai,Aj s

I(γ).
If N (1) and N (2) have different topologies, it means that there exists at least one pair of nodes A i and A j such that (without loss of generality) N (2) j s .Thus, for any depolarizing channel of strength γ, I m (A j ).Thus, by Theorem 1, the two networks can be distinguished given sufficient shots taken to estimate each entropic quantity.
Note that Theorem 2 actually provides a limited sense of noise robustness, that is, we need a priori knowledge of γ.The theorem can remain useful for comparing two quantum networks with unknown topologies but are under the influence of depolarizing noise of the same strength or verifying the topology of one noisy network.Recall that there are no straightforward algorithms for deriving the topology from the characteristic matrix even in the noiseless case.Moreover, inferring topology only becomes more difficult when the two networks are exposed to noises of different strengths.Furthermore, the assumption of depolarizing noise is largely due to simplicity, and we leave formal analysis of the protocol using other noise models as future work.

Variational Quantum Network Topology Inference
In this section we introduce our variational quantum optimization framework for inferring the topology of sources in noisy uncharacterized quantum networks.We implement our approach as Python software called qNetTI: The Quantum Network Topology Inferrer, which is publicly available on GitHub [36].Our software applies the PennyLane framework for cross-platform differential programming [37], and builds upon qNetVO: the Quantum Network Variational Optimizer software [33,38].Our variational optimization techniques are hardware agnostic and can easily be extended to many general quantum network characterization, validation, and verification tasks.We apply our variational quantum optimization methods in Section 5, in which we compare entropy-based and covariance-based topology inference when local qubit measurements are applied.
In general, when inferring the topology of sources in a quantum network, the respective covariances or entropic quantities must be sufficiently large such that correlations between measurements, or lack thereof, can be witnessed.However, since the measurement nodes do not have a standard reference frame for each of their measurement bases, a naive measurement choice will not necessarily reflect the correlations between measurement devices with accuracy.Thus, by optimizing the covariances or entropic quantities used to infer network topology, the network inference protocol is made more robust to the errors that result from nonoptimal measurement choices.
To further motivate our hardware-compatible optimization scheme, we note that the entropic quantities such as von Neumann entropy or measured mutual information contain an optimization implicitly in their operational definition (see Equations ( 8) and ( 9) respectively).Indeed, the von Neumann entropy at a given measurement device cannot be ascertained by performing a single measurement.That is, either the reduced density matrix measured at the device must be known, or the measurements must be optimized such that the Shannon entropy is minimized as in Equation (8).A similar remark can also be made for optimization used to obtain the measured mutual information in Equation (9).To obtain these quantities in practice a quantum-hardware-compatible optimization technique is needed, hence we apply variational quantum optimization methods.
Variational quantum optimization is a type of hybrid quantum-classical algorithm in which a classical computer tunes a parameterized quantum circuit such that a cost function is minimized [39].The quantum circuit is evaluated on quantum hardware leading to the hardware being optimized or trained for the task encoded by the cost function.Generally, variational quantum algorithms can be applied to a wide range of optimization and simulation problems and show promise of providing practical advantages [40].While their seminal applications were mainly in quantum computing, variational quantum algorithms have recently been proposed as a technique for optimizing noisy and uncharacterized quantum network hardware for various tasks [33].
Within our hybrid optimization framework for quantum network topology inference, we construct a variational ansatz as follows.Let the collection of sources prepare the state |ψ⟩ = Ns i=1 |ψ Λi ⟩ while each measurement node performs the PVM measurement {Π Aj aj ( ⃗ θ Aj )} aj ∈Aj where and ) is applied while the probability of measuring outcome ⃗ a = (a j ) Nm j=1 is Then, for measurement node A j , we may rewrite the von Neumann Entropy in Equation ( 8) as the cost function S(ρ Aj ) = min Likewise, measured mutual information in Equation ( 9) becomes in which the minus sign on the measured mutual information results from the convention of minimizing the cost function in variational optimization.
To optimize the quantities in Equations ( 29) and ( 30), a gradient descent algorithm is used.Consider a generic cost function f (Θ) that we aim to minimize.Then, we can incrementally approach the optimal settings Θ ⋆ = arg min Θ f (Θ) by updating the settings as where η > 0 is a small stepsize and the gradient of f (Θ), ∇ Θ f (Θ), is a vector pointing in the direction of steepest ascent.Therefore in many small steps the algorithm navigates its way to a local minimum in the landscape of the cost function.
To apply these variational optimization methods to infer the topology of an unknown quantum state |ψ⟩, it must be run on the quantum network's hardware.The reason is that |ψ⟩ is not known and therefore cannot be reconstructed or characterized.To evaluate gradients on quantum hardware we make use of the parameter-shift rule [41], which evaluates gradients on quantum hardware with a computational complexity that is linear in the number of parameters.Hence, our variational methods for quantum network topology inference can conceivably be applied with efficiency in practical quantum networking systems.
As a final remark, we note that our variational quantum network topology inference scheme provides several improvements to existing techniques.First, previous methods do not typically consider the measurements to be tunable.By optimizing measurements, our variational methods could improve the effectiveness of existing topology inference approaches in which the violation of entropic bounds or Bell inequalities are used to test for network topology [18-26, 30, 31].Second, quantities such as the von Neumann entropy or measured mutual information cannot be obtained for unknown quantum states.Typically, calculating these quantities would require estimating the entire quantum state via state tomography.Alternatively, our quantum-hardware-compatible variational methods can approximate these quantities through optimization.Thus, entropy-based inference methods can be applied in practice.Finally, our methods are hardware agnostic.The parameter-shift rule requires only a parameterized description of the unitary applied by the measurement device, how the unitary is physically implemented is not relevant.

Inferring network topology from qubit measurements
Previously, we considered the qubits in a measurement node to be measured jointly.While there exists a unique mapping from network topology to the characteristic matrix (cf.Theorem 1), constructing the map in a reasonable amount of time, particularly for large networks, is difficult.Moreover, qubits undergoing depolarizing channels with unknown noise parameters can render the protocol useless.Thus, the classification protocol introduced in Section 3 would be of practical use only in very limited situations.
These issues can be resolved if measurements are available on the qubit level, which is often the case for real-life situations.The increased granularity allows for a protocol that can infer network topology from measurements local to each node in polynomial time.Moreover, the procedure no longer requires GHZ state preparations, is entirely robust to noise induced by quantum channels, and can maintain performance using low numbers of circuit evaluations.
The protocol is also not restricted to measured mutual information to estimate classical correlation.In particular, we show that covariance and classical mutual information are both suitable choices for identifying the entanglement structure of quantum networks.While the covariance-based methods generally exhibit more stable convergence and are more robust to noise, entropic alternatives excel under the low shot regime.

Entropy-based protocol for inferring network topology
We can derive a protocol for inferring network topology by straightforwardly extending the characteristic matrix M N (Equation ( 14)) to qubits.Let {q i , i ∈ [N q ]}, be the set of qubits in the network.Then, we can define the qubit characteristic matrix : I m (q 1 ; q 2 ) . . .I m (q 1 ; q Nq ) I m (q 2 ; q 1 ) S(q 2 ) I m (q 2 ; q 3 ) . . . . . . . . . . . .I m (q Nq−1 ; q Nq ) I m (q Nq ; q 1 ) . . .I m (q Nq ; q Nq−1 ) Similar to M N , the diagonal entries stores the von Neumann entropy of each single-qubit state and the off-diagonal entries stores the correlation quantified by the measured mutual information.By treating each qubit as its own measurement node, the qubit characteristic matrix inherits all the properties of M N , and gains additional structure that can help with decoding the entanglement structure.
Theorem 3. Consider an n-local network N measured using local qubit projectors Π N ⃗ a = m j=1 Π qj aj where a j ∈ {0, 1} and q j ∈ [N q ] index the measured qubit.Moreover, suppose Assumption 1 holds.Then, the network's topology is completely characterized by the qubit characteristic matrix Q N (Equation (32)), where the i th row lists the qubits entangled with qubit q i and the number of sources N s is equivalent to the number of unique rows (or columns) of Q N .
Proof.Consider each qubit to be its own measurement node.Then, the matrix Q N completely characterizes the network by invoking Theorem 1.
To see the relationship between the number of unique rows (or columns) by the symmetry of Q N , fix a particular source Λ k .Then, for any row i where q i ∈ Λ k , the (i, j)-th entry is 1 if and only if q j ∈ Λ k .And since each qubit can only come from one source, all qubits whose corresponding rows are equal to one another are from the same source.Therefore, partitioning the set of qubits into sets whose respective rows are equal recovers the qubit-source mapping, and the number of partitions is the number of sources.
It is important to note that we don't need Item A of Assumption 1 to hold to infer the topology.If we construct another matrix B defined component-wise by and treat each qubit as individual measurement nodes, then B is equivalent to Q N with the same entanglement structure assuming GHZ state preparation.To infer the topology, we can simply apply Theorem 3 to the matrix B. Thus, for the remainder of the section, we use Q N to refer to both the qubit characteristic matrix in Equation (32) while assuming GHZ preparation and this binary matrix B without the state preparation assumption as they are functionality equivalent.
The above theorem gives an algorithm for reconstructing the network topology given the qubit-wise characteristic matrix Q N .First, assume knowledge of the measurement node that each qubit is sent to.The columns of Q N , each representing a qubit, can then be grouped into their respective measurement nodes.On the other hand, the rows of Q N can be partitioned into sets of indices with identical rows, that is, let Λ i be a set such that for all j, k ∈ Λ i , Q N ,j, * = Q N ,k, * .As the notation suggests, this set of indices is the set of qubits from the source Λ i .Lastly, if Q N ,r,s = 1, qubits r (in node A j ) and s (in node A k ) share a source Λ i and the triplet (A j , Λ i , A k ) exists in the network.In Figure 5, we give an elementary demonstration of the algorithm on the triangle network presented in Figure 3b.
Performing joint measurements, even for qubits received in the same measurement node, can be experimentally demanding.Thus, limiting ourselves to qubit-wise measurement actually enhances the practicality of the protocol.The fine-grained measurements provide a simple algorithm for determining the topology in time quadratic to the number of qubits.Moreover, sources are not restricted to preparing only GHZ states; any entangled states will do.Given infinite precision and noiseless channels, each entry of Q N can store whether there exist correlations between qubits.As correlations can only arise from quantum entanglement, two qubits are from the same source if and only if a non-zero correlation is observed.
Figure 5: Application of Theorem 3 on the network in Figure 3b.The columns of Q N are organized by the nodes each qubit is from, and unique rows are grouped together.Each group of unique rows corresponds to a preparation node (purple or green) and the connectivity can be found by observing the non-zero entries in each row.
Since the protocol aims at identifying zero or non-zero correlations, as long as the quantum channel is not completely destructive, one can always infer the topology given enough shots to suppress statistical noise.This statement is formalized below.Theorem 4. Consider a noisy network N that is measured using local qubit measurements and ρ Net = n i=1 ρ Λi .Its topology is completely characterized by the matrix Q N as described in Theorem 3.
Proof.Let ρ i = tr j̸ =i [ρ Net ] for all j ∈ [N q ].Then, if S(ρ i ) > 0 a source may exist that correlates the qubit with other qubits.Next, the measured mutual information I m (q i , q j ) = 0, if and only if ρ i ⊗ ρ j .This implies that when I m (q i , q j ) > 0, a source must be present to correlate the two independent qubit measurements.Therefore, the matrix Q N only has nonzero elements on its off-diagonal if there exist sources to correlate the qubits.In practice, finite samples are taken and the scalar value of I m (q i , q j ) should only be counted as nonzero if it is sufficiently larger than the statistical fluctuations of uncorrelated qubits.
Note that in the above Theorem, a source can be so noisy that it separates as j ρ j .We argue that the source no longer qualifies as such precisely because it no longer distributes shared randomness.Otherwise, so long as a sufficient number of measurements are taken and non-separable states are prepared at each source, the qubit-wise characteristic matrix Q N is sufficient for determining the network topology.On a different note, for certain choices of noise, such as colored noise and qubit dephasing noise, the characteristic matrix is preserved; thus, both Theorem 2 and Theorem 4 will hold under these noise models.
Alternative definition for mutual information on networks Constructing the characteristic matrix Q N requires the number of independent circuit evaluations to grow at a rate equal to the number of unique qubit-pairs.We associate a unique measurement basis that achieves the maximum of Equation ( 9) for each pair.In the case of N q being large, we might be tempted to define a measurement basis common across all qubit pairs that maximizes an analogous quantity that takes the mutual information of all pairs into account.Formalizing this intuition, we seek measurement operators and we let the mutual information between any two qubits obtained from such basis be the classical mutual information (as opposed to the original bipartite measured mutual information).
Comparing Equation (34) with the expression for measured mutual information in Equation ( 9), we can see that max x i ⊗Π q j x j } H(P(x i )) + H(P(x j )) − H(P(x i , x j )).
Thus, for each unique pair of qubits, measured mutual information between the qubit pair is at least that of the one calculated from the classical mutual information of the whole network.We can construct an example where the inequality is, in fact, strict.
Remark 3. Consider a tripartite network that has the following mixed state: For this network, the measurement basis that maximizes the correlation-mutual information and covariance (see next section) alike-between any pair of qubits is orthogonal to that of any other pair.Since the bipartite measured mutual information consists of a collection of measurement bases, one for each pair, correlations can be fully observed.In the case of classical mutual information, in which we seek to find one optimal basis for all qubit pairs, there will always be correlations that are not fully observed.
On the other hand, the benefit of considering the network mutual information is clear: the number of circuit evaluations needed is constant with respect to the number of qubits.

Covariance-based topology inference
The measured mutual information is not the only measure of the correlation between two random variables.Inspired by the literature [27][28][29], we propose a network topology inference protocol by applying the decoding scheme above on covariance matrices.
We treat each qubit measurement as a random variable taking values in {−1, 1}.From the definition of covariance, we get Cov(q i , q j ) = x,y∈{−1,+1} xy P(q i = x, q j = y) − qi qj (37) = x,y∈{−1,+1} xy tr Π qi x ⊗ Π qj y ρ qiqj − qi qj (38) where ρ qiqj is the state of qubits i and j and qi = x∈{−1,+1} x P(q i = x) x tr (Π qi x tr j (ρ qi )) , and similarly for qj .The qubit covariance matrix, denoted by C N , is defined entry-wise where the (i, j)-th entry contains the absolute value of the covariance between qubits i and j.
The magnitude of the covariance depends on the measurement basis.If the basis is chosen arbitrarily, there is a chance that the basis of choice yields low covariance, thereby skewing the inference.To reduce the probability of such an event from occurring, we can find the basis that maximizes the distance between the covariance matrix and the origin, for example, for some choice of local measurement basis {Π ⃗ x = qi Π qi xi }, we hope to find arg max However, note that Remark 3 still applies and there exist correlations that cannot be fully observed from the covariance matrix alone.However, this does not interfere with inferring the network topology.From here, the procedure for inferring the network topology is identical to that of the mutual informationbased protocol.We provide a binary description for each pair of qubits in a network-1 if the covariance is above zero, and 0 (or within an acceptable statistical margin of error) otherwise.If two qubits are entangled, then their covariance is nonzero as long as the two qubits are not measured in mutually unbiased bases, for example, σ x and σ z .Thus, the protocol straightforwardly applies by replacing the qubit characteristic matrix Q N with the covariance matrix C N .
Remark 4. The covariance methods presented in [27][28][29] aim at constructing a single covariance matrix after collecting classical measurement data.In comparison, our protocol sequentially queries the network and finds the optimal covariance matrix that maximizes the correlation observed among all pairs of qubits.Our method avoids the possibility of choosing a measurement basis that leads to a small observable correlation, though at the cost of requiring more extensive procedures like variational optimization.

Comparing entropic and covariance-based protocols
While the mutual information and covariance both quantify the amount of correlation between qubits, each method possesses unique attributes that make one more preferable than the other depending on the context.In the following section, we will compare the two methods in terms of their computational complexity, the ability to accurately infer the topology under noisy quantum channels, and under statistical noise from taking a finite number of measurements.We will also demonstrate the capability of both methods on quantum hardware.

Computational complexity
The number of circuit evaluations needed to evaluate the covariance matrix is constant in the number of qubits.Constructing the characteristic matrix using classical mutual information needs twice the number of evaluations as the diagonal and off-diagonal entries must be constructed independently.Lastly, in the case of using the bipartite measured mutual information, the number of circuit evaluations grows quadratically in the number of qubits.One can optimize this to achieve linear scaling by evaluating all non-overlapping pairs, but is still time-consuming compared to the two constant-time alternatives.
The time complexity needed to compute the cost functions ranks similarly.Computing the distance induced by the Schmidt norm of the covariance matrix from the origin requires scanning through each entry of the matrix, resulting in a quadratic scaling with respect to the number of qubits.Computing mutual information requires specifying the marginal distribution of all qubit pairs.One can think of the measurement outcome as a probability distribution with a domain that grows exponentially with the number of qubits.Obtaining the marginal distribution for a pair of qubits requires summing over exponentially many terms, and therefore is a time-consuming procedure.In the case of measured mutual information, one can choose to query one pair of qubits at a time, sacrificing query complexity for ease of computing the cost function.
Inference under noisy quantum channels Though conceptually identical, covariance is generally less affected by noisy quantum channels compared to mutual information.Consider a Bell state undergoing depolarizing channels applied qubit-wise.We can then write the mutual information and covariance analytically in terms of the noise parameter γ ∈ [0, 1].
The same can be done for amplitude-damping noise applied onto each qubit, which has Kraus operators Figure 6: The effect of noisy quantum channels on the observed correlation.A Bell state with fixed local rotations was prepared, and we applied (left) depolarizing noise to each qubit and (right) amplitudedamping noise to each qubit using PennyLane's mixed-state simulator.We ran 10 independent trials of variational optimization with step sizes of 0.05 for 30 steps, plotting the average (circles with shaded standard error) and maximum (triangle) observed across trials.We also compare empirical value obtained through simulation with theory (solid lines), cf.Equations ( 42)-( 43) and Equations ( 45)-( 46) for each qubit, and noise parameter γ ∈ [0, 1].The maximal correlation is observed when measuring both qubits in the σ x basis, which respectively takes the form More detailed calculations are deferred to Appendix C. We compare these theoretic quantities with numerical solutions obtained via variational optimization.We repeated 10 independent optimization trials per choice of noise parameter, and the results are shown in Figure 6.Both analytical and numerical results show that covariance decays slower with respect to the noise parameter γ in the case of depolarizing and amplitude-damping noise.This suggests a noise regime where mutual-information-based protocols misidentify the existence of entanglement while the covariance matrix can accurately infer the network topology.On a more optimistic note, we observe that the respective theoretical values can be achieved numerically given an ensemble of independent optimization trials, and a typical optimization run produces a result that approximates the theoretical.
Inference under finite shot noise In addition to noise induced by quantum channels, statistical shot noise is another practical source of uncertainty.In particular, having computational methods that can operate in the low-shot regime greatly increases its applicability as quantum resources are often scarce.Shot error can pose an issue for iterative methods such as variational optimization as noisy gradient estimates can limit the ability to effectively navigate the optimization landscape.We put our inference protocol to the test with a 5-qubit network where the first three qubits are entangled in a W state, i.e., the W state takes the form and the remaining two in a GHZ state.The optimization result for qubit pairs with and without entanglement is shown in Figure 7. Mutual information and covariance are estimated using variational optimization with a step size of 0.05 for 30 steps.Each plot shows the correlation between qubit pairs under different entanglement structures.The threshold value (black line) is set to 0.05, and was chosen arbitrarily.From the experiment, we observe that covariance methods accurately identify the existence of entanglement, as shown in the case of (left) W states (Equation ( 47)) and (middle) GHZ states (Equation ( 1)).However, entropic methods are able to identify (right) the lack of entanglement better than covariance-based protocols.
Consistent with the results in Figure 6, covariance methods identify the presence of entanglement more strongly than entropic measures.However, covariance tends to "overshoot" and falsely declares the presence of entanglement for uncorrelated qubits.We can set an arbitrary threshold for detecting correlationswe decide that two qubits are entangled if and only if the calculated correlation (mutual information or covariance) is above the defined threshold.In the case of figure Figure 7, the threshold is set to 0.05, indicated by the black line.When qubits are not entangled, mutual information rapidly vanishes while covariance stays above the threshold within the range of the shot counts considered.Thus, in the lowshot regime, mutual information might be more suitable as it is more likely to correctly reconstruct the entanglement structure of the underlying network.
Hardware experiments We now apply on IBM's quantum hardware our variational scheme for inferring network topology using local qubit measurements.As an example we again consider the 5-qubit state preparation |ψ⟩ = |W ⟩ ⊗ |Φ⟩ where the |W ⟩ is the W state in Equation (47) and is a two-qubit maximally entangled state.We also apply our variational network inference scheme to 5qubit GHZ states and the 5-qubit zero state (see Appendix D).In each example, a known state is prepared while we optimize a variational ansatz that parameterizes arbitrary qubit projective measurements as We then compare the performance of our variational inference scheme on both noisy IBM hardware and noiseless classical simulator when 10, 100, 1,000, and 10,000 shots are considered.
To quantify the performance of the optimization, we consider the inference error, which we define as the Euclidean distance where C is the optimized covariance matrix and C ⋆ is the ideal covariance matrix for the given state.The distance in Equation (48) can similarly quantify the error in the characteristic matrix d(Q, Q ⋆ ).Note that this inference error quantifier only works in our numerical experiment because we prepare a known state.In practice, the state preparation is not known and the performance of the optimization cannot be quantified by Equation (48).
For the considered state |ψ⟩ = |W ⟩ ⊗ |Φ⟩, the ideal qubit covariance and characteristic matrices are where I W ≡ I m (q i ; q j ) ≈ 0.349976 and S W ≡ S(W qi ) ≈ 0.918296 for any of the qubits q i and q j of the state |W ⟩.To obtain the ideal covariance matrix and mutual information in Equation (49), it is sufficient to measure all qubits in the {|+⟩, |−⟩} basis.While this calculation is straightforward for the |Φ⟩ state, we will be more explicit with the W ABC = |W ⟩⟨W | state, for which the reduced density matrices are and where When the observable σ x is measured, the covariance and variance are and Var(A) = 1.The qubit von Neumann entropy can then be explicitly calculated from Equation (50) as while the measured mutual information is found to be I W = I m (A, B) ≈ 0.349976 where each party measures the observable σ x .Since all qubits are measured in the same basis, the measured mutual information is equivalent to the classical mutual information for all qubit pairs, that is I m (q i , q j ) = I(q i , q j ).Thus, for this example, it is sufficient to optimize the classical bipartite mutual information rather than the measured mutual information.This simplification provides significant speed-ups when running on quantum hardware because only one circuit needs to be evaluated to collect the mutual information of all qubit pairs as opposed to the 10 circuits needed to optimize the measured mutual information for each qubit pair independently.Note that queue times for the IBM hardware are the main bottleneck in our variational network inference scheme.
In Figure 8, we plot the inference error as the covariance and characteristic matrices are optimized with respect to the state |ψ⟩ = |W ⟩ ⊗ |Φ⟩.To investigate the relation between the number of shots and the inference error, we consider optimizations where 10, 100, 1,000, and 10,000 shots are used when collecting data from the quantum computer.We expect that the inference error should decrease as the number of shots increases.
As a baseline, we first run our numerical experiment on PennyLane's default.qubitclassical simulator, which is a noiseless, finite-shot simulation of a quantum computer.The data shown in the top row of Figure 8 plots the mean inference error from 10 independent optimizations for both the covariance and characteristic matrices.As expected, the amount of inference error decreases as the number of shots increases.Furthermore, we find that the covariance and characteristic matrices do not always find a global optimum in which all matrix terms converge to their maximal theoretical values.As a result, the mean does not approach zero, reflecting the importance of running the optimization algorithm multiple times.Moreover, we find that the covariance matrix is optimized in fewer iterations than the characteristic matrix.
We then test our optimization on the ibmq belem 5-qubit quantum computer, which exhibits a considerable amount of noise.When we run the optimization on an IBM quantum computer, the optimization steps become expensive to run due to the queue wait times.As a result, we are only able to run one optimization for each number of shots.We plot the IBM hardware optimization results in the middle row of Figure 8. Figure 9: In the top row, we plot the maximal value achieved for each term of the covariance matrix across all optimization steps.In the bottom row, we plot the maximal mutual information (off-diagonals) and minimal Shannon entropies (diagonal) across all optimization steps.The bar graph plots the Euclidean distance between the ideal and inferred matrices for each distinct number of shots.
For the 10-shot case, it is not clear that the inference error is decreasing.For larger numbers of shots, the inference error decreases throughout the optimization.To further validate the optimization results, we take the settings optimized on the noisy IBM hardware and re-evaluate them on a noiseless, infinite-shot classical simulator.Overall, there is a general improvement in the inference error as shown in the bottom row of Figure 8 when compared with the data collected from the noisy IBM hardware.Although the 1,000-shot case seems to be an exception with the error increasing slightly when evaluating the same parameters on the simulator, it is worth noting that the optimal parameters on noisy hardware might differ slightly from optimal on a simulator; hence, we view this run as mostly a statistical outlier.As further confirmed by additional experimental results in the appendix, while the data from the quantum hardware may seem noisy, the optimization over qubit measurements is indeed decreasing the inference error.
In Figure 9 we show the optimal covariance and characteristic where the optimal matrix values are taken over all optimization steps.As the number of shots increases, so does the optimization's ability to resolve the correlation structure with greater accuracy.On the other hand, when the number of shots is small, statistical fluctuations can lead to stronger correlations than present, leading to false-positive correlations.For example, in the 10-shot case of Figure 9 the zero terms of the covariance and characteristic matrices are optimized to be quite large, which would lead a researcher to infer that the two qubits are correlated.Also note that the IBM hardware can have significant errors on a given qubit for example, in the 10,000 shot characteristic matrix the top left matrix term remains close to zero despite taking more shots than other more successful trials.From experiments on the simulator, we know that mutual information generally is more difficult to optimize than covariance.Moreover, a noisy device might not be stable for the amount of time needed to acquire 10,000 shots.This instability leads to noise that inhibits the optimization's ability to make progress toward an optimum, particularly so for computing the mutual information.Therefore, unless one finds oneself working in the low-shot regime, covariance-based method is generally preferred as it exhibits more reliable convergence when presented with adequate resources.

Conclusion
In this work, we introduced protocols for distinguishing and inferring the topology of n-local quantum networks.The protocols construct matrices that encode entanglement structures, i.e., the characteristic matrix (cf.Equations ( 14) and ( 32)) and the covariance matrix.The entries of these matrices can be estimated using only local measurements, which allows for easy implementation on quantum hardware.Assuming sources prepare GHZ states, the characteristic matrix can uniquely determine the topology of a quantum network.Moreover, if one is capable of making qubit-wise measurements, the topology of the network can be inferred in polynomial time from both the characteristic matrix and the covariance matrix.Furthermore, the protocol is robust to noise and can be implemented on quantum hardware using quantum variational optimization.From experiments on both classical simulators and quantum hardware, we found that covariance-based methods are generally more stable during optimization, leading to more reliable discoveries of quantum entanglement.However, with limited shots, entropic protocols are more effective at avoiding false positives.
It is worth noting that the characteristic matrix cannot distinguish between quantum entanglement and shared randomness.However, the characteristic matrix does indicate which qubits are correlated.Thus, an entanglement witness can be tailored to the network's topology.One approach might be to then test each source independently using an entanglement witness of choice [11,12].
Future work should also focus on relaxing assumptions made in the manuscript for even broader applications.For example, we assumed all measurement nodes are observed and measurements can be performed on all nodes.In reality, the known set of measurement nodes can merely be a subset of the entire network.Exploring the limits and extensions of our protocol for the case of partially-observed networks can be a fruitful future direction.On the other hand, the protocol for distinguishing network topology (cf.Section 3) relies on preparing the GHZ state, which is delicate and lacks robustness in practice.Extending the analysis to sources potentially distributing states with greater entanglement robustness, such as the W-class states [42,43], cluster states, or other partially entangled states would increase the applicability of this protocol.Another direction is to extend the protocol to infer network topology in more complex scenarios, for example, networks with intermediate processing nodes between source and measurement nodes, or communication between measurement devices/sources.

A Proof of Lemma 3
In order to show Lemma 3, we use the following established results reviewed in Lemma 5 and Lemma 6.
Lemma 5. Let σ n be an n-qubit shared uniform random bit, and let the classical probability distribution upon measuring σ n be P(⃗ a).Then, the following inequality is true for any measurement basis, with equality occurring when measured in the computational basis.
Proof.Recall that the entropy of the measurement of a state is minimized when measured in its eigenbasis [34].An eigenbasis of σ n is the computational basis, which behaves like a classical coin flip upon measuring.Thus, the Shannon entropy is lower bounded by 1.
Lemma 6.Consider the distribution acquired through local measurements on a Bell state, that is for projective operators {Π a1 } and {Π a2 }.Then, for any choice of Π a1 and Π a2 , where the equality holds when measured in the computational basis.
Proof.By subadditivity [34], the Shannon entropy of measuring |Φ⟩ is at least the entropy of its marginal, which is σ 1 .Since σ 1 is a classical coin flip, it has a Shannon entropy of 1 and the entropy of |Φ⟩ is lower bounded by 1. Now, we present the proof for Lemma 3 below.
Proof.Recall the definition of measured mutual information in Equation (9).We must first determine the basis to measure in at each node, that is Π Ai ⃗ ai and Π Aj ⃗ aj .Moreover, for any two nodes A i and A j , the qubits received can be either maximally entangled or independent (maximally mixed).By Assumption 1.A, the measurement basis does not influence the entropies at each node.Thus, we can achieve the lower bounds in Lemmas 5-6 by measuring in the computational basis.
Knowing the basis of choice, we proceed to understand the graph-theoretic properties of the mutual information.Let N Ai s be the number of sources connected to device A i .Then, we know that H(P(⃗ a i )) = N Ai s and similarly with H(P(⃗ a j )) where P(⃗ a i ) and P(⃗ a j ) are probability distributions upon measuring at node A i and A j respectively.For the joint entropy H(P(⃗ a i , ⃗ a j )), partition A i ∪ A j into sets: Each pair of qubits in S 1 are entangled and act jointly as a fair coin flip.On the other hand, each qubit in S 2 acts independently of one another also like a fair coin flip.Moreover, each element in S 1 and S 2 is independent of each other and Shannon entropies are additive.Thus, Since the total number of qubits is 2|S 1 | + |S 2 | = H(P(⃗ a i )) + H(P(⃗ a j )), the joint entropy can be expressed as By definition of S 1 , we find the measured mutual information to be B Proof of Theorem 1 Proof.For sufficiency, observe that if two networks have the same topology, then the number of sources connected to A (1) i is the same as A i , and the number of sources shared between A (1) i and A (1) j is the same as A (2) i and A (2) j .By Lemmas 2 and 3, the von Neumann entropy of each node and measured mutual information of pairs of nodes are the same.
We now show necessity.Suppose the von Neumann entropy at each measurement node and the measured mutual information between any pair of measurement nodes for the two networks are identical.
First, we note that the two networks must have the same number of nodes; an immediate contradiction is reached otherwise.On the other hand, the two networks will also have the same number of links, which can be written alternatively using the von Neumann entropy as N ℓ = i S(A i ) using Assumption 1.A. Lastly, the number of sources must also be the same.Suppose not, and s .Since the number of links present in either network is the same, there must be at least one link ℓ connected to the preparation node in N (1) that is not connected to the same preparation node in N (2) .This means that the measurement device A i that was connected to A j via ℓ in N (1) must have lost the connection to A j in N (2) .Thus, the j ) and we've reached a contradiction.Now, focus on the case where the two networks have the same number of sources, links, and nodes.Define a triplet in a network to be a tuple of three elements, (A i , Λ k , A j ), such that A i and A j share Λ k .For two n-local quantum networks, we construct the map ξ such that: j ) is in N (1) and (A j ) is in N (2) , and (ii) performing the map ξ on all triplets t n in N (1) yields N (2) .Think of ξ as the map that "moves" N (1) to N (2) .In particular, when a triplet is present in both networks, we take ξ to be the identity; when a triplet is only present in one network, then ξ moves the corresponding triplet into a new location.This restriction is important since this removes the case that ξ cyclically moves edges, e.g., (1, 1, 2) → (2, 1, 3), (2, 1, 3) → (3, 1, 1), and (3, 1, 1) → (1, 1, 2).
This map can induce relabeling of indices.Let ϕ : [N s ] → [N s ] be the map that relabels the source indices, and φ : [N m ] → [N m ] be the one for measurement nodes.Then, we can can define ϕ and φ using ξ: If ϕ and φ are well-defined, then they are immediately bijective because we're comparing networks of equal sizes-nodes have to be mapped to (onto) and two nodes cannot be "squished" and become indistinguishable (one-to-one).Therefore, we will show that if ξ preserves the characteristic matrix, then ϕ and φ are welldefined and the two networks have the same topology.We do both by contradiction.If ϕ is not well-defined, then there are i, j, m, n i , Λ k , A i , Λ k , A for some ℓ ̸ = k.However, this means that connections between A (1) i and A (1) k are moved away upon applying ξ and which contradicts the assumption that ξ preserves the measured mutual information.
On the other hand, if φ is not well-defined, then there are j, k, ℓ, m (k ̸ = ℓ) such that ξ(A i , Λ k , A i , Λ k , A i , Λ ℓ , A (2)  n ) (66) for some m ̸ = i.However, this means that the connection to A (1) i from Λ (1) ℓ is moved away so i ) ≤ S(A i ) − 1 (67) which contradicts the assumption that ξ preserves the Shannon entropy.Thus, if two networks have the same characteristic matrix, then the two networks have the same topology.

C Mutual information and covariance of channel noise
Let ρ be the density matrix of the Bell state.we hope to calculate the mutual information and covariance between the two qubits after applying depolarizing and amplitude-damping noise independently on each qubit.We approach the calculation the same way.We first write down the density operator through the respective quantum channels, E(ρ), via the Kraus operator formalism.Then, we will find the classical distribution induced by measurement in the basis that maximizes the correlation quantity of interest.
Depolarizing noise Quantum channel that applies qubit-depolarizing noise can be written as the following summation: where {K i } are the Kraus operators of a single-qubit depolarizing channel Expanding the summation, the quantum state E(ρ) can be compactly written as Measuring the above state in the σ z basis yields the following probability distribution: The remainder calculation follows the definition of measured mutual information and covariance, which will lead to Equations ( 42)- (43).
Amplitude damping We follow a similar procedure in the case of applying amplitude-damping noise.Again, we can write the noisy quantum state similar to Equation (68) but with Kraus operators Expanding the summation yields the following density matrix: and measuring in the σ x basis-the basis that maximizes the observed correlation-is equivalent to measuring the state in the computational basis, that is, the induced classical distribution is encoded in the diagonal.Following definitions of mutual information and covariances respectively again yields Equations ( 45)-(46).

D Inference of 5-Qubit Zero State and 5-Qubit GHZ State IBM Hardware
In this section, we present the remainder of the results from our numerical experiments on IBM quantum hardware.Namely, we show the inference error when our variational scheme is applied to a 5-qubit zero state and a 5-qubit GHZ state.The former isolates the optimization of the von Neumann entropy, while the latter isolates the optimization of covariance and mutual information.We follow the same approach used for the inference of the |W ⟩ ⊗ |Φ⟩ as discussed in the main body of the paper.In Figure 10 and Figure 11 we plot the network inference for a 5-qubit zero state preparation |ψ⟩ = |00000⟩.Since |ψ⟩ is separable, for any two-qubit measurement Π qi ⊗ Π qj , the mutual information I(q i ; q j ) = 0 and the covariance is Cov(q 1 , q 2 ) = 0.As a result, randomly initialized measurements are optimal as shown in the simulated results in the top-right plot of Figure 10.On the other hand, the variance of any qubit is Var(q i ) ∈ [0, 1] and the Shannon entropy H(P(a i )) ∈ [0, 1] where the maximal variance and minimal Shannon entropy are both achieved only when the state |0⟩⟨0| is measured in the computational basis.Therefore, randomly initialized measurements must be optimized to achieve the optimal covariance matrix  As the number of shots increases we expect to see the network inference error decrease.This trend can easily be seen in the classical simulator data in the top row of Figure 10.First, note in the rightmost column that a 10x increase in the number of shots corresponds to roughly a 10x decrease in the amount of error.In the covariance, characteristic, and Shannon entropy optimizations, we find a similar pattern in which more shots leads to less error, however, the separation is not as profound as in the mutual information case because the covariance and Shannon entropy optimizations over measurements have some error.This error is reflected in the standard error bar on the classical simulator optimization, which plots the average optimization over 10 independent optimization runs.When we run the same optimizations on the IBM hardware, we find a similar trend where increasing the number of shots decreases the error.
In Figure 11, we visualize the network inference performance by taking the optimal matrix elements for the covariance and characteristic matrices across the whole optimization on IBM hardware.For the covariance-based inference case, we find that the inference error decreases as the number of shots increases.This trend does not hold for the characteristic matrix, which shows the error increases when more than 100 shots are considered.We largely attribute this feature to the noise on the IBM hardware, which is quite dynamic and can vary considerably over the course of an optimization.
In Figure 12 and Figure 13 we plot the network inference for a 5-qubit GHZ state preparation |ψ⟩ = 1 √ 2 (|00000⟩+|11111⟩).For any two-qubit measurement Π qi ⊗Π qj , the mutual information I(q i ; q j ) ∈ [0, 1] and covariance Cov(q i , q j ) ∈ [0, 1] where these values are maximal when Π qi = Π qj are the same measurement.As a result, randomly initialized measurements must be optimized to obtain their maximal values.On the other hand, the variance of any qubit is Var(q i ) = 1 and the Shannon entropy H(P(a i )) = 1 for any choice of measurement, hence randomly initialized measurements are optimal.Note that in the Shannon entropy plots of Figure 12.The ideal qubit covariance and characteristic matrices are both 5 × 5 matrices of ones.
As the number of shots increases we expect to see the network inference error decrease.This trend can easily be seen in the classical simulator data in the top row of Figure 12.For instance, note that for the Shannon entropy optimization, a 10x increase in the number of shots corresponds to roughly a 10x decrease in the inference error, which is a result of the Shannon entropy being constant for all measurements.For the other optimizations, the 10,000-shot case does not necessarily perform the best, but this can largely be attributed to finding local optima during optimization, causing the mean inference error to level off with wide error bars.When we run the same optimizations on the IBM hardware, we find that more shots do not necessarily decrease the inference error.We attribute this feature to the fact the IBM quantum hardware is noisy.Furthermore, the noise is not necessarily constant over the course of an optimization run.Thus, we suspect that considering too many shots allowed the noise to drift during optimization skewing the optimization.Furthermore, the numerical experiments were run serially from fewer shots to more shots, meaning that the performance of the IBM device might have also deteriorated considerably after the completion of the 100-shot experiment.
The noise in the IBM hardware is visualized in Figure 13.For both the covariance and characteristic matrices, we find the inference error to increase as the number of shots increases.First, this trend results from the fact that we take the maximal covariance and mutual information for each qubit pair, thus, in the 10-shot case statistical fluctuations lead to a larger covariance and mutual information, implying less error.Second, we observe in the 1,000 and 10,000-shot cases that the inference scheme fails for certain qubits.In these cases, either local optima are being found, or the IBM hardware is failing to produce entangled states.From our classical simulator data, we find that characteristic matrix optimizations are particularly susceptible to finding local optima, meaning that the results in Figure 13 could simply be the optimization finding local optima.In practice, these errors can be mitigated by running the optimization repeatedly from different initial settings.

Figure 3 :
Figure 3: Example triangle networks that are indistinguishable solely from von Neumann entropy.

Figure 7 :
Figure 7: The effect of statistical shot noise on calculating correlations under various prepared states.Mutual information and covariance are estimated using variational optimization with a step size of 0.05 for 30 steps.Each plot shows the correlation between qubit pairs under different entanglement structures.The threshold value (black line) is set to 0.05, and was chosen arbitrarily.From the experiment, we observe that covariance methods accurately identify the existence of entanglement, as shown in the case of (left) W states (Equation (47)) and (middle) GHZ states (Equation (1)).However, entropic methods are able to identify (right) the lack of entanglement better than covariance-based protocols.

Figure 8 :
Figure8: Variational quantum optimization of the covariance matrices and characteristic matrices for a W state and two-qubit GHZ state prepared on IBM Hardware.From left to right each column plots the covariance matrix optimization, the characteristic matrix optimization, the Shannon entropy minimization, and the classical mutual information maximization.Note that the Shannon entropy and mutual information optimizations are combined to construct the characteristic matrix.In each plot the blue circles show the 10-shot optimization, the orange diamonds show the 100-shot optimization, green plus signs show the 1,000-shot optimization, and red triangles show the 10,000-shot optimization.The x-axis shows the optimization step while the y-axis shows the inference error calculated as the Euclidean distance between the ideal covariance/characteristic matrix and the matrix in each optimization step.The first row shows the optimization data averaged over 10 runs on a finite-shot noiseless classical simulator, the second row shows the optimization data collected from the ibmq belem quantum computer, and the third row shows the data collected when the settings from the noisy IBM hardware optimization are reevaluated on a noiseless classical simulator.

Figure 10 :
Figure10: Variational quantum optimization of the covariance matrices and characteristic matrices for a 5-qubit zero state prepared on IBM Hardware.In each plot the blue circles show the 10-shot optimization, the orange diamonds show the 100-shot optimization, green plus signs show the 1,000-shot optimization, and red triangles show the 10,000-shot optimization.The x-axis shows the optimization step while the y-axis shows the inference error calculated as the Euclidean distance between the ideal covariance/characteristic matrix and the matrix in each optimization step.The first row shows the optimization data averaged over 10 runs on a finite-shot noiseless classical simulator, the second row shows the optimization data collected from the ibmq belem quantum computer, and the third row shows the data collected when the settings from the noisy IBM hardware optimization are reevaluated on a noiseless classical simulator.From left to right each column shows the covariance matrix optimization, the characteristic matrix optimization, the Shannon entropy optimization, and the classical mutual information optimization.

Figure 11 :
Figure 11:  In the top row, we plot the maximal value achieved for each term of the covariance matrix across all optimization steps.In the bottom row, we plot the maximal mutual information of each qubit pair (off-diagonals) and minimal Shannon entropy of each qubit (diagonal) across all optimization steps.The bar graph plots the Euclidean distance between the ideal and inferred matrices for each distinct number of shots.

Figure 12 :
Figure 12: Variational quantum optimization of the covariance and characteristic matrices for a 5-qubit GHZ state prepared on IBM Hardware.See Figure 10 for descriptions of individual plots.

Figure 13 :
Figure13: In the top row, we plot the maximal value achieved for each term of the covariance matrix across all optimization steps.In the bottom row, we plot the maximal mutual information of each qubit pair (off-diagonals) and minimal Shannon entropy of each qubit (diagonal) across all optimization steps.The bar graph plots the Euclidean distance between the ideal and inferred matrices for each distinct number of shots.