Fig. 3: Measurement and validation of probability distributions of the permanent and hafnian matrix functions in the graph-based quantum device.

a,h, Configurations of the graph-based quantum photonic device. The connectivity of nonlinear sources is set by rerouting single photons along different pathways. b,i, Topological structures of a bipartite graph (b) and a general graph (i). The edge thickness and colour represent the amplitude and phase, respectively. The real and imaginary parts of the edges are characterized by the two-photon correlation measurement. The edges with negligible thickness are not displayed for clarity. c,j, Measured probability distributions of all the perfect matchings for the bipartite graph in b (c) and the general graph in i (j), which correspondingly returns the distribution of modulus-squared permanent and hafnian matrix functions. The experimental results (green bars) are obtained by measuring four-photon coincidences for all the permutations of subgraphs (submatrices). The theoretical results (orange bars) are obtained by classically calculating the full distributions for all the permutations of subgraphs shown in b and i. The partial indistinguishability of photons has been taken into consideration. d,k, Bayesian analysis for validation that experimental data are from the quantum interference of indistinguishable processes, rather than from distinguishable ones, for the bipartite graph (d) and the general graph (k). e,l, Bayesian analysis for the validation of experimental results, ruling out the hypothesis of uniform graph. f,m, Statistical validation of genuine quantum interference using the correlation function. The experimental (green) and theoretical (red) C datasets are the plots for a full collection (total, 28) of the two-mode correlators Cij between all the paired output modes (i, j). A number of 5,000 (7,000) events in d and f (k and m) were collected with 68 h (120 h). g,n, Coefficient of variation (CV) and skewness (S) plane, allowing the discrimination between indistinguishable and distinguishable photons for the bipartite and general graphs. The experimental data (red circle) can be assigned to the cloud of indistinguishable photons (blue), far away from the cloud of distinguishable photons (yellow). The clouds of samples are numerically obtained from 5,000 random bipartite and general graphs. In c, j, f and m, the error bars refer to the ±1σ uncertainty estimated from photon statistics, and the centres for errors refer to the measured photons or normalized correlators.