Measuring relational information between quantum states, and applications

The geometrical arrangement of a set of quantum states can be completely characterized using relational information only. This information is encoded in the pairwise state overlaps, as well as in Bargmann invariants of higher degree written as traces of products of density matrices. We describe how to measure Bargmann invariants using suitable generalizations of the SWAP test. This allows for a complete and robust characterization of the projective-unitary invariant properties of any set of pure or mixed states. As applications, we describe basis-independent tests for linear independence, coherence, and imaginarity. We also show that Bargmann invariants can be used to characterize multi-photon indistinguishability.

Introduction.The relative geometrical arrangement of a set of quantum states determines properties such as the Hilbert space dimension they span or whether they can be simultaneously diagonalized.These properties are physically meaningful, being independent of gauge choices for the global phase of each state's wavefunction, and invariant under application of the same unitary transformation on all quantum states in the set.More generally, we use the terms relational or Projective-Unitary (PU) invariants to refer to properties of tuples of quantum states that are invariant under application of the same unitary transformation to each state in the tuple.The simplest example of a relational invariant is the two-state overlap ∆ 12 = tr(ρ 1 ρ 2 ), which for pure states reduces to 2 , with a clear operational physical interpretation.
One way to fully characterize relational information in a tuple of (generally mixed) quantum states, S = (ρ i ) N i=1 , is to perform individual tomographic reconstruction of each state.This is both experimentally costly and unnecessary, providing much more information than strictly needed.A more economical approach is to directly measure a set of invariant properties of a tuple of quantum states.We call such a set complete if it allows us to decide whether two tuples of quantum states S = (ρ i ) N i=1 , S = (σ i ) N i=1 are unitarily equivalent, in the sense that there exists a unitary operator U taking states from S onto their counterparts in S : σ i = U ρ i U † .In the above, we identified the relational properties of quantum states with equivalence classes (orbits) of the unitary group acting on tuples of quantum states.This approach follows the spirit of the Erlangen program in Geometry [1] (i.e.studying geometry via the lens of group actions and their invariants) and is justified by the fact that unitary channels constitute the most general inevitable operations allowed in quantum theory.Note that the same paradigm motivated the usage of invariant polynomials in the context of classification of entanglement classes subject to local unitary transformations [2].
In this Letter we introduce quantum circuits we call cycle tests, which enable the direct measurement of complete sets of Bargmann invariants for both mixed and pure quantum states.We review previous mathematical literature identifying complete sets of invariants for different scenarios.For the case of pure states, we show all necessary invariants can be incorporated in a single Gram matrix G ij = ψ i |ψ j , with suitable gauge choices so that all parameters in G are PU-invariants measurable by our proposed circuits.This operational approach to measuring and using Bargmann invariants results in applications such as multi-photon indistinguishability certification, and basis-independent tests of linear independence, imaginarity, and coherence.
We start by reviewing the definition of Bargmann invariants.Consider a tuple of m pure quantum states (understood as rank one normalized projectors) Ψ = (ψ 1 , ψ 2 , . . .ψ m ), where we used the shorthand ψ j = |ψ j ψ j |.We later consider the generalization to mixed states.The Bargmann invariant of this tuple of states is defined as [3,4]: We say that this invariant has degree m.Due to the suitable arrangement of bras and kets, the above expression is a well-defined PU-invariant function of states in Ψ.Note that, for m = 2, this invariant reduces to the overlap ∆ 12 = | ψ 1 |ψ 2 | 2 .Bargmann invariants have been studied in the context of characterization of photonic indistinguishability [5][6][7] and geometric phases [8,9].The phase of ∆ 12•••m is precisely the Pancharatnam geometric phase [10] acquired by a wavefunction |ψ 1 subjected to a sequence of projective measurements onto states ψ m , ..., ψ 2 , ψ 1 .Equivalently, it is the Berry phase acquired by a cyclic trajectory along the shortest (geodesic) cyclic path visiting those states [11] -for a review of these ideas, see [9].

Measuring Bargmann invariants.
Let us now describe a quantum circuit family that measures any Bargmann invariant ∆ 12•••m .We call these circuits cycle tests, and they are generalizations of the well-known SWAP test used to measure the two-state overlap ∆ 12 (see Fig. 1-a).The key gate in the cycle test circuit of Fig. 1-b is a controlled cycle permutation, which implements the cyclic permutation (12 • • • m) of the input states when the control qubit is in state |1 , and identity otherwise.It is easy to check that the final measurement of the auxiliary qubit gives an estimate of (∆ 12•••m ).The circuit of Fig. 1-a was proposed in [12] as a way to measure non-linear functionals of a single density matrix.Here, we use it with different inputs to estimate (∆ 12•••m ), and propose a modification with an added phase gate P = diag(1, i), to enable the measurement of (∆ 12•••m ) (see Fig. 1-b).Note that the cycle test reduces to the SWAP test for m = 2 states.Overlaps can also be evaluated as a particular case of degree-3 invariants, as -lower-degree invariants can always be recovered from higher-degree invariants with repeated indices.The cycle test circuit can be implemented in linear depth using nearest-neighbor gates only, or in a depth that scales like O(log m) if we assume all-to-all qubit connectivity, as we describe in Appendix A.
Complete characterization of relational information between states.The following Theorem gives a complete characterization of PU-invariant properties of a collection of N pure sates in terms of Bargmann invariants.
Theorem 1 (Characterization of relational properties of pure states).Let Ψ = (ψ i ) N i=1 be a tuple of pure quantum states.Then, the PU-equivalence class of Ψ is uniquely specified by values of at most (N − 1) 2 Bargmann invariants.The invariants are of degree m ≤ N and their choice depends on Ψ.
The above Theorem follows from results obtained by Chien and Waldron in [4].In what follows we present a simplified and shortened proof.Our strategy is based on encoding complete PU-invariants in a single Gram matrix in a way that depends on orthogonality relations of states in Ψ.This allows us to upper bound the number of necessary invariants by (N − 1) 2 .and employ the results to the problem of approximate PU equivalence of quantum states.
Proof.We start with the connection between PU equivalence of two tuples of pure states Ψ = (ψ i ) N i=1 , Φ = (φ i ) N i=1 and unitary equivalence between the associated tuples of wave-functions.Namely, Ψ is PU equivalent to Φ if and only if it is possible to find representing wave functions A = (|ψ i ) that are unitarily equivalent.That is, there exists an unitary operator U such that |φ i = U |ψ i , for i = 1, . . ., N .The problem of unitary equivalence of tuples of vectors is equivalent to equality of the corresponding Gram matrices i.e., this follows e.g. from the uniqueness the Cholesky decomposition of G [13]).The phase of individual wave functions |ψ i is an unphysical, gauge degree of freedom, and therefore the Gram matrix of a collection of pure states Ψ is uniquely defined only up to conjugation via a diagonal unitary matrix.Assume now that for every tuple of quantum states Ψ = (ψ i ) N i=1 we have a construction (presented in the next paragraph) of a valid Gram matrix GΨ whose entries can be expressed solely in terms of PU-invariants of states from Ψ.It then follows from the above considerations that Ψ is PU equivalent to Φ if and only if GΨ = GΦ .
The construction of GΨ proceeds as follows.We first introduce the frame graph Γ Ψ as an (undirected) graph whose vertices are labeled by i = 1, . . ., N with edges connecting i and j if and only if tr(ψ i ψ j ) = 0. Without loss of generality we assume that Γ Ψ is connected [14] i.e., that every pair of vertices in Γ Ψ can be connected via a path in Γ Ψ .We can now choose a subgraph of Γ Ψ , denoted by T Ψ , which is connected and contains the same vertices as Γ Ψ , but no cycles.This is known as a spanning tree of Γ Ψ , and there exists at least one spanning tree for any connected graph [15] -see Fig. 2 for an illustration.We now choose vector representatives |ψ i of states in Ψ in such a way that, for {i, j} an edge in T Ψ , ψ i |ψ j = | ψ i |ψ j |.Every other inner product ψ i |ψ j will be either 0, or its phase will be fixed as follows.We first find a path from j to i within T Ψ .Since T Ψ is a spanning tree, such a path is guaranteed to exist and to be unique.Suppose this path has k vertices (α 1 = j, α 2 , . . ., α k−1 , α k = i).Consider now the k-cycle that would be formed by adding the vertex j at the end of this path (note that vertices i and j are connected by an edge in Γ Ψ ) and denote it by C ij .By construction, every edge in C ij except for {i, j} is FIG. 2. Frame graph for the example described in the text.
Edges in black correspond to the choice of spanning tree, in this case a star graph.
in T Ψ , and therefore all the inner products ψ αj ψ αj+1 for j ∈ {1, 2, . . .k} have been chosen as positive.Hence, if we denote the degree-k Bargmann invariant associated to Therefore, we can fix the phase of every nonzero inner product that is not in T Ψ as Thus, all matrix elements of the so-constructed Gram matrix GΨ ij = ψ i |ψ j are expressed via Bargmann invariants of degree at most N .The total number of invariants required to construct GΨ in this way is upper-bounded by (N − 1) 2 , as we first measure N (N − 1)/2 degree-2 invariants to obtain the frame graph, and then at most (N − 1)(N/2 − 1) additional invariants to fix the phases of the non-null elements of GΨ corresponding to edges {i, j} / ∈ Γ Ψ .
We remark that in general we cannot characterize the relational properties of even single-qubit states without using Bargmann invariants of degree m > 2. As an example, take two triples of single-qubit states Ψ = (|X , where |P ± P ± | are projectors on Pauli eigenvectors with ±1 eigenvalues.All overlaps within each tuple have the same value ∆ ij = 1/2.Therefore, the tuples only differ in that Let us now consider an application of theorem 1 to a N = 9 state tuple (ψ i ) i=1...9 .The first step is to construct the frame graph.This is done by measuring all N (N − 1)/2 = 36 overlaps | ψ i |ψ j |.Suppose the frame graph is the one represented in Fig. 2 (recall that missing edges correspond to null overlaps).One choice of spanning tree is a star graph, where vertex 1 is connected to every other.We can fix the phases so that every degree-2 invariant ψ 1 |ψ i > 0. Finally, we consider all cycles that can be built by adding edges from the original frame graph to the spanning tree (in Fig. 2, these correspond to gray edges).In each such cycle, there is only one new edge whose phase has yet to be fixed; in this example only 3-cycles appear.We then measure the degree-3 Bargmann invariants ∆ 1ij for all distinct pairs {i, j}, and attribute its phase to edge {i, j}.There are 28 of these for this example size, though in Fig. 2 only 10 of them are nonzero.This procedure leads to the Gram matrix: for j > i. ( The gauge choices involved in defining the Gram matrix given in Eq. ( 4) mean that all parameters in GΨ are physically meaningful quantities, measurable using the cycle test circuits and fully characterizing relative information among states in Ψ.
The choice of spanning tree is not unique.In the above example, we could have chosen instead e.g. a simple path starting in vertex 1 and visiting all vertices sequentially up to vertex 9. Building the Gram matrix GΨ using this path requires the same number of invariants, but they are more experimentally involved to measure, as some will have degree > 3.An interesting open question is to find alternative characterization procedures for general scenarios that minimize the experimental effort required.
Robustness, and mixed states.Any implementation of cycle tests will have to deal with experimental imperfections, and the fact that the prepared states will, at best, be mixed-state approximations of the ideal pure states.In Appendix B we give an argument that, as long as the prepared density matrices have high purity, then the Bargmann invariants measured will be close to the Bargmann invariants of the target pure states (understood to be the projector onto the eigenvector corresponding to the largest eigenvalue of a density matrix).Furthermore, in Appendix C we show that if Bargmann invariants evaluated for two tuples of pure states Ψ = (ψ i ) N i=1 , Φ = (φ i ) N i=1 differ from each other only slightly, then states comprising them can be approximately transformed onto each other.Specifically, using the encoding of Bargmann invariants into Gram matrices we show that there exists a unitary transformation U that approximately transforms Ψ onto Φ in the sense that the average infidelity is upper bounded by where C Ψ is a constant (depending on Ψ), GΨ , GΦ are Gram matrices from the proof of Theorem 1, and X 2 = Tr(X 2 ) is the Hilbert-Schmidt norm.This shows that Bargmann invariants offer a robust characterization of PU equivalence of tuples of pure states.
Identifying complete sets of PU-invariants for tuples of mixed states is a much more challenging problem.If we use mixed states ρ i (i = 1, 2, . . ., m) as inputs to the cycle test circuits of Fig. 1, the output gives an operational meaning to mixed-state Bargmann invariants: ∆ 12...m = Tr (ρ 1 ρ 2 . . .ρ m ).In Appendix D we show that for a tuple of N mixed states S = (ρ i ) N i=1 in dimension d Bargmann invariants of degree m ≤ d 2 form a complete set of invariants characterizing PU invariant properties of S.Moreover, the number of independent invariants can be chosen to be N d 2 + 1.These results follow from known results from invariant theory [16][17][18], which we (partially) reprove with the help of Schur-Weyl duality.
Application: Testing for linear independence.Whether a set of states is linearly independent (LI) is clearly a unitary-invariant property.LI states can be probabilistically cloned, and can be unambiguously discriminated.Recognizing linear dependence of a set of states enables us to find a more compact description of the set; in machine learning, this corresponds to a procedure for dimensionality reduction.Using a complete set of Bargmann invariants, we can compute the hypervolume generated by the set of states to determine whether they are linearly independent.For the case of m non-orthogonal vectors, we can use the Gram matrix encoding of the complete set of invariants we have described to write the linear independence condition simply as: det(G) > 0. In Appendix E we calculate det(G) explicitly as a function of the invariants for the cases of 3 and 4 non-orthogonal states.
Application: Basis-independent imaginarity witnesses.Measuring Bargmann invariants of degree 3 and above can serve as a basis-independent witness that the input quantum states have complex-valued amplitudes.The simple reason is that ∆ 12...m is a gauge-invariant quantity, so if we measure (∆ 12...m ) = 0, some of the density matrices at the input must necessarily have complexvalued elements, independently of the basis chosen.As an example, it is easy to check that the 3 Pauli operator eigenstates ) achieves the maximum value of (∆ ABC ) = 1/4 for this 3-state scenario.In Appendix F we describe a tuple of n single-qubit states that are vertices of a regular spherical n-gon on the Bloch sphere, for which (∆) → 1 as n → ∞.
Experimental tests have been recently proposed to discriminate whether complex amplitudes (or "imaginarity") are an essential feature of quantum theory [19,20].The application of our proposal as an imaginarity witness differs fundamentally from the proposals of [19,20].In particular, though basis-independent, our approach is not device-independent.Concretely, we can only interpret the outcome of the circuit of Fig. 1(b) as measuring a set of Bargmann invariants if the input is promised to be a product state.Therefore, we cannot rule out an adversarial preparation of the states that might fool our imaginarity witness by using an entangled real-amplitude state, similar to techniques of [21].
Application: Basis-independent coherence witnesses.If the m states ρ i are simultaneously diagonalizable in a single reference basis, the degree-m Bargmann invariant ∆ 12...m = Tr( i ρ i ) is simply the probability that independent measurements of the reference basis on all states give the same outcome [22].Hence, for diagonal states these invariants must be real and in the range . Measuring (∆ 12...m ) = 0, or real values outside of the allowed range for diagonal states, serves as a basis-independent witness of coherence, generalizing the overlap-based witnesses of [22].Note that witnesses of imaginarity, as discussed in the previous section, are also witnesses of coherence, as complex-valued entries of a density matrix must be off-diagonal.In Appendix G we look at the simplest scenarios where coherence can be witnessed by Bargmann invariant measurements when we have sets with either 2 or 3 states.
Application: Characterization of photonic indistinguishability.The formalism of Bargmann invariants and projective unitary invariance is particularly well-tailored to experiments with single photons in linear optics [8].Each photon in an m-photon experiment is described by a state over its internal degrees of freedom -such as timeof-arrival, polarization, and orbital angular momentum [23].Suppose we apply some linear-optical transformation to these photons that is insensitive to their internal degrees of freedom, and measure the occupation number at the output of the device.The outcome statistics will not depend on exactly which internal state a particular photons is in, as the apparatus is blind to this information, but it will depend on the relational information, such as imperfect overlaps, which can cause the photons to be effectively partially distinguishable.In other words, the output probabilities of such an experiment can only depend on the Bargmann invariants of the set of states (as well as the linear-optical transformation).This can be seen in several recent experimental and theoretical works concerning genuine 3-and 4-photon indistinguishability [5-7, 22, 24].
In [22], it was shown how measurements of some overlaps among a set of m states can result in nontrivial lower bounds for all overlaps.Bargmann invariants of higher degree can be useful in the same way, as by definition |∆ 12...m | 2 is a lower bound to overlaps of all neighboring states in the associated cycle.This suggests improved designs for photonic measurements of Bargmann invariants may help in the characterization of multi-photon sources.
Conclusion.We reviewed how Bargmann invariants encode the projective-unitary invariant properties of a set of states.For the case of pure states, we have shown how to represent the complete information in a Gram matrix of inner products, written in terms of invariant quantities only, representing relational information about the states in the set.We have proposed a way of measuring real and imaginary parts of arbitrary Bargmann invariants = FIG.3. Decomposition of a 16-qubit cyclic permutation in terms of nearest-neighbor SWAP gates.
using cycle tests, a natural generalization of the SWAP test.We discussed several applications: coherence and imaginarity witnesses, testing for linear independence, and characterization of multi-photon indistinguishability. Open problems include finding efficient NISQ methods for measuring and using Bargmann invariants in algorithmic applications, studying possible applications to self-testing in a semi-device independent context [25,26], and developing further the resource theories of imaginarity and coherence based on Bargmann invariants, whose first steps we have described.

Appendix A: Efficient constructions for cycle test circuits
In the main text we described how to use an m-state cycle test (cf.Fig. 1 of main text) to measure the mth order Bargmann invariant of the corresponding set of states.The main ingredient of the cycle test is a controlled permutation gate which applies a cyclic permutation when the control qubit is in the |1 state (and does nothing otherwise).We now describe two efficient ways of implementing this controlled cycle permutation.For simplicity, we consider first how to decompose a cyclic permutation in terms of pairwise permutations (i.e.transpositions), without accounting for the control qubit, to which we return at the end of this Section.Let us denote C k = (1, 2, 3, . . ., k) as the cyclic permutation on k elements, and (i, k) as a permutation of two elements (or transposition) i and k.A well-known decomposition of a cyclic permutation in terms of transpositions is given by This decomposition uses only adjacent transpositions, which is equivalent to swapping only nearest-neighbor qubits at a time.It leads to a circuit as exemplified in Fig. 3.This circuit uses the optimal number of (k − 1) nearest-neighbor transpositions and has depth (k − 1).That (k − 1) is the optimal number follows from the need to move the first element to the last position, which requires exactly (k − 1) nearest-neighbor transpositions.It is possible to give an alternative decomposition that has much smaller depth, at the cost of using longer-range transpositions.To see it, consider first the following Lemma: Lemma 1.Consider the following two disjoint cycles (1, 2, . . .k) and (k+1, k+2, . . ., n).We have the following decomposition: The proof of this Lemma is straightforward, it simply requires checking the images of numbers 1, k, k +1, and n under the sequence of permutations, as all other numbers get trivially mapped to the correct places.
A very efficient decomposition of C m can now be obtained by applying Lemma 1 repeatedly.Suppose, for simplicity, that m is a power of 2. Then we can first decompose C m into two cycles acting on m/2 elements followed by one transposition, i.e.C m = (1, m/2 + 1)(1, 2, . . ., m/2)(m/2 + 1, m/2 + 2 . . .m).We then break each cycle of size m/2 again in two cycles, acting each on m/4 elements.This divide-and-conquer algorithm is iterated until all that is left are transpositions.It is easy to see that this procedure terminates after O(log m) steps, and hence that the final circuit has depth O(log m) as well.An example of this for m = 16 is shown in Fig. 4.
These are not the only decompositions of the cycle permutation in terms of transpositions, but they represent two extreme regimes.In the first, we have only nearestneighbor SWAP gates, but the depth of the circuit is large.In the second, the depth is logarithmic, but longerrange gates are required.Which is the most efficient depends on the constraints of the particular architecture being used-the latter has the benefit of mitigating accumulation of errors in the circuit, but in particular architectures long-range gates might not be an option.
Let us now return to the issue of decomposing a controlled cycle permutation.At first glance, neither decomposition we described has the promised properties.The circuit in Fig. 3 is no longer composed only of nearestneighboring controlled-SWAP (or Fredkin) gates, since the first qubit must control the swapping of states that are distant to it.At the same time, the circuit of Fig. 4 does not have logarithmic depth since every gate in the circuit must be controlled by the same control qubit, which presumably means that all gates must be done sequentially.Nonetheless, both circuits can be adapted to restore the desired properties, as follows.
In Fig. 5 we show how the controlled version of circuit in Fig. 3 can be implemented using only gates (SWAP and Fredkin) that act on neighboring qubits.
To obtain a controlled version of Fig. 4 that has depth O(log m), as in the original, we need to include more ancilla qubits to parallelize the control operation.Instead of controlling the permutations with a single 1 √ 2 (|0 +|1 ), we need to build an m/2-qubit GHZ state 1 √ 2 (|0 ⊗m/2 + |1 ⊗m/2 ), such that each qubit in this state can control a different SWAP gate in parallel.The whole construction still has logarithmic depth due to the follow Lemma (also cf. Figure 2 in [27]): Lemma 2. [27] The m-qubit GHZ state: can be generated by a circuit that acts on the |0 ⊗m state, is composed only of a single Hadamard and a sequence of CNOT gates, and has depth O(log m).
Proof.We initialize m qubits in the |0 ⊗m state, and apply a Hadamard gate to the first one.Our goal is now to apply a sequence of CNOT gates that will flip every qubit conditioned on the first qubit being |1 and does nothing otherwise.This can be done as follows.In the first round, we apply a CNOT gate from qubit 1 to qubit 2.
In the second round, we apply two CNOTs, from qubits 1 and 2 to qubits 3 and 4, respectively.We repeat this procedure by reusing previously flipped qubits as controls for the next layer.The number of qubits flipped in this manner doubles with each layer.Hence, it follows that this will generate an m-qubit GHZ state in O(log m) layers of two-qubit gates.
For the controlled version of Fig. 4 to work properly when using the GHZ state as the ancilla, we need to perform the operation described in the proof of Lemma 1 in reverse at the end of the cycle test protocol.This is required to disentangle the ancillas with the control qubit, such that interference can occur properly at the last H gate in Fig. 1.In any case, it follows that the entire controlled-cycle protocol works in depth O(log m).

Appendix B: Bargmann invariants for almost pure states
In experiments to measure Bargmann invariants, the preparations will result in mixed states that only approximate the target pure states.Here we prove two lemmas that show that Bargman invariants computed for mixed states with high purity will have values close to those of the ideal, target pure states.Proof.: Let λ be the maximal eigenvalue of ρ.Write (as the maximal value for Tr(G 2 ) = 1).Then we have: As a result we obtain as we wanted to demonstrate.
where in (B14) we employed a well-known inequality |Tr(XY )| ≤ X ∞ Y 1 , while in (B15) we used C m ∞ = 1 (C m is a unitary operator) and subaddtitivity of 1-norm: Combining the above two lemmas we get that Bargmann invariants computed for mixed states with high purity approximate Bargmann invariants computed for collection of pure states corresponding to projectors onto eigenvectors corresponding to the highest eigenvalue.
Corollary 1.Let S = {ρ 1 , . . ., ρ N } be collection of mixed states that satisfy Tr(ρ 2 i ) ≥ 1 − for ∈ [0, 1/2] and let Ψ = {ψ 1 , . . ., ψ N }, where ψ i is a projector onto an eigenvector corresponding to the largest eigenvalue of ρ i .Then for for arbitrary sequence i k ∈ {1, . . ., N } of length m we have The following result is a quantitative variant of Theorem 1-it shows two collections of pure states Ψ,Φ can be transformed onto each other approximately provided the relevant Bargmann invariants approximately match.
Lemma 5 (Robust Characterization of PU equivalence via Bargmann invariants).Let Ψ, Φ be two tuples of pure states with m elements each: Moreover, assume that Bargmann invariants used to construct GΨ , GΦ are such that (C2) where, • ∞ , • 2 denote operator and Frobenius norm respectively and A ‡ is a Moore-Penrose pseudo inverse [28].Then, there exist a unitary U such that where In other words, closeness of Bargmann invariants defining Gram matrices GΨ , GΦ implies that under a suitable unitary transformation U the average-state infidelity between states Ψ and Φ can be upper bounded as in (C3).
Remark 1.We note that in order to construct Gram matrices GΨ , GΦ we need to assume that tr(ψ i ψ j ) = 0 if and only if tr(φ i φ j ) = 0 (in other words that frame graphs defined in the proof of Theorem 1 are identical, Γ Ψ = Γ Φ ).Furthermore, we assume that both matrices GΨ , GΦ are constructed using the same spanning tree of the corresponding frame graph.
Proof.The proof follows from the stability of the celebrated Procrustes problem discussed in [28].In Theorem 1 from that work it was shown that if Gram matrices of two tuples of vectors (C6) then there exist a unitary transformation U such that (C7) We can now apply this result directly to Gram matrices GΨ , GΦ constructed form Bargmann invariants (and vector representatives of states form Ψ, Φ compatible with these Graam matrices).To pass from (C7) to (C3) we note that for normalized wavefunctions |ψ , |φ we have Appendix D: Complete PU invariants for mixed states In this Appendix we show that Bargmann invariants can be used to decide unitary equivalence of two tuples of (generically mixed) quantum states S = (ρ i ) N i=1 , S = (σ i ) N i=1 .This result was previously established in [16].
Here, we present a self-consistent proof based on Schur-Weyl duality.After presenting this general result, we remark on the connection of the unitary equivalence problem with the question of simultaneous conjugation of tuples of matrices.This connection allows us to state bounds on the degrees and number of independent Bargmann invariants.
We begin by introducing polynomial invariants of linear group actions of compact groups in real vector spaces (see e.g.[29,30] for an introduction to representation theory and invariant theory).Let G be a compact group and let be a representation of G in a finite dimensional real vector space V [31].Since G is compact we can assume that Π g is an orthogonal transformation.Homogeneous polynomials of degree m in V are mappings of the form where •, • is the invariant inner product in V ⊗k (induced by the inner product on V ), and p ∈ V ⊗m is a tensor encoding the polynomial p.We will denote by P k (V ) the space of real homogeneous polynomials on V of degree m.By P(V ) we will denote the space off all polynomials on V .Invariant homogeneous polynomials of degree m are polynomials that additionally satisfy p(Π g v) = p(v) for every v ∈ V, g ∈ G . (D3) Using orthogonality of Π g it can be shown that (D3) is equivalent to requiring Π ⊗m g p = p for every g ∈ G . (D4) We will denote the set of all invariant polynomials by P(V ) G .It is a well known result in invariant theory that in the case of compact groups we can use invariant polynomials P(V ) G to decide about equivalence of elements of V under the action of G.In other words for v, w ∈ V we have w = Π g v, for some g ∈ G if and only if for every invariant polynomial p ∈ P(V ) G we have p(w) = p(v) (see e.g.Theorem 2.4.1 in [32] for the elementary exposition in the context of entanglement theory).The problem of unitary equivalence of N tuples of density matrices in C d can be presented using the formalism outlined above.Let where Herm(C d ) denotes a (real) vector space of Hermitian matrices on C d .Every X ∈ V can be identified with a tuple of linear operators: Let U(d) denote the group of unitary matrices in C d .This group can be represented on V via simultaneous conjugation: where Ad U [X] = U XU † is the adjoint representation of U(d) on Herm(C d ).We remark that the problem of orbit classification with respect to this so-defined representation of U(d) corresponds exactly to the problem of unitary equivalence of tuples of mixed states S = (ρ 1 , . . ., ρ N ), S = (σ 1 , . . ., σ N ) discussed in the main text.Using the unitary equivalence of vector spaces where {|i } N i=1 is an orthogonal basis of R N .In this language the representation Π U defined in (D7) is equivalent kp lp , that depend on τ and the sequence i 1 , i 2 , . . ., i m .This shows that p τ (X) can be expressed as a product of Bargmann invariants of degree at most m.
Since an arbitrary real polynomial invariant p ∈ P(V ) U(d) can be expressed via a suitable linear combination of p τ , we finally conclude that Bargmann invariants decide simultaneous unitary equivalence of two tuples of Hermitian operators X = (X 1 , . . ., X N ), Y = (Y 1 , . . ., Y N ) operating in C d .Restricting to density matrices we see that the above considerations proved the desired result for equivalence of tuples of mixed states.
Theorem 2. Let S = (ρ 1 , . . ., ρ N ), S = (σ 1 , . . ., σ N ) be two tuples of mixed states on C d .Then, there exist U ∈ U(d) such that for every i = 1, . . ., N if and only if for every m and for every sequence i 1 , i 2 , . . ., i m of numbers from {1, . . ., N } the corresponding Bargman invariants of degree m agree We conclude this part by remarking about the degree and number of generating polynomials that suffice to decide unitary equivalence of tuples of density matrices in C d .Bargmann invariants Tr(X i1 X i2 . . .X im ) are relevant also for the problem of simultaneous matrix conjugation [16][17][18].This is a related equivalence problem in which the unitary group U(d) is replaced by the special linear group SL(d) (a group of d × d matrices with unit deter-minant) with a representation on N -tuples of matrices defined by ) where X i ∈ End(C d ) and Z ∈ SL(d).It turns out that the same Bargmann invariants decide the problem of equivalence of (closures of) orbits of group action in this scenario.Because of this the ring of invariant polynomials generated by Tr(X i1 X i2 . . .X im ) has been extensively studied in the context of invariant theory -see Section 13.9.2 in [18] for an accessible exposition.It follows from the discussion contained there that the degrees of Bargmann invariants generating the whole invariant ring P(V ) U(d) are at most m ≤ d 2 .Furthermore, the number of independent invariants can be chosen to be N d 2 + 1 and can be found efficiently in time polynomial in both d and N .

Appendix E: Conditions for linear independence
As described in the main text, we can parameterize the Gram matrix G so that a complete set of Bargmann invariants are represented in the matrix elements.The condition for linear independence is simply: Having measured all the necessary invariants, the determinant of the resulting numerical Gram matrix G can be computed efficiently.
To illustrate the type of dependence on the Bargmann invariants that results, below we will work out the expression for det(G) for m = 3, 4 normalized pure states (which we assume to be non-orthogonal).We will use the construction of the Gram matrix presented in Theorem 1 of the main text, choosing for the spanning tree the star graph with state |ψ 1 as the central node.For 3 pure states |ψ 1 , |ψ 2 , |ψ 3 , we write the Gram matrix: where we have parameterized G in terms of overlaps, i.e.
The case of 4 states with no null overlaps can be analyzed similarly, using overlaps and phases of degree-3 invariants.The Gram matrix in this case can be written thus: It is clear that any set of m states without null overlaps can be analyzed similarly, with the linear independence condition expressed in terms of invariants of degree 3.As discussed in the main text, more complex orthogonality conditions results in frame graphs that require higherorder invariants for a complete characterization of the PU-equivalence class.
∆ 12 , ∆ 13 , ∆ 23 , and ∆ 123 .As discussed before, for simultaneously diagonal (i.e., coherence-free) states ∆ 123 is the probability that independent measurements of the reference observable on the 3 states give the same outcome (and similarly for ∆ ij and state pair ρ i , ρ j ).So the first type of witness would result if the 3-state Bargmann invariant was complex, or real negative.Following [22], we find the polytope of allowed 4-tuples (∆ 12 , ∆ 13 , ∆ 23 , ∆ 123 ) by listing the allowed deterministic states in this space, and calculating their convex hull.For this scenario, the allowed deterministic states are given in Table I.The corresponding polytope facets, character-  izing all 4-tuples of invariants consistent with coherencefree states, are given by inequalities: Any violation of ineqs.(G1-G3) is a witness of coherence, and these inequalities are strictly stronger to detect coherence than the imaginarity witnesses we have introduced, or previous basis-independent coherence witnesses based on overlaps [22], measured recently in [24].We can see this with a simple example.Consider 3 singlequbit states equally spaced on the xz plane great circle of the Bloch sphere.These states have real amplitudes, so their coherence cannot be witnessed via imaginarity witnesses; it can be easily checked also that these equalvalued overlaps r 12 = r 13 = r 23 = 1/4 are compatible with coherence-free states [22].This set, however, results in ∆ 123 = −1/8, hence witnesssing coherence due to violation of ineq.(G1).

FIG. 4 .
FIG.4.Decomposition of a 16-qubit cyclic permutation in terms of SWAP gates.This circuit is much more parallelized compared to that of Fig.3, although the trade-off is the requirement of long-range swaps.

FIG. 5 .
FIG.5.An adaptation of the circuit of Fig.3that obtains a controlled cycle permutation with SWAP and Fredkin gates acting only on neighboring state.The first qubit is swapped along the 1D chain as each Fredkin gate is applied.The star at the output indicates where the control qubit is effectively left at the end of the circuit.

TABLE I .
Each row is one of the possible deterministic assignments to the Bargmann invariants describing the 3-state scenario.The convex hull of the rows characterizes all allowed 4-tuples of invariants for simultaneously diagonal, i.e. coherence-free states.