Manuscript Offprint
arXiv:2610.06032Polynomial neural surrogates for designing photonic quantum experiments
Rohit Chaurasiya and Xuemei Gu
Institute of Condensed Matter Theory and Optics,
Friedrich Schiller University Jena, Max-Wien-Platz 1, 07743 Jena, Germany
Physics simulators can support the discovery of quantum experiments by predicting the states generated by experimental configurations. When these simulators are computationally expensive, repeated simulator calls can limit the search for experiments that generate a desired quantum state. Here, we develop a physics-inspired polynomial neural surrogate for PyTheus, a graph-based quantum-optics simulator, to predict quantum states and use it to design quantum experiments. Its polynomial activations are motivated by the relation between graph perfect matchings and the resulting state amplitudes. We train separate surrogate models for four-, six-, and eight-photon systems and show that they achieve higher prediction accuracy with fewer trainable parameters than standard multilayer perceptrons. We then use the trained surrogates for inverse design of GHZ, W, and linear-cluster states. For the larger systems, the surrogates also enable faster inverse design than direct optimization with PyTheus. These results suggest that incorporating the underlying physics into neural surrogates can provide an efficient approach to quantum experiment design.
INTRODUCTION
Physics simulators are widely used to predict the behaviour of experimental systems and increasingly serve as computational tools for experiment discovery [1]. In automated design, candidate experimental configurations are evaluated and optimised according to a desired objective, often requiring many repeated calls to the underlying simulator [2–7]. Such simulations provide a direct connection between the parameters describing an experiment and the physical quantities used to evaluate its performance. For computationally expensive simulators, however, repeated evaluations can become a bottleneck in the design process. Neural surrogate models provide an alternative by learning the input–output mapping of the simulator and replacing these evaluations with a faster learned approximation [8–11]. When the simulator has a known mathematical structure, this information can further provide useful prior knowledge for designing the surrogate architecture [12–15].
PyTheus, which uses a graph-based quantum-optics simulator, provides such a structured setting for photonic quantum experiment design [5]. It represents experimental configurations as weighted graphs and computes the corresponding quantum state from the perfect matchings of the graph [16–19], where a perfect matching is a set of edges that contains each vertex exactly once. Previous work has used feed-forward neural networks to predict target-specific quantities directly from the graph weights, such as the fidelity with a fixed target state, and used the trained models to guide the design of quantum experiments toward that target [20]. Rather than learning a particular property of the generated state, we learn the mapping from the graph weights to the quantum state itself. The surrogate predicts the state amplitudes, allowing different target states and design objectives to be introduced during the subsequent inverse-design stage without retraining the model. This graph-to-state mapping has a known polynomial structure, since each state amplitude is obtained by summing contributions from relevant perfect matchings, with each contribution given by a product of graph weights [16, 17, 19].
Motivated by this structure, we develop a physics-inspired polynomial neural surrogate for PyTheus that predicts the quantum state from the graph weights. We employ a polynomial neural network (PNN) [21, 22] with a single hidden layer, choosing the polynomial order to reflect the number of edges in each perfect matching. We train separate surrogate models for four-, six-, and eight-photon systems and show that they achieve lower prediction errors with substantially fewer trainable parameters than standard multilayer perceptrons. We further compare the Jacobian sensitivities [23] of the learned and analytical mappings to examine how well the surrogates capture the dependence of the state amplitudes on the graph weights. Finally, we use the trained surrogates for inverse design of four-, six-, and eight-photon GHZ, W, and linear-cluster states. The resulting configurations achieve high fidelities when independently evaluated with PyTheus, and for the larger systems considered, the surrogates also enable faster inverse design than direct optimisation with PyTheus. These results demonstrate how the known algebraic structure of a physics simulator can guide the design of compact and reusable surrogates for photonic quantum experiment design.
† xuemei.gu@uni-jena.de the photons in the corresponding paths, which can be encoded in polarisation, orbital angular momentum, time bins, frequency modes, or other photonic degrees of freedom [24]. Such a graph representation has a direct physical interpretation and can be translated into experimentally realizable photonic configurations, as demonstrated in several experiments [25–28].
In Fig. 1(a), we consider a graph with four vertices, , and two internal modes, labelled 0 and 1, represented by blue and red, respectively. For each pair of vertices, the two internal modes give rise to four possible colour combinations. We denote the edge weight by , where a and b label the vertices (or optical paths), and i and j denote the internal modes of the two photons. The fully connected graph in Fig. 1(a) therefore contains 24 edges with real-valued weights in . More generally, a fully connected graph with n vertices and two internal modes contains weighted edges. The quantum state generated by the graph can be expressed in terms of the edge weights [5, 19],
where and create photons at the two vertices and connected by edge , and h.c. denotes the Hermitian conjugate. Applying to the vacuum yields the generated photonic state.
Experimentally, we often post-select the quantum state using n-fold coincidence detection, corresponding to the simultaneous detection of one photon in each of the n output paths. Since each edge corresponds to a photon pair, an n-photon event contains n/2 edges and therefore requires even n. Accordingly, the n-photon contribution arises from the term in Eq. (1),
Expanding this term gives products of edge contributions. The coincidence condition selects only those products for which each output path occurs exactly once. Thus, the corresponding edges share no vertices and cover every vertex exactly once. These edge sets are the perfect matchings of the graph.
Let denote a perfect matching. We denote an output state by , where specifies the mode of the photon in output path . For example, represents the mode encoding across the four output paths. The weight of a perfect matching is the product of its edge weights,
Different perfect matchings can generate the same output state . Its unnormalized amplitude is therefore obtained by summing the weights of all perfect matchings
(a)

weight vector:
(b) Perfect matching, e.g., for

Quantum state from Graph
FIG. 1. Graph representation and perfect matching contributions. (a) Fully connected four-vertex graph. Blue and red colours represent the photon states and , respectively. An edge joining vertices and with photon states and has weight . The four colour combinations for each of the six vertex pairs give 24 weights, collected in the vector . Diamonds indicate negative weights. (b) For , three perfect matchings contribute to the amplitude. A perfect matching is a set of edges that covers every vertex exactly once. Summing the contributions from these three matchings gives the amplitude in the unnormalised output state: .
with the corresponding edge colours. The post-selected state can thus be written as
where denotes the set of perfect matchings associated with . For further details, we refer the reader to the PyTheus work [5].
This construction also reveals the polynomial structure of the graph-to-state mapping. Each term in the expansion contains a product of graph weights, while coincidence post-selection selects the subset corresponding to perfect matchings. The amplitude of each output state is therefore a sum of selected products of graph weights. This structure motivates the polynomial activation used in the neural surrogate introduced in the following section.
SURROGATE TRAINING
Having established the polynomial dependence of the output amplitudes on the graph weights, we investigate whether this structure can be used to construct an efficient surrogate for predicting the complete output state. We compare the PNN with a standard multilayer perceptron (MLP) and evaluate their prediction accuracy, model size, and computational cost. We further examine whether the PNN captures how the output amplitudes change as the graph weights vary.
The surrogate-training procedure is shown in Fig. 2(a). We first consider the case, for which the graph contains 24 weighted edges. Their weights form the input vector , with each independently sampled from a uniform distribution on . For each sampled graph, PyTheus computes the corresponding 16 real, unnormalised output-state amplitudes, collected in and used as the supervised target. We generate 20 million such input-output pairs and divide them into training, validation, and test sets containing 80%, 10%, and 10% of the data, corresponding to 16, 2, and 2 million samples, respectively.
We then train two surrogate models on the same dataset, a standard MLP and the physics-guided PNN. The MLP serves as a baseline and consists of three fully connected hidden layers with GELU activations [29], followed by a linear output layer. The PNN incorporates the polynomial structure of the graph-to-state mapping established in Section . For n = 4, each perfect-matching contribution is quadratic in the graph weights, motivating a single fully connected hidden layer with a quadratic power activation. More generally, for even n, the PNN predicts the output amplitudes as
where U and V are trainable weight matrices, b and c are biases, and is applied element-wise.
The power activation matches the polynomial degree of the graph-to-state mapping, while the PNN does not explicitly encode the individual perfect matchings. Instead, the combinations of graph weights required to reproduce the output amplitudes are learned from the training data.
Both models are trained by minimizing the mean absolute error (MAE) between the predicted and PyTheus-generated output amplitudes. We use AdamW with a batch size of 5000 and an initial learning rate of , followed by cosine decay. The model with the lowest validation MAE is retained for test evaluation and subsequent inverse design. Training is terminated if the validation MAE does not improve for 2000 epochs or when 20 000 epochs are reached.
The same procedure is applied to n = 6 and n = 8. Following the polynomial degree of the corresponding perfect-matching contributions, the PNN uses cubic and quartic power activations, respectively. For each case, we also generate 20 million input–output pairs with the same
(a) Prediction Training

(b) Inverse Design (Model weights and biases are suspended)

FIG. 2. Surrogate training and inverse design. (a) Surrogate training. A weighted graph, encoded by the graph-weight vector , is passed through the neural network to predict the corresponding quantum-state amplitudes . (b) Surrogate-assisted inverse design. A randomly initialised graph-weight vector is passed through the trained model, with its weights and biases frozen. The graph weights are iteratively updated to maximize the target evaluated from the predicted state until the stopping criterion is reached.
training, validation, and test split. The model widths, activation functions, parameter counts, and training statistics are summarized in Table I.
Fig. 3 shows the training and validation MAE for the PNN and MLP across all three system sizes. Under the same training protocol, the PNN consistently achieves lower validation error with substantially fewer trainable parameters and shorter training times, as summarized in Table I. The difference is particularly pronounced for n = 8, where the PNN reaches a validation MAE of , compared with for the MLP. For n = 8, we additionally tested larger MLP architectures and a larger training dataset, but observed no further improvement.
The trained PNNs also show low prediction errors on the test sets. The mean test MAEs are , , and for n = 4, 6, and 8, respectively. These values are close to the validation errors, indicating consistent prediction accuracy on unseen samples drawn from the same distribution. The sample-wise test-error distributions are shown in Fig. 4.
TABLE I. Comparison of the neural-network architectures used for surrogate training. The best epoch corresponds to the minimum validation loss, while epochs trained denotes the total number of epochs before termination.
| n | Model | Layers | Neurons | Activation | Best epoch | Epochs trained | Best val. loss | Training time | Parameters |
|---|---|---|---|---|---|---|---|---|---|
| 4 | PNN | 1 | 400 | 2506 | 4506 | 0.93 h | 16,416 | ||
| FNN | 3 | 400 | GELU | 19819 | 20000 | 23.12 h | 337,216 | ||
| 6 | PNN | 1 | 2000 | 2497 | 4497 | 3.81 h | 250,064 | ||
| FNN | 3 | 2000 | GELU | 19975 | 20000 | 292.63 h | 8,254,064 | ||
| 8 | PNN | 1 | 15000 | 2984 | 4984 | 55.6 h | 5,535,256 | ||
| FNN | 3 | 8000 | GELU | 3119 | 5119 | 1021.08 h | 130,968,256 |

FIG. 3. Training and validation loss curves for the PNN and FNN surrogate models for , and 8. The mean absolute error (MAE) between the predicted and PyTheus-generated unnormalised output states is shown on a logarithmic scale. Across all system sizes, the PNN achieves a lower validation loss than the MLP. For , MLP training stopped after 2000 epochs without further improvement. The best validation losses for all architectures and system sizes are reported in Table I.
The results above show that the PNN accurately predicts the output amplitudes. For gradient-based inverse design, however, it should also capture how these amplitudes change with the graph weights, since these derivatives determine the optimization direction [30, 31]. We therefore compare its Jacobian with the analytical perfect-matching result,
where describes how output amplitude changes with graph weight .
We evaluate these Jacobians on the same set of sampled graphs and average the absolute value of each Jacobian element,
where the absolute value prevents derivatives with opposite signs from cancelling during averaging. Each row of represents one output amplitude, while each column corresponds to one graph weight.
The PNN and analytical sensitivity matrices agree closely for all three system sizes, as illustrated for in Fig. 5. The Pearson correlation between and exceeds 0.99999 for each , indicating that the two methods reproduce nearly the same pattern of dependencies between graph weights and output amplitudes. The mean element-wise absolute differences are , , and for , and 8, respectively, while the largest element-wise differences are , , and .
For , as an example, the analytical amplitude of the quantum state is
and therefore depends only on the six edge weights , corresponding to weights in the graph-weight vector. Its derivatives with respect to these weights are determined by their partners in the corresponding perfect matchings; for example,
while derivatives with respect to all other graph weights vanish. The analytical sensitivity matrix therefore has a sparse and structured pattern determined by the perfect matchings contributing to each output amplitude.
(a)

(b)
(c)
FIG. 4. Test-set prediction errors of the trained PNN surrogates. Distributions of the sample-wise mean absolute error (MAE) for the (a) , (b) , and (c) systems. Each histogram contains all two million samples from the corresponding held-out test set. For each sample, the MAE is the mean absolute difference between the PNN-predicted and PyTheus-generated unnormalised output-state amplitudes over all output components. The red vertical line indicates the mean sample-wise MAE for each system size. The horizontal axes are shown in units of .
(a)
PolySurrogate (n = 4)

PyTheus (n = 4)
Input graph-weight index
Mean Jacobian sensitivity
(b)
Absolute difference (n = 4)

Input graph-weight index
FIG. 5. Jacobian sensitivity comparison for n = 4. (a) Mean absolute sensitivities from the PNN (left) and analytical perfect-matching calculation (right), averaged over 1000 sampled graphs. (b) Absolute element-wise difference between the two sensitivity matrices. The similar patterns and small differences show that the PNN reproduces the sensitivity of the output amplitudes to variations in the graph weights
As shown in Fig. 5, the PNN reproduces the same pattern, with negligible sensitivity to graph weights that do not contribute to a given amplitude and closely matching sensitivities for those that do.
The sensitivity maps for n = 6 and n = 8 are provided in the Appendix A and show similarly close agreement. These results indicate that the PNN learns not only the output amplitudes but also the dependence of those amplitudes on the relevant graph weights, supporting its use for gradient-based inverse design.
FROM STATE PREDICTION TO INVERSE DESIGN
We employ the trained PNN for inverse design by fixing the network parameters and optimizing the input graph weights to generate a desired target state, as illustrated in Fig. 2(b). For each system size n = 4, 6, and 8, the corresponding PNN is used to design GHZ, W, and linear-cluster (LC) states. We perform 1000 independent searches for each target and system size, giving 9000 searches in total.
Different quantum experiment-design tasks may target different properties of the output state. For the state-generation tasks considered here, we use the state fidelity as the optimization objective as it directly quantifies the
(a)

(b)
(d)
(c)
(e)
(f)
(g)
(h)
(i)
FIG. 6. Surrogate-assisted inverse design. Distributions of the initial and final fidelities for 1000 random graphs for each target state and system size, with each graph optimized independently using the PNN surrogate. Blue and orange indicate the initial and final fidelities, respectively, with counts shown on a logarithmic scale.
overlap between the predicted and target states. For the normalized PNN-predicted state , the fidelity is
To obtain high-fidelity solutions while encouraging sparse graph configurations, we minimize
where the term encourages small graph weights to approach zero.
For each target state, we first generate random initial graphs by independently sampling all graph weights from . We evaluate the PNN-predicted fidelity of each graph with respect to the target GHZ, W, or LC state and retain only graphs with an initial fidelity below 0.5. These low-fidelity graphs are then used as the starting points for inverse design, where the graph weights are optimized to increase the fidelity towards unity.
The graph weights are optimized using Adam with an initial learning rate of , cosine-decayed to over 100 000 steps. After each update, the weights are clipped to . Optimization stops when the predicted fidelity reaches 0.99999 or when the maximum number of 100 000 steps is reached. During optimization, the increase in fidelity is evaluated every 1000 steps. If the increase is smaller than , Gaussian noise is added to the graph weights with and the Adam state is reset. The noise scale increases after each perturbation as 0.01, 0.05, 0.10, 0.20, 0.30, 0.50, 0.70, and 1.00, remaining at 1.00 thereafter.
The resulting fidelity distributions are shown in Fig. 6. Across all targets and system sizes, PNN-assisted in-
TABLE II. PyTheus verification of the graphs designed using the PNN surrogate. Each row contains 1000 graphs. The last two columns report the fraction with PyTheus-verified fidelities above the indicated thresholds. Samples with fidelities slightly below 0.99999 correspond to runs that reach the maximum optimization step limit.
| Target | n | PyTheus-verified fraction | |||
|---|---|---|---|---|---|
| GHZ | 4 | 0.999991 | 0.999991 | 100% | 84.4% |
| 6 | 0.999991 | 0.999991 | 100% | 85.3% | |
| 8 | 0.999991 | 0.999991 | 100% | 95.1% | |
| 4 | 0.999990 | 0.999990 | 100% | 58.6% | |
| W | 6 | 0.999991 | 0.999991 | 100% | 83.2% |
| 8 | 0.999991 | 0.999991 | 100% | 85.0% | |
| 4 | 0.999990 | 0.999990 | 100% | 82.2% | |
| LC | 6 | 0.999991 | 0.999991 | 100% | 84.8% |
| 8 | 0.999991 | 0.999992 | 100% | 93.0% | |
TABLE III. Inverse-design runtimes over 50 runs, reported as mean ± standard error of the mean. PyTheus was evaluated on CPU, as GPU acceleration is not available in PyTheus, while the PNN was evaluated on both CPU and GPU.
| Target | n | PyTheusCPU (s) | PNNCPU (s) | PNNGPU (s) |
|---|---|---|---|---|
| GHZ | 4 | |||
| 6 | ||||
| 8 | ||||
| W | 4 | |||
| 6 | ||||
| 8 | ||||
| LC | 4 | |||
| 6 | ||||
| 8 |
verse design increases the fidelities from the low-fidelity initial graphs to values concentrated near unity. We then independently verify all 9000 optimized graphs using PyTheus, and the verified fidelities closely agree with the corresponding PNN-predicted values, as summarized in Table II. All verified graphs satisfy , and many also reach the stricter threshold .
We further compare the inverse-design runtimes in Table III. For , direct PyTheus optimization is generally faster on CPU, whereas for the larger and systems, surrogate-assisted optimization becomes substantially faster. GPU execution further reduces the PNN runtime, particularly for . These measurements include only the post-training optimization stage and exclude the costs of dataset generation and surrogate training. The observed speedup should therefore be interpreted as a reduction in the cost of repeated inverse-design calculations after training, rather than as a reduction in the total end-to-end computational cost.
DISCUSSION AND OUTLOOK
Our results show that the graph-to-state mapping can be accurately approximated by a PNN whose activation degree matches the known polynomial degree of the mapping. For the systems studied, this physics-guided architecture achieves lower prediction errors with substantially fewer parameters than a standard MLP. Predicting the complete output state also allows one model per system size to be reused for different inverse-design objectives without retraining. These results suggest that known algebraic structure can provide a useful inductive bias for quantum-experiment design [21, 22].
The physics incorporated into the PNN is nevertheless limited. The activation degree reflects the polynomial degree of the graph-to-state mapping, but the network does not explicitly encode the perfect matchings or the exact monomial structure of the amplitudes. It can therefore represent polynomial terms that are absent from the exact mapping. Future models could incorporate more of the polynomial structure using architectures that explicitly parameterize high-order polynomial interactions [32], or by restricting the allowed monomials according to the underlying perfect-matching structure.
Our work also has several limitations in scope and scalability. We consider only two internal modes per photon and four-, six-, and eight-photon systems, with a separate surrogate for each system size. The larger hidden width required for the eight-photon case suggests that matching the polynomial degree alone may not scale to substantially larger systems. In addition, predicting the complete state retains the exponential growth of the output dimension. One promising direction is therefore to develop a unified model across system sizes, potentially using set-based or attention-based architectures capable of processing variable-size inputs [33, 34]. Such a model could learn structures shared across photon numbers rather than requiring an independent surrogate for each size. Extending to larger systems may also require compressed or task-relevant state representations, or models that predict selected amplitudes or observables instead of the complete state. Another interesting direction is to extend the framework from real- to complex-valued graph weights, potentially using complex-valued neural architectures [35]. These directions could broaden the applicability of neural surrogates for photonic quantum experiment design.
COMPUTATIONAL RESOURCES
All numerical experiments were performed on the Draco high-performance computing cluster at Friedrich Schiller University Jena. Model training and surrogate-assisted inverse design were carried out on a NVIDIA A100 GPU, while CPU runtime benchmarks used Intel Xeon Platinum 8360Y processors. The models were implemented in JAX/Flax with automatic differentiation.
DATA AND CODE AVAILABILITY
8
ACKNOWLEDGMENTS
The code for data generation, surrogate-model training, and inverse-design experiments is available at https://github.com/AI-Quantum-Lab/PolySurrogate.
X.G. acknowledges support from the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 398816777 – SFB 1375.
[1] J. Klimesch, S. Arlt, C. Ruiz-Gonzalez, C. Rodríguez, X. Gu, P. Haslinger, P. Vischia, C. Haack, Y. Drori, R. Adhikari, et al., Nature 657, 47 (2026).
[2] M. Krenn, M. Malik, R. Fickler, R. Lapkiewicz, and A. Zeilinger, Physical review letters 116, 090405 (2016).
[3] P. Knott, New Journal of Physics 18, 073033 (2016).
[4] R. Nichols, L. Mineh, J. Rubio, J. C. F. Matthews, and P. A. Knott, Quantum Science and Technology 4, 045012 (2019).
[5] C. Ruiz-Gonzalez, S. Arlt, J. Petermann, S. Sayyad, T. Jaouni, E. Karimi, N. Tischler, X. Gu, and M. Krenn, Quantum 7, 1204 (2023).
[6] C. Rodríguez, S. Arlt, L. Möckl, and M. Krenn, Nature Communications 15, 10658 (2024).
[7] M. Krenn, Y. Drori, and R. X. Adhikari, Physical Review X 15, 021012 (2025).
[8] J. Peurifoy, Y. Shen, L. Jing, Y. Yang, F. Cano-Renteria, B. G. DeLacy, J. D. Joannopoulos, M. Tegmark, and M. Soljačić, Science advances 4, eaar4206 (2018).
[9] W. Ma, Z. Liu, Z. A. Kudyshev, A. Boltasseva, W. Cai, and Y. Liu, Nature photonics 15, 77 (2021).
[10] V. Peano, F. Sapper, and F. Marquardt, Physical Review X 11, 021052 (2021).
[11] C. Ruiz-Gonzalez, S. Arlt, S. Lehner, A. Berzins, Y. Drori, R. X. Adhikari, J. Brandstetter, and M. Krenn, Machine Learning: Science and Technology 7, 055010 (2026).
[12] S. Greydanus, M. Dzamba, and J. Yosinski, in Advances in Neural Information Processing Systems, Vol. 32 (Curran Associates, Inc., 2019).
[13] M. Cranmer, S. Greydanus, S. Hoyer, P. Battaglia, D. Spergel, and S. Ho, in ICLR 2020 Workshops: Deep-DiffEq (2020).
[14] G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, and L. Yang, Nature Reviews Physics 3, 422 (2021).
[15] C. Meng, S. Griesemer, D. Cao, S. Seo, and Y. Liu, Machine Learning for Computational Science and Engineering 1, 20 (2025).
[16] M. Krenn, X. Gu, and A. Zeilinger, Physical Review Letters 119, 240403 (2017).
[17] X. Gu, M. Erhard, A. Zeilinger, and M. Krenn, Proceedings of the National Academy of Sciences 116, 4147 (2019).
[18] X. Gu, L. Chen, A. Zeilinger, and M. Krenn, Physical Review A 99, 032338 (2019).
[19] M. Krenn, J. S. Kottmann, N. Tischler, and A. Aspuru-Guzik, Physical Review X 11, 031044 (2021).
[20] T. Jaouni, S. Arlt, C. Ruiz-Gonzalez, E. Karimi, X. Gu, and M. Krenn, Machine Learning: Science and Technology 5, 015029 (2024).
[21] J. Kileel, M. Trager, and J. Bruna, in Advances in Neural Information Processing Systems, Vol. 32 (Curran Associates, Inc., 2019) pp. 10310–10319.
[22] K. Kubjas, J. Li, and M. Wiesmann, Algebraic Statistics 15, 295 (2024).
[23] J. Pizarroso, J. Portela, and A. Muñoz, Journal of Statistical Software 102, 1 (2022).
[24] M. Erhard, M. Krenn, and A. Zeilinger, Nature Reviews Physics 2, 365 (2020).
[25] J. Bao, Z. Fu, T. Pramanik, J. Mao, Y. Chi, Y. Cao, C. Zhai, Y. Mao, T. Dai, X. Chen, et al., Nature Photonics 17, 573 (2023).
[26] K. Qian, K. Wang, L. Chen, Z. Hou, M. Krenn, S. Zhu, and X.-s. Ma, Nature Communications 14, 1480 (2023).
[27] L.-T. Feng, M. Zhang, D. Liu, Y.-J. Cheng, G.-P. Guo, D.-X. Dai, G.-C. Guo, M. Krenn, and X.-F. Ren, Optica 10, 105 (2023).
[28] K. Wang, Z. Hou, K. Qian, L. Chen, M. Krenn, S. Zhu, and X.-S. Ma, Physical Review Letters 133, 233601 (2024).
[29] D. Hendrycks and K. Gimpel, Gaussian error linear units (GELUs) (2016), arXiv:1606.08415 [cs.LG].
[30] T. O'Leary-Roseberry, P. Chen, U. Villa, and O. Ghattas, Journal of Computational Physics 496, 112555 (2024).
[31] D. Luo, T. O'Leary-Roseberry, P. Chen, and O. Ghattas, SIAM Journal on Scientific Computing 47, C899 (2025).
[32] G. G. Chrysos, S. Moschoglou, G. Bouritsas, J. Deng, Y. Panagakis, and S. Zafeiriou, IEEE Transactions on Pattern Analysis and Machine Intelligence 44, 4021 (2022).
[33] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, Advances in neural information processing systems 30 (2017).
[34] J. Lee, Y. Lee, J. Kim, A. Kosiorek, S. Choi, and Y. W. Teh, in International conference on machine learning (PMLR, 2019) pp. 3744–3753.
[35] C. Y. Lee, H. Hasegawa, and S. Gao, IEEE/CAA Journal of Automatica Sinica 9, 1406 (2022).
Appendix A: Additional Jacobian-Based Sensitivity Comparisons
(a)
PolySurrogate (n = 6)

PyTheus (n = 6)
Input graph-weight index
Mean Jacobian sensitivity
(b)
Absolute difference (n = 6)

Input graph-weight index
FIG. 7. Jacobian-based sensitivity comparison for the n = 6 graph system. (a) Mean absolute sensitivities from the PNN (left) and the analytical perfect-matching calculation (right), evaluated on the same 1000 sampled graphs. Rows represent output-state amplitudes and columns represent graph weights. (b) Absolute element-wise difference between the two sensitivity matrices. Their matching patterns and small differences show that the PNN reproduces the mean absolute sensitivities of the output amplitudes to the graph weights.
(a)
PolySurrogate (n = 8)

PyTheus (n = 8)
Input graph-weight index
Mean Jacobian sensitivity
(b)
Absolute difference (n = 8)

Input graph-weight index
FIG. 8. Jacobian-based sensitivity comparison for the n = 8 graph system. (a) Mean absolute sensitivities from the PNN (left) and the analytical perfect-matching calculation (right), evaluated on the same 1000 sampled graphs. Rows represent output-state amplitudes and columns represent graph weights. (b) Absolute element-wise difference between the two sensitivity matrices. Their matching patterns and small differences show that the PNN reproduces the mean absolute sensitivities of the output amplitudes to the graph weights.