Graph theory that can be used to model the pairwise relation between objects provides a powerful tool to pictorially describe quantum devices and systems. For example, graph states are the key resource for measurement-based universal quantum computing1,2. Quantum walks on graphs allow the simulations of transport processes in networks3,4,5. The use of graphs allows the characterizations of quantum correlations6 and investigations of quantum networks7. Recently, different to these graph quantum connections, another interesting model-and-device correspondence between the abstract graph theory and the quantum photonic experiment has been proposed8,9,10,11. In this framework, graphs can virtually describe different quantum photonic components, devices, setups and systems, based on nonlinear photon-pair sources and linear optical circuits. Graph theory can be adopted to interpret, model and design diverse advanced quantum photonic experiments8,9. Adopting the visualizability and mathematical machinery of graphs, it allows the discovery of complex entanglement resources and even previously unexplored capabilities for quantum technologies10,11. However, realizing graph-based quantum devices remains significantly challenging experimentally, as it requires global quantum coherence over the device to impose genuine multiprocess quantum interference.

In this work, we demonstrate a graph-theoretical quantum photonic device of nonlinear optical sources and linear optical circuits by very-large-scale integration (VLSI) of silicon quantum photonics. The topologies of graphs are physically defined by the connectivity of nonlinear optical sources and by the pathway of single photons in linear optical circuits, and can be arbitrarily reprogrammed by reconfiguring the device structures. The device is able to implement very general linear optical quantum experiments. As two examples, we reprogram it to generate and verify complex structures of genuine multipartite multidimensional entanglement, as well as measure the distributions of perfect matchings of general (bipartite) graphs corresponding to the modulus-squared hafnian (permanent) matrix functions. Note that the graph-theoretical quantum devices here are different to the graph states for one-way quantum computing1,2 or quantum walk on graphs3,4,5 (Supplementary Section 7).

Figure 1a–c illustrates the correspondence between graph theory and quantum device, describing pairwise relations in mathematical and physical representations, respectively. The pairwise relation can be described by a complex-weighted undirected graph G = (V, E), with a set of edges E that connects pairs of vertices V, with n vertices in total. Determining the number of perfect matchings of a graph (a perfect matching is a subgraph in which every vertex is linked to exactly one edge) is equivalent to estimating the hafnian function of the adjacency matrix of the graph, that is, #-P hard12. The original scheme was proposed in bulk optics, to map an abstract graph to a physical setup8,9,10,11. In such a mapping, each pathway of a single photon represents a vertex, and each nonlinear crystal represents an edge. The detected multiphoton quantum correlations at the output of the device returns the number of perfect matchings of the graphs. This correspondence promises a type of versatile quantum photonic device based on graph theory, and could provide a fresh perspective on the existing ones13,14,15.

Fig. 1: A VLSI graph-theoretical quantum photonic device.
figure 1

ac, Diagrams of a graph-based quantum device with 4 × 4 nonlinear photon-pair sources in bulk optics (a) and integrated optics (b), which can directly encode and process a complex-weighted undirected graph (c). An example to illustrate the correspondence of graph theory and quantum device: one pair of single photon created at the source (3,2) and separately routed along the orange and purple pathways corresponds to an edge linked to two vertices in c. The device is fully programmable, consisting of switchable nonlinear photon-pair sources and reconfigurable linear optical waveguide circuits. The device in b monolithically integrates 2,446 components, including 32 spontaneous four-wave mixing degenerate photon-pair sources, 216 phase shifters and 432 transmission lines, 351 low-loss beamsplitters, 463 ultralow-loss waveguide crossers, 420 length-matching delay lines, 100 optical optical inputs/optical outputs (OIs/OOs) and 432 electronic inputs (EIs). Each source can be turned on or off or a state in between using the Mach–Zehnder interferometer keys to alter the edge amplitudes, whereas each phase shifter before the erasers can be addressed to alter the edge phases. By coherently erasing the which-source information using an array of pathway erasers, genuine quantum interference of indistinguishable processes of photon generation takes place. d, Photograph for the ‘Boya’-graph-based quantum device in a 200 mm silicon-on-insulator (SOI) wafer, fabricated by complementary metal–oxide–semiconductor processes. The white dashed box refers to a single copy of the device. e, Characterizations of waveguide crossers with a measured loss of 0.038(4) dB each. f, Classical characterizations (associated with the real part of the graph’s edges) of four eight-mode reconfigurable linear optical circuits. The colour in each grid represents the measured classical statistical fidelity and a mean value of 0.925(32) is obtained from all the 256 measured fidelities. The losses are corrected by normalizing the outcomes. g, Histogram of the measured contrast (C) of all the RHOM quantum interference fringes between two adjacent sources. h, Heralded RHOM quantum interference fringe. It quantifies the indistinguishability of separate quantum processes that create pairs of single photons. A number of 5,600 fourfold coincidence counts (CC) were collected. The error bars (±1σ) in e are given by characterizing five copies of chips in different dies; the error bars (±1σ) in g and h are estimated from Poissonian photon statistics.

Retaining quantum coherence over the entire device is the key16,17. We achieve this by ensuring all the processes contributing to multiphoton correlations are quantum-mechanically indistinguishable. Figure 1a shows an example of the bulk optical scheme for implementing the quantum device. Pairs of single photons, generated in different crystals and routed along different pathways to the same detectors, are no longer distinguishable and undergo quantum interference of identical processes. At each crystal, pump photons must synchronously meet with the incoming single photons from the previous crystal. Pump beams must simultaneously reach the crystals positioned in the same column. That is, one cannot identify the which-source information of single-photon generation. In addition, pumps and single photons have different colours and they typically propagate non-collinearly in bulk optics. Thus, retaining global coherence of the device requires complex and precise control of many-photon wavefunctions in the temporal, spatial and spectral domains. Moreover, processing different graphs requires a strong reconfigurability of the device, achievable by altering the links (amplitudes and phases) between crystals and rerouting single photons in linear circuits. Implementing such a lattice in bulk optics, even for a small-scale demonstration, remains experimentally challenging.

We demonstrate an integrated graph-based quantum device with VLSI silicon photonics (Fig. 1b,d). We call it ‘Boya’. It is a synthetic two-dimensional 4 × 4 lattice that consists of an array of spontaneous four-wave mixing integrated photon-pair sources and a network of programmable linear optical waveguide circuits. The device directly enables complex-weighted undirected graphs with eight vertices. Each pathway of single photons from one source to one detector represents a vertex. Each photon-pair source connects two separate pathways and represents an edge. Quantum correlations in the device (Fig. 1b), emerging at sources and sharing between pathways, corresponds to the pairwise relation in the graph (Fig. 1c). An example is identified by two coloured pathways (vertices) and a source (edge). Moreover, connections between vertices can be altered by reconfiguring the waveguide circuits; amplitudes and phases of edges can be individually controlled by an array of key switches before sources and phase shifters before quantum erasers, respectively (Supplementary Table 1).

The VLSI graph quantum device was fabricated in-house on a 200 mm silicon-on-insulator wafer by 180 nm complementary metal–oxide–semiconductor processes. Figure 1d illustrates a photograph of the full wafer. Each wafer contains 30 dies, each die contains four devices with slightly different designs, and each device integrates 2,446 components in a 12 mm × 15 mm footprint (Fig. 1d, white box). Wafer-scale charaterizations of the propagation loss are shown in Supplementary Fig. 4. A device has an array of 32 spontaneous four-wave mixing sources, forming a 4 × 4 grid, and each pair of adjacent sources produces one pair of degenerate single photons by reverse Hong–Ou–Mandel (RHOM) interference within a Mach–Zehnder interferometer18 (Fig. 1b, green highlights). The RHOM fringes for all the sources exhibit high contrast (Fig. 1g). The device contains 216 reconfigurable phase shifters (Supplementary Fig. 6d shows the characterizations). Four eight-mode reconfigurable linear optical circuits (mean fidelity, 0.925(32); Fig. 1f and Supplementary Fig. 7) and a network of 463 ultralow-loss waveguide crossers (mean loss, 0.038(4) dB; Fig. 1e) are used to reroute photons across the various paths. The device is fully optically and electrically packaged, and accessed by 100 optical inputs/optical outputs and 432 electronic inputs. With VLSI silicon photonics, the device here is the largest-scale integrated quantum photonic device to date, to the best of our knowledge19,20,21.

In the experiment, amplitudes and phases of the complex-weighted edges of graphs (that is, the complex elements of graph’s adjacency matrices) are fully controlled. The connectivity of edges was altered by reconfiguring the eight-mode Mach–Zehnder interferometer meshes (Fig. 1b), whose characterizations (imaginary part is not included) are reported in Fig. 1f. The real and imaginary parts of the two graphs’ edges are shown in Fig. 3b,i. Photon pairs were produced at the sources with a probability of 3.0%–4.5%, dependent on the pump power. We tested the quantum interference of indistinguishable photons by performing a heralded RHOM measurement between separate nonlinear sources (Fig. 1h). A post-filtering process was used to improve the spectral purity of photon sources at the cost of photon counts. The characterization and analysis of purity and indistinguishability are provided in Supplementary Section 4. Photons were detected by multichannel fibre-coupled superconducting nanowire single-photon detectors. Multiphoton correlations, corresponding to the distributions of perfect matchings of graphs, were recorded by a multichannel counting module. We observed a four-photon rate of 20 mHz in a typical setting of the experiment.

The realization of the graph quantum device in integrated optics (Fig. 1b) offers unique advantages, compared with the bulk optical one (Fig. 1c). It can perfectly match the optical length of paths for all the photons routing along lithographically defined circuits, ensuring good temporal mode matching. All the sources and circuits are monolithically integrated, enabling the reliable processing of graphs. Instead of pinning sources to the 4 × 4 grid, we here flatten this two-dimensional grid into a one-dimensional array, transposing the device structure into a braiding of waveguide circuits. This, thus, forms a synthetic graph lattice. It overcomes the problem of loss accumulation on pump and single photons, forced to pass through a series of sources22 (even for microring sources23), which causes circuit-depth-dependent edge amplitudes. It also avoids the complex de-multiplexing and re-multiplexing of photons with different colours. Moreover, to ensure the global coherence of the device, the which-source information of all the single photons along every pathway must be coherently erased (Fig. 1b). The erasure process based on postselection ensures quantum coherence at the cost of photon counts, although by collecting all the outputs, the number of graphs’ vertices can be greatly enlarged (Supplementary Figs. 15 and 16 show the theoretical and experimental results).

We consider a general case of m × m quantum device, described by graph G with 2m vertices and m2 edges. The n pairs of single photons are created at n sources (a maximum of one pair per source, that is, weakly squeezed light source) and detected by 2m single-photon detectors at 2m output modes (n ≤ m). The distributions of 2n-fold coincidences are measured in the basis of {S1, S2,…, S2m}, where Si denotes the number of photons in the ith mode. We consider no more than one photon click at each detector, that is, Si = {0, 1}. Each 2n-fold output of the 2n × 2n sublattice represents a perfect matching of subgraph Gs with 2n vertices, where the subscript ‘s’ denotes the subgraph. All the permutations of the 2n-photon outputs exactly represent a superposition of all the perfect matchings of Gs. Recording the multiphoton coincidences, thus, returns the probability distributions of the modulus-squared hafnian or permanent of the adjacency submatrix Os, that is, Prob(s) Perm(Os)2 for a bipartite graph and Prob(s) Haf(Os)2 for a general graph. In this context, similar to the standard quantum boson sampling24,25,26,27,28, our device can return the sampling results from its output distribution, which, in general, has an exponentially large number of outcomes. An estimation of a single probability typically requires an exponentially increased running time to obtain a small error28.

Creating genuine multiphoton multidimensional entanglement

Integrated quantum optics chips have allowed the generation of 15-dimensional Bell state29, four-qutrit hyper-entangled cluster state30, four-qubit graph state23,31 and eight-qubit hyper-entangled graph state32. Entangling multiple particles in multiple dimensions could provide the key resources for strong quantum correlation tests33 and qudit-based quantum computing34. Recently, the multidimensional multiphoton Greenberger–Horne–Zeilinger (GHZ) states with three photons across three dimensions have been demonstrated in bulk optical setups, which are designed by machine learning techniques35. However, the on-chip generation of multidimensional multiphoton entangled states remains experimentally exclusive.

We target a general multidimensional multiphoton state \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{d}^{n}\) = \(\frac{1}{\sqrt{d}}\mathop{\sum }\nolimits_{k = 0}^{d-1}{\left\vert k\right\rangle }^{\otimes n}\), where n is the number of photons, d is the local dimension of each photon and |k〉 is the logical state in the kth mode. Reconfiguring a sublattice (part of Fig. 1b), we create different \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{d}^{n}\) entangled states. As an example, we discuss how to generate the \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{3}^{4}\) state in a 2 × 3 sublattice (Fig. 2a), whose configuration is given by the graph. The success of detecting fourfold coincidences only occurs in three indistinguishable processes in the device. Physically, two pairs of photons emerge either at sources {00, 00}, {11, 11} or {22, 22} (indicated on the sources), each representing the logical basis. Mathematically, these correspond to the three perfect matchings of the graph shown in Fig. 2a. Hence, as a result of the quantum interference of the three indistinguishable processes, we obtain the coherent entangled state \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{3}^{4}=(\left\vert 0000\right\rangle +\left\vert 1111\right\rangle +\left\vert 2222\right\rangle )/\sqrt{3}\). To verify the entanglement structures, we adopt an entanglement witness based on the Schmidt rank vector36.

Fig. 2: Generation and verification of genuine multidimensional multiphoton entanglement in the graph-based quantum device.
figure 2

ae, By reconfiguring the sublattice and accordingly the graph’s topologies, it allows on-chip generation, manipulation, analysis and verification of different multidimensional multiphoton entanglement structures. For each state, it shows the graph topology with a superposition of perfect matchings, and the corresponding two-dimensional lattice (depicted for simplicity, but exactly implemented in the VLSI device) with a certain configuration of connectivity of nonlinear sources (yellow squares) and single-photon pathways (red lines). The encoding of a logical basis is indicated on the sources. The photon pathways are labelled by {A, B, C, D}. The entangled states are represented by concentric circles connected by green lines, where the circles represent photonic qudits and the number of circles implies their local dimension; the lines represent entanglement between the photonic qudits. Here n denotes the number of photons and d denotes the local dimensionality. The norm values of the reconstructed density matrices (ρ) and measured quantum-state fidelities (F) are shown for the below states: four-photon three-dimensional \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{3}^{4}\) state, F = 0.722(18) > 2/3 (a); four-photon two-dimensional \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{2}^{4}\) state, F = 0.792(12) > 1/2 (b); two-photon three-dimensional \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{3}^{2}\) (Bell) state, F = 0.966(2) (c); three-photon |W3 state, F = 0.729(19) > 1/2 (d); tracing out one part of |W3 and the remaining part retains the entanglement (e). Partial density matrices are reconstructed by measuring dn diagonal elements (in the computational basis) and d off-diagonal elements (in the coherent basis) coloured in blue in all the plots, whereas the remaining elements in yellow are not measured. In c, the complete quantum-state tomography is implemented instead. The values in the parentheses denote the ±1σ uncertainty, estimated by Monte Carlo methods considering Poissonian photon statistics.

Figure 2a shows an estimated density matrix of the \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{3}^{4}\) state. The density matrix ρ is partially reconstructed by measuring 81 diagonal elements in the computational basis \({\hat{\varLambda }}_{i}^{\otimes n}\) and three off-diagonal terms in a coherent basis \({\hat{\varOmega }}_{\theta }^{\otimes n}={(\cos \theta {\hat{\varLambda }}_{i}+\sin \theta {\hat{\varLambda }}_{j})}^{\otimes n}\), where \({\hat{\varLambda }}_{i = 1}^{8}\) is the Gell–Mann basis. Note that quantum erasers (Fig. 1b) also work as arbitrary local projectors for qutrit states and thus allow full-state measurement. We used an array of 12 detectors to record fourfold coincidence counts. From computational basis measurements (diagonal of ρ), we could unambiguously confirm the existence of three perfect matchings, in good agreement with Haf(O) = 3. We define a classical statistical overlap \(\gamma ={\sum }_{i}\sqrt{{p}_{i}{q}_{i}}\) to characterize the results, where pi and qi are the experimental and theoretical distributions, respectively; we obtain a γ value of 0.937. Coherence measurement results of \(\langle {\hat{\varOmega }}_{\theta }^{\otimes n}\rangle\) are provided in Supplementary Fig. 10. We estimate the quantum-state fidelity F = 〈ψ0ρψ0〉 from the density matrix, where |ψ0〉 is the ideal pure state. For the general state \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{d}^{n}\), if the value of F is larger than (d − 1)/d, it is genuinely entangled in the dimension of d (Supplementary Section 5)36. We measure the fidelity of \({\left\vert {{{\rm{GHZ}}}}\right\rangle }_{3}^{4}\) to be 0.72(2), greater than the lower bound of 2/3. We have, therefore, verified genuine four-photon GHZ entanglement in at least three dimensions, that is, having the Schmidt rank vector of {3, 3, 3, 3}.

We also present experimental results for other genuinely entangled states: GHZ-{2, 2, 2, 2} in a 2 × 2 sublattice (Fig. 2b), GHZ-{3, 3, 3} in a 2 × 3 sublattice (Supplementary Fig. 11) and Bell-{3, 3} in a 1 × 3 sublattice (Fig. 2c; it represents the simplest two-vertex graph29,37). Figure 2d reports the experimental results for another class of multipartite entangled state of \({\left\vert {{{{W}}}}\right\rangle }_{3}=(\left\vert 100\right\rangle +\left\vert 010\right\rangle +\left\vert 001\right\rangle )/\sqrt{3}\). The measured distribution (diagonal of ρ) implies a number of three perfect matchings, consistent with Haf(O) = 3, and it shows a γ value of 0.957. If the fidelity is more than 2/3, it verifies the presence of entanglement. We obtain the fidelity of 0.727(19) and thus confirm the generation of a genuine three-photon W state. Moreover, tracing out one photon of |W3, the remaining photons are still partially entangled. The photon-loss robustness of the W state is illustrated in Fig. 2e.

Measuring the perfect matchings of complex graphs

We then reprogram the entire graph-based quantum device to measure the probability distributions of the modulus-squared permanent and hafnian matrix functions for more complex graphs. This task translates to the estimations of the number of perfect matchings of the corresponding bipartite graph and a general graph, respectively, that can be directly read out from the multiphoton coincidence patterns at the output of the quantum device.

Figure 3 shows the topologies of bipartite and general graphs, device configurations and corresponding measured perfect matching distributions. Their adjacency matrices are given in Supplementary Section 6. Figure 3b,i depicts the experimentally prepared bipartite and general graphs, in which the edge amplitudes and phases are indicated by thickness and colour, respectively. Edge’s amplitudes of the two graphs are randomly set, and the edge’s phases of the bipartite graph are set as {0, π} to indicate the quantum interference of processes, whereas phases of the general graph are randomly chosen to showcase the capability of realizing arbitrary graphs. There are a total of 70 permutations of four-photon coincidences for all the submatrices, corresponding to all the submatrices and subgraphs. We collected N = 5,000 and 7,000 events in the bipartite and general graph experiments, with 68 and 120 h of data collection, respectively. Figure 3c,j reports the measured probability distributions for the bipartite and general graphs, respectively, which are in good agreement with the theoretical predictions by classically calculating Per(Os)2 and Haf(Os)2 for every submatrix. To characterize the results, we use the statistical overlap \(\gamma =\sum \sqrt{{p}_{i}{q}_{i}}\) and Kolmogorov distance D = ∑pi − qi/2, where pi and qi are the theoretical and experimental probabilities, respectively. Ideally, we have γ = 1 and D = 0. In the experiment, we obtain γ = 0.979(2) and D = 0.122(7) for permanent (Fig. 3c) and γ = 0.986(2) and D = 0.098(7) for hafnian (Fig. 3j). Non-perfect indistinguishability of the sources and processes has been taken into consideration in theory38,39,40 (Supplementary Sections 4.4 and 6.1). A set of measurements for a double-layered graph is reported in Supplementary Fig. 16.

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

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.

The implementation of quantum graph processing requires an efficient approach for the validation of experimental outcomes. Validation helps to rule out other possible hypotheses. We compare the experimental results with those having an input of distinguishable photons, as well as a uniform weighted graph (uniform matrix). We adopt a Bayesian updating method, like that used for the validation of boson sampling experiments41. In Fig. 3d,k, a Bayesian analysis is used to validate the experimental results for the bipartite and general graphs, against the hypothesis that photons generated from different nonlinear processes are distinguishable. The confidence of discrimination is higher than 99.99%, demonstrating the genuine quantum interference of multiphoton processes in the device. In Fig. 3e,i, we discriminate between our experimental data and those predicted by a uniform graph, and this hypothesis is also ruled out. Other validations using a likelihood ratio test are provided in Supplementary Fig. 12.

Moreover, another new protocol using the statistical analysis42,43 of the sampled datasets can efficiently rule out the hypothesis of distinguishable photons, and such a protocol has been adopted to validate boson sampling 44,45,46,47. It is based on the two-mode correlation function, defined as \({C}_{ij}=\langle {\hat{n}}_{i}{\hat{n}}_{j}\rangle -\langle {\hat{n}}_{i}\rangle \langle {\hat{n}}_{j}\rangle\), where \(\hat{n}\) is the bosonic number operator and i, j indicate the two output modes of the devices. Figure 3f,m reports the experimental C dataset for the general and bipartite graphs that are in good agreement with the theoretical results. We place the experimental data point into a (CV, S) plane (CV is the coefficient of variation and S is the skewness), to discriminate it with the cloud of indistinguishable photons rather than the cloud of distinguishable photons. The clouds are numerically obtained from 5,000 random graphs. The results are shown in Fig. 3g,n. The results of the histogram of C dataset and the statistical analysis in a (CV, NM) plane (NM is the normalized mean) are provided in Supplementary Fig. 13. This statistical analysis, thus, confirms the genuine many-photon quantum interference in the graph-based quantum device.

We have reported a reconfigurable graph-based quantum device on the VLSI photonic chip, and we reprogrammed it to execute diverse tasks defined by graphs. The device was reconfigured to show the generation, manipulation and certification of genuine multiphoton multidimensional entanglement, which could provide a key resource for universal multidimensional quantum computing34 and information processing in the future48. Using this approach, it could create multidimensional multiphoton GHZ states with an arbitrary dimension, their heralded states and gates by algorithmic optimization10,11. We reconfigured the device to map abstract general graphs onto the physical hardware, and estimated these graphs’ perfect matchings by quantum measurements.

Interestingly, akin to quantum boson samplers24,25,26,27,28 that have recently shown quantum computational advantages45,46,47, as well as photonic quantum annealers49,50 that can simulate large spin models, the graph quantum devices also seek the results of graph- or matrix-associated problems (Supplementary Section 7). The graph-based quantum device benchmarked in this work represents a general linear optical quantum device that can be arbitrarily reprogrammed to implement many diverse tasks in quantum information processing. Adopting a graph’s high-level visualizability and powerful mathematical machinery, it could provide a versatile hardware platform, such as to engineer complex quantum entanglement8,9, design new quantum gates and resources states11, learn complex quantum systems51,52 and train quantum processors10,53. With advanced silicon photonic quantum devices and technologies, for example, highly pure and indistinguishable integrated photon-pair sources54, low-loss sources with wavelength (de)multiplexers that can be embedded in a two-dimensional mesh, large-scale integration of high-efficiency single-photon detectors55 and wafer-scale integration of photonic circuits56 (Supplementary Section 8 provides the analysis and calculation), there is tremendous latent promise of complex graph-theoretical quantum processing for potential interesting quantum applications57,58.