Digital Discovery of 100 diverse Quantum Experiments with PyTheus

Photons are the physical system of choice for performing experimental tests of the foundations of quantum mechanics. Furthermore, photonic quantum technology is a main player in the second quantum revolution, promising the development of better sensors, secure communications, and quantum-enhanced computation. These endeavors require generating specific quantum states or efficiently performing quantum tasks. The design of the corresponding optical experiments was historically powered by human creativity but is recently being automated with advanced computer algorithms and artificial intelligence. While several computer-designed experiments have been experimentally realized, this approach has not yet been widely adopted by the broader photonic quantum optics community. The main roadblocks consist of most systems being closed-source, inefficient, or targeted to very specific use-cases that are difficult to generalize. Here, we overcome these problems with a highly-efficient, open-source digital discovery framework PyTheus, which can employ a wide range of experimental devices from modern quantum labs to solve various tasks. This includes the discovery of highly entangled quantum states, quantum measurement schemes, quantum communication protocols, multi-particle quantum gates, as well as the optimization of continuous and discrete properties of quantum experiments or quantum states. PyTheus produces interpretable designs for complex experimental problems which human researchers can often readily conceptualize. PyTheus is an example of a powerful framework that can lead to scientific discoveries -- one of the core goals of artificial intelligence in science. We hope it will help accelerate the development of quantum optics and provide new ideas in quantum hardware and technology.


INTRODUCTION
Photons, the individual particles of light, have long been used as the core player for fundamental experiments and applications in quantum information science [1].Photons do not easily interact with their environments; therefore, they can be distributed over large distances -which makes them a key resource for longdistance quantum communication [2,3] and experiments that require strict Einstein locality conditions [4][5][6].Using advanced measurement-based quantum computing schemes, photons are among the most promising candidates for future quantum computers [7].Entanglement between two or more photons can be produced without a vacuum or cooling, and therefore many advanced experimental results can be achieved directly with tabletop setups.Furthermore, the bosonic nature of photons allows for the generation of complex entangled quantum states of indistinguishable photons that are a key resource arXiv:2210.09980v1[quant-ph] 18 Oct 2022 for quantum-enhanced measurements [8].These potential applications have lead to enormous technological advances in integrated chips for fast and precise control of photonic quantum states [9][10][11][12], high-quality singlephoton sources [13][14][15][16], novel photon-pair sources [17], photon number resolving detectors [18,19], and advanced high-quality multi-photon interference [20][21][22][23].
One question now is how to utilize these technologies to build up exciting new experiments for the foundations of quantum physics and practical quantum hardware.
Historically, the design of quantum experiments strongly relied on the intuition and creativity of human experts who leverage their experience and come up with blueprints of experiments.However, due to the unintuitive phenomena and enormous combinatorial space of the potential designs, it becomes extremely difficult for human researchers to discover more complex quantum setups.It might be possible that there are high-quality solutions to experimental design questions far outside of the region where humans' intuition fails.How could we possibly find such extraordinary solutions?
This question has sparked a strong interest in the automated discovery of quantum experiments with computers, overviewed in [24].The invention of these tools for quantum optics experiments [25] have indeed overcome experimental limitations and allowed for new avenues in laboratories for entanglement research [26][27][28][29].Other automated discovery methods have started to investigate how to design new experiments for advanced quantum metrology [30][31][32], quantum communication [33,34], Bell experiments [35], and circuits for photonic continuousvariable quantum computing [36].This possibility has also inspired researchers to take quantum optics experiments as new benchmarks to test the quality of artificial intelligence (AI) methodologies, for instance, via reinforcement learning [37], recurrent neural networks [38], and deep generative models such as variational autoencoders [39] or logical AI [40].
One crucial question is whether we can also learn something about physics from these tools.And indeed, several new concepts have been published that were purely discovered through automated design [25], such as a new general idea of entanglement structure [41], and generalized constructions of photonic quantum gates [42].Those concepts were discovered by tedious analysis of the computer's solutions, which was time-consuming.The problem was that the algorithms were powerful enough to find unknown solutions but had no incentive to present a simple, human-understandable form of it.
This was solved by the invention of Theseus [43], an efficient algorithm for the discovery of new quantum experiments that can readily be interpreted by humans.The key insight was a shift in the representation.Rather than describing quantum experiments as quantum optical components on an optical table, experiments are described as graphs of correlations between photons.This representation, which has been a derivative of a computer-discovered concept itself, was developed in [44][45][46] -and allows working with a much more natural representation, which can be translated back at any point to an experiment consisting of optical elements.(It should be noted that the representation is independent of photonic graph states for measurement-based quantum computing [47][48][49], and it is so far unknown how to translate among them.) In this paper, we introduce PyTheus2 , a highlyefficient, open-source, automated design and discovery framework for quantum optics experiments.At the core, PyTheus uses a much extended graph-based representation of quantum optics, which allows us not only to represent entanglement and quantum gates, but lets us design quantum measurements, quantum communication protocols, optimize experimental properties, and discover quantum systems that involve single-photon sources, mixed states, and states entangled in the photon-number basis.Besides the advances of the scientific scope, we note that PyTheus is written in Python, and therefore can readily be combined with machine learning frameworks such as TensorFlow and PyTorch, and allows for immediate parallelization in computer clusters.
To showcase the applicability of PyTheus, we demonstrate the discovery of 100 previously unknown or advanced implementations of quantum optics experiments, ranging from exciting new systems for entanglement research to quantum states from condensed matter physics that are interesting for quantum simulation purposes, new ways of performing quantum communication tasks such as entanglement swapping, new quantum state measurements, and quantum gates.The experiments can involve both probabilistic photon sources and deterministic single-photon sources, and many of them are readily implementable in today's modern quantum optics labs.In the GitHub repository, we present the instructions for PyTheus that discover each of the examples.We hope that PyTheus's efficiency, generality, and low entry barrier kick-starts the application of computer-discovered quantum setups in experimental laboratories worldwide, and inspires new exciting computer-inspired ideas and directions for fundamentals and applications of photonic quantum physics research.
While the goal of this paper was to demonstrate the discovery capability of PyTheus, in several cases, it was impossible not to see clear generalizations and reasons why the solutions work.We show this in some cases below.One of the exceptionally interesting concepts we discovered was a new quantum multiphoton interference effect that can simulate probabilistic multi-pair sources just with photon pairs.We describe this new physics concept and its application in a parallel paper [50].
The article is structured in the following way: In section 2, we introduce the graph-based representation of quantum optics, which lies at the heart of PyTheus.In section 3, we introduce the idea of the computational PyTheus framework, which we then apply to the discovery of 100 new quantum experiments in section 4. In section 5, we explain some future(istic) ideas that might lie ahead of us.

GRAPHS AND QUANTUM EXPERIMENTS
The connection between quantum optical experiments and graph theory was discovered a few years ago [44][45][46] and has been further developed as a design algorithm Theseus for new quantum experiments [43].In the graph-experiment representation, each colored weighted graph corresponds to a quantum experimental setup, and vice versa.Each edge and each vertex of the graph represent a correlated photon pair and a photon path, respectively.Its complex weight denotes the amplitude of the photon pair, and the edge color represents a photon's internal mode number for a given path, which corresponds to the photon's degree of freedom such as polarization [51], path [10,12,52], transverse spatial modes [53][54][55][56], time-bin [57] or frequency [17,58].This abstract graph representation allows us to have the full information of quantum optical experiments and has been used for discovering quantum states and transformations [43].
Here we significantly extend the bridge between graphs and experiments, which allows us to perform design and discovery tasks for quantum state generation (for pure and mixed states and on the photon number basis), quantum measurements, quantum communication protocols, and gates for quantum computing.In Table.I, we show the correspondence between graph theory and quantum experiments.The graph representation can be directly translated into different experimental implementations.In the remaining part of this section, we explain how these graphs encode quantum states, and how to translate them to experimental setups.Probabilistic photon-pair sources, which are typically based on nonlinear processes such as spontaneous parametric down conversion (SPDC) and four-wave mixing (FWM) [59], are one of the most widespread resources to generate entangled and correlated pairs of photons.A range of photonic quantum experiments using probabilistic sources can be interpreted as a weighted colored graph [43][44][45][46].There, each vertex represents an optical path to a detector and each edge refers to the correlated photon pair produced by a probabilistic photon-pair source.The edge weight is the amplitude associated with the photons, and the edge color describes the photon's internal mode number (i.e., the degree of freedom of a photon).The connection between the graph and the corresponding quantum state is given by the weight function [43] ω(e)x † (e)y † (e) where E(G) is the set of edges of the graph.The quantum state is obtained by applying the weight function to the vacuum, i.e. |ψ = Φ(ω) |vac .As an example of states using four path (i.e., a, b, c, and d) with two-dimensional internal modes (i.e., 0 and 1) in Fig. 1, the Φ(ω) is given as where ω = (ω 0,0 a,b , ω 1,1 b,d , ω 0,0 c,d , ω 1,1 a,c ) is a list of edge weight ω i,j x,y ∈ C and |ω i,j x,y | < 1, the superscript and subscript represent the mode number and the optical path, respectively.x † k is the creation operator of a photon in path x with mode k.The pair-emission process is up to the Norder, and the probability of occurrence for lower-order events is higher than that of higher-order ones.
Experimentally, a common way to obtain a quantum state is to condition the experimental results on a simultaneous detection event in each detector, which is also called the n-fold coincidence detection.In our graph representation, this only happens when a subset of the edges contains each of the n vertices exactly once (see the subset of blue edges or red edges in Fig. 1), which is the so-called perfect matching of a graph.For the example in Fig. 1, we neglect the empty mode and higher-order terms N > 2 to post-select the quantum state.There are two perfect matchings (two blue edges and two red edges) in Fig. 1, which contribute to two quantum terms |0000 and |1111 .The weight of a perfect matching is the product of all its edge weights.For each term in a quantum state, the weight is given by the sum of all weights of the perfect matchings that contribute to it.Therefore, the Fig. 1.An abstract graph representation of quantum experiments producing GHZ states.There, edges and vertices represent correlated photon-pair and optical paths, respectively.The edge colors and weights ω are mode numbers and complex coefficients.The blue and red colors refer to the mode numbers 0 and 1, respectively.There are two perfect matchings (i.e., a subgraph that covers all vertices only once), and their coherent superposition leads to a quantum state We can get a four-qubit GHZ state by setting all weights equal.The graph can be translated into several quantum setups with different technologies, such as entanglement by path identity or path encoding used in integrated photonics or standard bulk optics (e.g., using polarization encoding).The squares I-IV are probabilistic sources that create photon pairs.For clearer presentation, we draw the source in the color corresponding to the mode they contribute.
weights for quantum terms |0000 and |1111 are ω 0,0 a,b ω 0,0 c,d and ω 1,1 a,c ω 1,1 b,d , respectively.In the end, a coherent superposition of the two perfect matchings in the graph leads to the post-selected quantum state, which is If we set all weights the same and normalize the state, we can then reach a four-particle Greenberger-Horne-Zeilinger (GHZ) state.a.Translation to Experiments -A colored weighted graph can directly be translated into several quantum optical experiments using different technologies [43], as shown in Fig. 1.The most straightforward way is applying the concept of entanglement by path identity [29,41,60], for which the graph representation has initially been designed [44].In this scheme shown on the left side of Fig. 1, paths of indistinguishable photons produced from multiple crystals are overlapped, leading to a coherent superposition of possible origins for a photon.Equipped with the graph-experimental correspondence in Table I, we now translate four edges and vertices into four photon-pair sources and optical paths.Here, we encode photon's internal mode number in polarization such that blue and red edge colors in the graph depict horizontal and vertical polarization, respectively.The four sources are set up in such a way that two sources (blue edges) produce photons with states |00 while the other two (red edges) produce photons with states |11 .We then pump all sources coherently and consider that two of the four sources produce a photon pair in this example.Conditionally on perfect matching or post-selection, we have only two cases (two-photon pairs come either from the sources I and II or from the sources III and IV) that contribute to the final quantum state in Eq. (3).All other combinations of sources do not lead to only one photon in each of the detectors.For example, a photon pair in crystals I and III leads to two photons in a, one photon in b, and c, but no photon in d; therefore, this case is disregarded.If the mode numbers are indistinguishable, one can observe a new form of multi-photon interference, which has first been experimentally observed in [22,23] and which forms the basis of many of the proposed experiments below.
Another promising technology is using integrated photonic, which usually uses path encoding [9][10][11][12], where each photon's one mode goes to one detector, as shown in the bottom middle-part of Fig. 1.In this example, each photon has two path modes depicted in blue and red colors, respectively.Therefore, one can consider that each vertex in Fig. 1 actually contains two sub-detectors that directly connect to the paths for the photon's twomode numbers (i.e., blue and red paths).The vertex is activated when only one of the two sub-detectors clicks.In this way, perfect matching means the situations where four sub-detectors click in either blue paths or red paths, leading to the desired quantum state.Moreover, one can also use the standard bulk optics for generating photonic entanglement [61,62].When the edges are in the same color, which means the corresponding photons have the same mode number, one can use either probabilistic beam splitters or directly path-identified photon-pair sources to form the edge.If the edges have different colors (for example, two-mode numbers in Fig. 1), one can employ mode-dependent beam splitters such as polarizing beam splitters (PBSs) and transverse spatial mode sorters [1,63] to create an edge.With polarization encoding in the example, we can insert a PBS between two cross-crystal sources [63], for the state generation.Yet, such a translation is not unique, and an expert may further simplify the proposed setup.
b. Asymptotic Solutions -Until now, we know that each perfect matching can contribute to a term of the quantum state, and their coherent superposition gives the desired state.With the above graph-experimental link, one now expects to produce arbitrary multi-particle entanglement in high dimensions, e.g., a six-particle threedimension GHZ state.A GHZ state appears when all perfect matchings are disjoint, i.e., every edge is used only in one perfect matching [44,45].However, it has been shown that it is impossible to construct a graph of more than four vertices with only three disjoint perfect matchings [44,45].Fig. 2 exemplifies this point.Three disjoint perfect matchings contribute to the desired quan- tum terms.However, there is another perfect matching that leads to an additional term that is not part of the GHZ state (the so-called Maverick term [44]).Due to the existence of this Maverick term, we cannot get an ideal GHZ state of perfect fidelity.However, one can adjust the weights in the graph such that this Maverick term has a very arbitrarily small weight, thus having a nearperfect quantum state [43].This can be done by lowering the pump power at the expense of lower count rates, which is experimentally feasible.Such a graph (Fig. 2) is called as the asymptotic Solution.This concept can be applied to many different multi-particle states with higher dimensions.c.Ancillary Particles -Although there is a limitation to the state generation with standard linear optics and post-selection in the graph representation [45,64], one can further employ ancillary particles to completely get rid of Maverick terms [50,65].For example, assisted with two ancillary photons, we can obtain the six-particle three-dimension GHZ state (details see Fig. 3).Additionally, to create quantum states with an odd number of particles, one can just use some odd numbers of photons produced from photon-pair sources as ancillary particles [46].We present further examples in section 4.

Deterministic Single-Photon Sources
In the above section 2.1.1,we have treated an edge in a graph as a probabilistic photon-pair source (in general, as the correlated photon pair) and a vertex for an optical path connecting to a single-photon (non)sensitive detector.Experimentally, one can construct a single-photon source that relies on a probabilistic photon-pair source, where one photon is detected heralds the presence of the other [18].For example, the single-photon source in path SPS d (SPS c ) is conditionally on the detection of only one photon in the path d (c) using a probabilistic photon-pair Fig. 3.An abstract graph for producing a three-dimensional six-particle GHZ state with two ancillary particles.The diamonds along the edges represent that the edge weights are negative.Vertices 6 and 7 depicted by squares are for ancillas, which are in the same mode number (e.g., blue color for mode number 0).Five perfect matchings in black boxes contribute to the three terms in the desired GHZ state, while the rest of the perfect matchings are destructively canceled out.
source and a photon-number-resolving detector, as shown in Fig. 4. In the graph representation, one can consider that there is an edge between the vertex SPS d (SPS c ) and a virtual vertex which always needs to have exactly one incoming edge.For simplicity, we can just use a input vertex (e.g., SPS d or SPS c , without drawing its adjacent virtual vertex) for such a single-photon source based on a probabilistic photon-pair source, see Fig. 4.There are no connecting edges between two input vertices.The edge connecting to an input vertex is reinterpreted as photons propagate towards a detector [43,66].
Interestingly, this can also be explained in Klyshko's advanced-wave picture, described as "an intuitive treatment of two-photon correlation with the help of the concept of an effective field acting upon one of the two detectors and formed by parametric conversion of the advanced wave emitted by the second detector" [67,68].In other words, we can treat an edge as a quantum information transfer of one single system; thus, one can describe many abstract quantum information flows instead of just probabilistic photon-pair sources.In general, our input vertex representation is directly applicable to deterministic single-photon sources such as the ideal ondemand sources based on semiconductor quantum dots [13][14][15][16] or multiplexed single-photon sources [69].Therefore, PyTheus can design experiments that use singlephoton sources.Experimentally, a single-photon source can be either a heralded single-photon source implemented with a photon-pair source and a photon-number-resolving detector (PNRD) or a deterministic single-photon source which can be an ideal quantum-dot-based source.In this experiment, the two photons arrive at the same time (and have the same wavelength, polarization, and spatial mode) such that they are indistinguishable.

Mixed States
So far, we have considered coherent creation processes, resulting in pure states.However, experimentally it is possible to introduce incoherence.Whenever distinguishing information about the quantum state escapes from the experiment to the environment, a partial trace of the density matrix is performed, producing a mixed state.This fact can be used systematically in the graph representation.To do so, we dedicate one of the vertices as the environment (environment vertex).We produce the full quantum state Then, tracing out the environment contribution, we obtain We illustrate this procedure by a simple example in Fig. 5. From a graph that produces we trace out the last photon obtaining A mixed state can be generated by using one of the vertices as the environment (vertex env in this example).Experimentally this could be implemented by measurements that do not discriminate between the photon modes, for instance, detectors with a large active area.The corresponding setups for the graph are listed below.
This procedure is experimentally achieved by using detectors that do not distinguish between the modes in vertex env.For example, if spatial modes are used, one can use a wide-area photon detector or multi-mode fibers in front of the detector.If the time degree of freedom is used to encode the mode numbers, one can integrate over the entire time such that one cannot distinguish between time-bins.Doing so, we introduce mixedness and recover the state in Eq. (7).Similarly to the translation in 2.1.1 a, we can also translate the graph for creating mixed states into different schemes, as shown in Fig. 5. Therefore, PyTheus can be used to design experiments for complex and interesting mixed states.

States Entangled in the Photon-Number Basis
Fock states containing a fixed number of particles in a given spatial mode form a complete basis for many-body Hilbert spaces.The superposition of Fock states brings, among others, the well-known N00N states [71,72] that promise many advantages such as the bestpossible quantum-enhanced precision, super-sensitivity and super-resolution [8,73].The N -particle N00N state is (up to normalization) where the subscript number 2 means there are two paths (e.g., a and b), |0 indicates an unoccupied mode.The concept of the N00N state in Eq. ( 8) can be extended to We translate this graph into several setups (below the graph).The setups using path identity or path encoding are the same in this case.With bulk optics, one can achieve the state with a Hong-Ou-Mandel interferometry [20,70], where two identical photons enter a 50:50 beam splitter.One can also perform such a state in polarization, i.e., (|2, 0 H,V − |0, 2 V,H )/ √ 2 on the right side.The blue and red colors are, respectively, for horizontal and vertical polarization.The coherent superposition of blue and red self-loops gives the N00N state.Its related setup is described below the graph.There either two horizontally polarized photons (blue edge) or two vertically polarized photons (red edge) are in path a with a single-photon sensitive detector.
a multi-mode case, where N particles are distributed in one of several optical paths [74,75].
We know the total number of photons N going through a set of optical paths, but in contrast to the previous sections, we ignore how many photons occupy each of the paths.Therefore, perfect matchings are not the only contributions to the final state that we must consider.Here, we need to compute all combinations of edges that lead to a total number of N photons for a given set of all optical paths.This includes combinations with repeated edges, which represent multiple photon pairs from the same source, and self-loops, in which a source produces a collinear photon pair [76,77].Moreover, for some contributions there can be vertices with degree zero, as long as the total number of photons -which is also the total degree -is N .
As an example, we show a graph for the |N00N 2 2 state in Fig. 6.In this case, the total photon number is N = 2.All edges are in the same color, thus corresponding to the standard path-entangled N00N states.A self-loop edge indicates that there are two photons in its connected vertex.Thus the coherent superposition of two photons being in one of the two vertices (one of the selfloops produced a photon-pair, but we ignore it) leads to a coherent superposition of |2, 0 a,b and |0, 2 a,b , i.e., a two-mode two-photon N00N state.One can now translate the graph into quantum experiments, similarly, as we did in section 2.1.1.In this example, the setups using entanglement by path identity and path encoding are the same.With bulk optics, one can use probabilistic beam splitters that provide the mixing between the two input a b c Fig. 7. Graph for producing |N00N 3  2 state with an additional ancillary particle.The total photon number (including ancillary one) for each component in the state is four.There are six combinations of two edges that cover the ancillary vertex only once.Two of them (black box) contribute to the required terms |3, 0 and |0, 3 , and the others (|2, 1 and |1, 2 ) inside the red box cancel out.
photons, to bunch two photons in one of the two optical paths a and b, which is the well-known Hong-Ou-Mandel (HOM) effect [20,70].Moreover, we can also generate such a N00N state in polarization or transverse spatial modes instead of the path; see Fig. 6 for details.
As for the previous states, ancillary paths can assist in the creation of states on the photon-number basis.
Here we condition the final state on the existence of a total number of photons in the non-ancilla detectors but, again, the ancilla paths are reached by single photons.Fig. 7 shows an example in which the ancilla (vertex 3) receives only one photon, and the other two detectors get a total of three photons.

Quantum Measurements
A graph may also be interpreted as a quantum measurement on an input quantum state.Such measurements are of utmost importance in many quantum communication tasks, for example, a Bell state measurement for quantum teleportation.The goal of measurements here is to distinguish different orthogonal incoming states, e.g., in the case when all detectors click simultaneously.Photons entering the experiment through input paths are represented analogously to single-photon sources introduced in section 2.1.2.An input photon corresponds to one vertex in the graph.An edge connecting an input vertex to a detector vertex corresponds to the photon traveling to that detector, following Klyshko's advanced-wave picture [67] as explained in section 2.1.2.The same constraints apply, excluding edges connecting two vertices belonging to input photons.
As an example, we show a graph in Fig. 8 for the wellknown Bell state measurement (BSM) [78,79], which plays an important role in many quantum information tasks.When the two detectors click, the incoming photons are projected to one Bell state |Ψ − , which can be seen as the generation of a state given by a superposition of the two perfect matchings in the graph.To search for an experimental setup for measuring a particular state, we let PyTheus search for a graph that would produce the state under consideration of the topological constraints on the graph.The graph in Fig. 8 interpreted as state generation would produce the state |Ψ − under the condition that there is no connection between vertices in1 and in2.With a graph that 'produces' the state |ϕ in , we can effectively perform a projective measurement (P 0 = |ϕ ϕ| and P 1 = I − |ϕ ϕ|) on the input photons.A coincidence of all detectors corresponds to the output 0 and any other pattern is interpreted as output 1.
The representation of measurements in terms of graphs constitutes an extension of the previous interpretation given in [43].This allows us to use PyTheus for the discovery of measurement setups for any state and various constraints and conditions.

Quantum Communication
In future quantum networks that connect individual users with quantum resources and quantum computers, the distribution of quantum entanglement is essential.One key concept used in quantum communication in quantum networks is entanglement swapping [80,81], where two qubits that never interacted can be entangled.This provides an important route for interesting tests of quantum foundations and plays an indispensable role in quantum technology such as quantum repeaters [82].PyTheus allows us to explore new directions that could lead to solutions that require fewer resources than current techniques or are implemented in surprising ways.Many quantum network communication tasks have been experimentally implemented [81,[83][84][85], thus the new solutions by PyTheus can readily be implemented in

laboratories.
We are interested in finding experimental setups for creating entanglement between particles that have not interacted or originated from a common source.With PyTheus this can be done for scenarios involving higher dimensions and multiple particles.Finding the corresponding graph works analogously to the state generation task shown in section 2.1, but comes with extra constraints on the graph.We set an entangled state (e.g. two particles in a Bell state) as a target for the optimization.The experiment corresponding to the resulting graph should create this state.To ensure that the two particles have no direct interaction, the graph must fulfill the following additional constraint.It should have no edge connecting the two corresponding vertices.Such an edge translated to a photon pair source would mean that the two photons could come out of the same source.This is shown in Fig. 9. Similarly, the connection of two vertices to the same single-photon source vertex implies that they can not be space-like separated.Such constellations would not be valid for entanglement swapping, either.In the same way, as for incoming photons (single photon sources or input photons), the constraints are enforced by removing the edges from the starting graph.
Approaching these tasks with PyTheus makes it possible to explore new ways of distributing entanglement.We show the examples found by PyTheus in section 4.

Quantum Computation
Quantum gates are a crucial building block in quantum computation [86,87].A quantum gate performs a unitary transformation on an input state.These transforma- The right panels show the corresponding setup for a CNOT gate, which was realized by [88].
tions can also be interpreted in terms of graphs.In these graphs, similar to measurements (described in subsection 2.2), the input photons are described by designated vertices.Likewise, we impose restrictions on which types of vertices can be connected by edges.Photons exiting the setup (output) are also represented by vertices, as in state generation.Additional ancillary photons can stem from probabilistic photon-pair sources and single-photon sources can also be involved.With PyTheus we can search for arbitrary quantum gates under a wide range of experimental conditions.A target unitary quantum gate acting on an Ndimensional Hilbert space is specified by how each element of an orthonormal basis transforms.One canonical example in quantum gates is the controlled-NOT (CNOT) gate, which acts on two qubits and is described by the mapping: To find this gate, we let PyTheus search for a graph that would produce the state under consideration of the topological constraints on the graph (no connections between input photons).In Fig. 10, we show an experimental setup realized [88] together with its graph representation.Photonic quantum gates fall into two main categories [89].In a post-selected gate, the outgoing photons are detected directly after the gate.This ensures that there is exactly one photon in each path after the gate [90][91][92][93][94][95][96][97].Because possibilities where two outgoing photons enter the same path are excluded, fewer experimental resources are required.However, this procedure destroys the outgoing state, and the particles can not be used further.The second category is heralded gates [88,[98][99][100][101][102][103], where only ancillary photons are detected, and the outgoing photons of the gate remain undetected.These gates are ultimately more useful since the output state can be used further.A graph for a heralded quantum gate is harder to discover and needs more experimental resources since the looser selection rules can lead to more unwanted terms.Both types of quantum gates (postselected and heralded) can be represented with graphs and thereby be designed using PyTheus.Terms produced in post-selected experiments are represented by perfect matching, and terms produced in heralded experiments are represented by collections of edges that cover the ancillary vertices.

THE PYTHEUS LIBRARY
Starting from a dense or fully connected graph, PyTheus uses gradient descent combined with topological optimization to find minimal graphs corresponding to some target quantum experiment.The PyTheus library greatly expands the range of applications of its predecessor, and it is significantly faster3 .The package is written in Python and is available on GitHub for further applications and development of the source code.
PyTheus applications range from the creation of quantum states to the design of quantum communication protocols.While diverse, all these tasks are performed following the same steps, illustrated in Fig. 11.In this section, we explain the software workflow, which kind of loss functions we employ, and how to start using PyTheus.
Workflow Overview -The Instruction Set file details what we want (e.g., a quantum state or a communication protocol) and some instructions about how to get it.The latter includes the entire allowed topology of the final solution, such as the type of photon sources/detectors and ancillary particles, how many of each we have, or which polarization modes can be used.It also contains the Loss Function to minimize (fidelity, count rate, or other metrics) as well as further optimization settings.In the example of Fig. 11, we want to obtain a post-selected six-particle, two-dimensional GHZ state, |GHZ 2 6 = |000000 + |111111 .We employ 6 standard photodetectors and the photon pair sources described in section 2.1.1.In this example, we also specify further topological constraints of the final solution (thus of the initial graph) -here, vertex 3 must not have connections to vertex 0, 1 and 5.
The experimentally available topology specified in the instruction set lead to the Initial Graph.This weighted graph represents all possible states/experiments that can be produced with the available resources.The number of vertices, the type of edges, or which vertices can be directly connected are some of the Topological Constraints that one can impose on the graph or that may follow from the available tools or from the task we want to im-

Optimization parametric optimization topological optimization
Final Graph e.g.Fidelity

Instruction Set
Fig. 11.The PyTheus workflow.From the number of vertices and available dimensions, PyTheus builds the initial graph, which is fully connected except for vertex 3, which is only connected to its nearest neighbors.We impose this based on previous knowledge, but other constraints may arise depending on the available tools.Computing all the graph's perfect matchings, we find the more general state that the initial graph can produce: |ψ(ω) .As the loss function, we choose the Fidelity of the state |ψ with respect the target: |GHZ .Aiming for an interpretable graph with perfect fidelity, we iterate the weight optimization with the edge removal until we find the simplest graph that produces |GHZ = |ψ(ωS) .The available resources, the loss function and further optimization details are specified in the Instruction Set.
plement -the sources described in section 2.1.2and the protocols from section 2.3 are representing examples.On the initial graph of Fig. 11 the six vertices are connected with bicolored edges and based on previous knowledge, we only connect vertex 3 with its nearest neighbors.
From the initial graph, G(ω), we can compute the more general state produced by the weight function Φ(ω) acting on the vacuum (see Eq. ( 2)).However, we do not consider the infinite terms produced by Φ(ω), we only compute the creation events which fulfill certain Conditional rules.For example, in Fig. 11 the post-selection rule results in terms for which all detectors click.These creation events are represented by the graph's perfect matchings, and produce a coherent superposition of kets leading to the state |ψ(ω) .We can specify more complex conditioning rules, which will be relevant, for example, for N00N states.There, we condition on states with a total final photon number in the output nodes.The conditioning rules are imposed by experimental circumstances 2.
Once we extract a general state |ψ(ω) from the initial graph, we can optimize it according to some Loss Function.As in Fig. 11 we seek a particular state, |GHZ , we maximize the Fidelity of our state accordingly: To find a specific states we can also use the Count Rate, a metric that approximates how often our experiment produces such a state.Alternatively, we can maximize physical properties like entanglement rather than looking for a specific state.To perform quantum information tasks like measurements or communication protocols, we must translate each task into a state creation process -see sections 2.2, 2.3, and 2.4 for further details.
If the available experimental resources suffice, by optimizing the weights, we will find a graph that satisfies our needs.However, the optimal solution is not unique, and even if many of the weights vanish, we will likely obtain a very dense final graph, which will be hard to interpret.Therefore, to extract useful insights from our setups, we must simplify the graphs as much as possible, alternating the optimization of the weights' values with the removal of edges.This Topological Optimization will lead us to a simple graph, for which the removal of any additional edge would unacceptably raise the loss function's value.
For some graphs, like the one shown in Fig. 11, no smaller graph can produce the target state [44].However, in most cases, it is challenging to ascertain whether there exists a simpler solution, especially when we choose to optimize for real weights instead of complex ones.With respect to these subtleties, following the workflow, we first generate graphs with abundant ancillary particles and reassess the results with the goal of reducing the number of resources.Using this procedure, we propose one hundred experiments to be realized in quantum optics.

HUNDRED EXPERIMENTS
In the following, we introduce one hundred experiments conceived by PyTheus.A broad catalog of designs that, hopefully, will contribute to multiple branches of quantum optics, including quantum computing, communications, and quantum sensing.For each proposed experimental setup which is new and has not been described in any theoretical or experimental paper, we mark the corresponding graph with a number in a box Table II.A collection of eight diverse highlights, each of which is interesting in its own right.
counting from 1 to 100.The weights of each graph can be found in the GitHub repository, together with the instruction sets used to search them.We start by showing eight highlights from our discoveries in Table .II.
(a) A multi-photon entangled state that goes beyond the barrier of 3-dimensions [45].It requires only two ancillas and has a small number of edges which makes it a very promising proposal for practical application, and observation of new properties at the foundation of quantum mechanics [104].
(b) The generation of a heralded 3-dimensional GHZ state with single photon sources, which beats the current state-of-the-art method [65] in number of necessary ancilla states.
(c) The generation of a two-mode N00N state with 5 photons.The associated graph, very symmetric, makes use of 3 ancillas.
(d) A 4-photon qubit quantum state with equal coefficients c = 1 √ 7 , that requires complex coefficients for their generation.The underlying reason is a si-multaneous destructive interference effect of more than two terms.
(e) A previously unknown quantum measurement scheme that allows the experimental implementation of a quantum communication protocol proposed in 1987 [105].
(f) A very surprising form of quantum entanglement swapping, which does not rely on the generation of two Bell pairs and a Bell state measurement.
(g) A post-selected 3-photon control gate that does not require any ancilla photons.
(h) Experimental setup of a 2-photon mixed entangled state that falsified the Peres conjecture [106].The state is bound entangled (its entanglement cannot be distilled), however, it can be used to violate Bell's inequality [107,108].This could lead to an experimental falsification of the Peres conjecture.

Generation of Entangled States
In this part, we propose ways to generate entangled states, which play an important role not only in our understanding of entanglement and the non-local nature of quantum mechanics but also in many quantum information applications.

GHZ States
Bell's theorem shows that Einstein-Podolsky-Rosen's propositions about local realism [109] are inconsistent when we apply them to quantum systems of two particles, revealed by the violation of the Bell inequality with quantum mechanical statistical correlations [110].In the late 1980s, Greenberger, Horne, and Zeilinger took a step further from two to three particles.Interestingly, with a tripartite quantum system, local realism can be violated by quantum mechanics with perfect correlations rather than statistical correlation, and one can completely dispense with inequalities [111,112].It enables the performance of experiments where the quantum physical predictions are mutually contradictory with expectations based on local realism [113].Such a GHZ state forms an important class of entanglement and its generalization is given as where n denotes the number of particles and d is the dimension for each particle.
Increasing the number of particles and dimensions in the GHZ states not only enlarges the Hilbert space but also leads to many new exciting classically paradoxical phenomena [104,114,115].Besides their fundamental interest, high-dimensional multiparticle GHZ states have also served as an important resource for many quantum information applications [116].
With the size and dimension increasing, it is very challenging to know how to experimentally create GHZ states.Experimental progress has been made in this direction to push the size and dimension, especially in the linear optics regime [28,61,62,117].Until now, only the three-particle three-dimensional GHZ state has been demonstrated with linear optics [28] and superconducting qutrits [118].Going beyond the |GHZ 3 3 state with arbitrary particle numbers and higher dimensions will give rise to exciting new possible quantum applications and new insights on the foundations of quantum mechanics.This remains to be explored, in any experimental platform.
PyTheus enables the discovery of many new multiparticle high-dimensional GHZ states for which no experimental implementations are known yet.That includes the 3-particle GHZ state for 4, 5 and 6 dimensions 1 2 3 , an asymptotic solution for the 4-particle 4dimension GHZ 4 , and the 5-particle GHZ state for 3 and 4 dimensions 5 6 .The associated graphs are shown in Fig. 12.In particular, the asymptotic solution for |GHZ 4 4 is experimentally applicable.

Bell Gems
Bell states offered the first proof of the non-locality of quantum mechanics.Later on, they became the cornerstone of many quantum communication schemes and are nowadays widely used in quantum computing.These maximally entangled bipartite states, described in the Hilbert space H 2 ⊗ H 2 , can be generalized for more particles and dimensions in multiple ways while keeping their main properties [119].
In 2004, Gregg Jaeger suggested a generalization for sets of 2 N qubits, the Bell Gems [120].To construct these states we need to pick a pair of orthogonal states |α and |β from the Bell basis: |Φ ± = |00 ± |11 and |Ψ ± = |01 ± |10 .Then, we iterate the following mappings in all possible ways: Therefore, for 2 N qubits, we get a basis of 2 2 N states.For the case of a pair of 3 dimensional Bell states 84 states exist.Fig. 13 shows how to generate one of these highdimensional Bell gems which, up to normalization, reads 7 where Out of the nine categories, six of them include wellknown quantum states: a separable state of 4 qubits, the W states of 3 and 4 qubits, the product of 2 Bell states, and the GHZ states of 3 and 4 qubits.For the 3 qubit states, the fourth particle is separable (like an ancilla).Fig. 14 shows the graphs to produce these states.
The remaining three categories, out of the initial nine ones, refer to less-known ways of entanglement.Verstraete's work refers to them as L a4 , L 0 5⊕3 , and L 0 7⊕1 .In Fig. 15 we see a graph for each category, producing the states 8 , 9 , 10

Quantum Error Correction
The path to the quantum computer requires qubits with low error rates independent of their realization platform.However, dealing with noise on any platform is inevitable.Thus, we need error-correcting codes to protect the information and achieve fault-tolerant quantum computation.This is where Logical Qubits play a crucial role.
Logical qubits are sets of N physical qubits that define two orthogonal states |0 L and |1 L .These states are defined in such a way that errors in the physical qubits can be detected by applying a set of global measurements.These measurements will produce a different combination of outcomes for each potential error, allowing its correction.The graphs from this section produce 3 well-known logical qubits to detect and correct arbitrary errors on single qubits.
The first one, the Shor code [122], employs 9 physical qubits to define 11 0 The second example, the Steane code [123], employs 7 physical qubits 12 0 We go from the logical qubit to the other by applying a logical gate X L , that is, by applying a Pauli X gate on each physical qubit.
The third and last one, with only five physical qubits [124], is the Laflamme code 13 0 These two logical qubits constitute the smallest errorcorrecting code resilient to arbitrary single qubit errors [125].Fig. 16 shows the graphs for producing each of the logical 0 states for 5, 7, and 9 physical qubits.For the Shor code, the second logical qubit state can be obtained by multiplying the weights of every bicolored edge by -1 (or alternatively, taking the 3rd, 6th, and 9th qubits and applying a minus at each red incoming edge).For the other two codes, one can obtain the graphs associated with the logical 1 state by switching the colors blue and red.Such transformation is equivalent to applying the gate X on each qubit, the logical X L .

Products of W States
Previous work with the graph representation showed how to create W states for an arbitrary even number of qubits without using any ancilla [46].On the other hand, to generate a W state with an odd number of qubits, we always needed at least one ancillary detector.Accordingly, if we want to duplicate such odd-qubit states, we can simply duplicate the graph together with the ancillas.However, this straightforward method is not the most efficient, at least for the states |W 3 ⊗2 and |W 5 ⊗2 .As shown in Fig. 17, these two states can be obtained without using ancillas 14 15 .

Dicke States
The equal superposition of every N -qubit state containing a single |1 gives us the W states.These states can be generalized, superposing all permutations of N qubits with exactly k |1 s.They are the Dicke states where i P i (•) stands for all possible permutations of k |1 among N qubits.These states, which have applications in multiparty quantum communication and quantum metrology [126][127][128][129], can be produced for an even number of qubits with a general graph introduced in previous works [46].Here we produce a pair of Dicke states with an odd number of qubits and two excitations 16 17 (see Fig. 18).Moreover, there exists a generalization of Dicke states for higher dimensions [130].Given a set of integers {k i }, such that i k i = N , we describe its corresponding ddimensional Dicke state as where i P i (•) stands for all possible permutations of the N qudits.In Fig. 19 we plot the graphs that produce the 3-dimensional Dicke state with three particles 18 and with 4 particles (with uneven coefficients {k i }) 19 After plotting the results found by PyTheus to generate the last two states, we found a pattern on the graphs that led us to states like |D(5, (2, 2, 1) and |D(4, (1, 1, 1, 1)) : We start taking a fully connected graph of N particles, in which the vertices are connected by 2 bicolored edges, blue-red and red-blue, indicating two modes (the same as in Ref. [46]).Then one can add ancillas that are connected to the N first particles by bicolored edges, one for each of the N particles.These new edges introduce more modes, leading to the following series of states for an even number of particles, 2k: For an odd number of particles, 2k + 1, starting with 1 ancilla, we obtain Going one step further, Yeo and Chua developed a protocol to teleport unknown states of two qubits [132], and instead of using Bell states, they employed the Yeo-Chua state This highly entangled state can be produced with the graph of Fig. 20.

Complex Weights as a Resource
Exploring the applicability range of PyTheus, we searched for all four-qubit states that can be expressed by where c i ∈ {0, 1}, which are 2 16 − 1 = 65535 states in total.We found that for PyTheus only found solutions with complex-valued weights, despite the coefficients of the state function being real-valued 21 .This mismatch hints at an interesting interference between the perfect matchings.To our knowledge, this state has no special significance in any particular quantum applications.But this result shows that the use of complex-valued edges is not merely limited to states with complex coefficients.While we used real-valued optimization for most solutions presented in this paper for computation speed, complex-valued optimization could lead to fewer required resources in some cases.

Single Photon Sources for State Creation
Significant progress has been made toward using deterministic single-photon sources in quantum optics ex-  21 for the state defined in Eq. (29).ω = e iπ/6 .Each green box contributes one term of the state.The perfect matchings in the orange boxes interfere destructively.It is especially notable that the weights of the two |0111 perfect matchings (bottom right) are complex conjugates and add to one as ω 2 + ω −2 = 1.
periments during the last years [13,18,69].In this section, we present graphs corresponding to quantum experiments for the creation of several highly entangled states using single-photon sources.Deterministic sources do not suffer from the same trade-off between high fidelity and high count rate as probabilistic sources.When using deterministic sources, the number of photons required can be smaller than with probabilistic sources [133,134].
a. Post-Selected We have found graphs for creating different GHZ states with single-photon sources as a resource.One can create a six qubit GHZ from six input photons 22 , a four qutrit GHZ state from six input photons 23 , as well as the same four qutrit GHZ state from a combination of two single photon sources and two simultaneous SPDC events 24 .
b. Heralded -There have been proposals for the creation of multi-particle high-dimensional entangled states from single photon sources using discrete Fourier trans- Fig. 23.Graphs corresponding to the creation of three-, fourand five-particle GHZ states using single-photon sources without the need for ancillary particles.
form [65].With this approach, creating a heralded threedimensional Bell state would require seven input photons.In Fig. 24 we show a graph 25 that creates this state using only six single photon sources.

Maximizing Entanglement
When a quantum state cannot be expressed as the product of its parts, we call it entangled.However, if one asks how entangled a state is, the answer is not unique, there are multiple measures of entanglement.Here we present some of these metrics, together with states that are known to maximize them.Finally, we choose a particular metric and optimize a graph, not to reach a particular state -as done so far by maximizing the fidelitybut to instead maximize the entanglement metric itself.In this way, we will recover some well-known entangled states and also find new ones.

Schmidt Rank Vector
Multiparticle entangled states in high dimensions allow for a much deeper structure underlying the potential ways in which the particles can be entangled.These structures can be characterized by the Schmidt Rank Vector (SRV) and give rise to new phenomena that only exist if both the number of particles and the number of dimensions go beyond two [135][136][137].Here we consider tripartite states.The rank vector is a list of the ranks of the reduced density matrices.The state SRV(A,B,C) refers to a state, where and ρ X is the density matrix of the system with the particle X traced out.In other words, the SRV is a vector of the dimensionalities of entanglement of every bipartition, which shows the dimensionality of entanglement between one particle and the rest of the quantum state.This master-slave-slave configuration is very useful for quantum applications such as layered quantum communication [138].Taking a SRV(3,3,2) state as an example, we then know that the first two particles are both threedimensionally entangled with the third particle, whereas the third one is only two-dimensionally entangled with the rest.The dimensionality for each particle cannot be increased with linear operations and classical communication (LOCC).
Searching the SRV(A,B,C) states has been investigated with the computer algorithm Melvin [25] and graph theory [45,139].Interestingly, it has been shown from graph theory that without using any ancilla particles, there are several SRV(A,B,C) states that cannot be created.[45,139].Here we list these states (up to normalization): 26 SRV(5,5,4) : 27 SRV(6,3,2) : 28 SRV(6,5,5) : 29 SRV(7,3,3) : It has been unknown whether we can experimentally create these states with additional particles, and this challenging question has been open for more than three years.Also, until now, SRV(A,B,C) states in high dimensional systems have only been recently demonstrated for SRV(3,3,2) [27], SRV (3,3,3) [28], and SRV(4,4,2) [140].By using PyTheus, one can learn how to generate much more complex SRV states of high dimensions and more particles, such as the impossible states described in [45,139].We show the results in Fig. 25.

Hyperdeterminant
Expanding the definition of determinant to tensors of arbitrary dimensions, we obtain Hyperdeterminants [141], which can also be used as an entanglement metric.In particular, the hyperdeterminant of a tensor 2×2×2×2 characterizes the entanglement of a 4 qubit state, which is maximal for the state 30 whose associated graph is shown in Fig. 26.

Negative Partial Trace
Given a state ρ AB , its partial transpose with respect to the subsystem A is (ρ T A ) ab,mn = ρ mb,an .As shown by Peres, it is a necessary condition for the separability of A and B that none of the eigenvalues of ρ T A are negative [142].Moreover, it is also a sufficient condition for bipartite states of dimensions 2×2 and 2×3 [143].
Aiming for highly entangled states, Brown et.al. looked for states of 2, 3, 4, and 5 qubits, whose partial traces for each bipartition had the lowest possible eigenvalues [144].They called this metric Negative Partial Trace, and it leads to the following states of 4 and 5 qubits 31 32 Fig. 27.Graphs to generate the BSSB states of 4 and 5 qubits, respectively.The latter requires an ancilla.

Rényi Entropy
Among all the entanglement metrics in this document, as well as the ones that are left out, the Rényi Entropy is one of the most important [145].Given a state with ρ AB , the Rényi entropy of order α between the subsystems A and B is where ρ A = Tr B (ρ AB ) and ρ B = Tr A (ρ AB ) are reduced density matrices.Similarly, the Tsallis entropy also describes the entanglement between A and B Notice that in the limit α → 1, both expressions approach the Von Neumann entropy.
A relevant difference between both metrics is that, for α > 1, only the Tsallis entropy is convex while the Rényi one is Schur convex [146].Taking this difference into account, Gour and Wallach showed that the 4-qubit state |L maximizes the average of Tsallis entropies with α = 2 for 2-qubit partitions [147], a metric of entanglement also referred to as the Meyer-Wallach measure [148,149].This state, created by the graph shown in Fig. 28, reads 33 where ω = exp(2iπ/3).
where S α is the Rényi entropy of order α ≥ 0, and p is a normalized probability vector resulting from expanding the state to a product basis.Together with the definition, the authors numerically find two states of three qubits that minimize the entropy for α = 1 and α = 2 34 35 |Φ α=2 = 0.438 |000 + 0.29 |100 + 0.371 |010 These states correspond to the graphs of Fig. 29.

Maximizing Entanglement for Each Partition
The previous states were maximally entangled according to different metrics.Indeed, many of them were found numerically when maximizing such metrics.Similarly, we can use PyTheus to maximize arbitrary physical properties of the states produced by a graph, which can be immediately translated into experiments.This is a great advantage over previous work, in which an analytically described quantum state may not be experimentally feasible.
We optimize the graph according to the Tsallis entropy for α = 2 (see Eq. ( 35)) using as loss function where ρ = |ψ(ω) ψ(ω)| is the state defined by a graph with weights {ω}, ρ A is the reduced density matrix with respect to a subsystem A. A subsystem and its complement A c are a bipartition of the full system.The loss function is minimized for the sum of all bipartitions.Given a bipartition, the entanglement between them is maximal if with D being the dimension of the Hilbert space in which ρ A is defined, and I the identity matrix.Accordingly, multipartite states with maximal entanglement for every bipartition are called Absolutely Maximally Entangled (AME); such kinds of states have applications in Dim Number of particles 2 3 4 5 6 7 8 9 10 2 (3) (3) (3) 3 (3) 4 ¿? 5 Table III.Known AME states up to 10 particles and 5 dimensions.: no AME exist for the 2-dimensional systems of 4, 7, 8, and 10 particles, nor for the 3-dimensional system of 8 particles.¿?: it is unknown whether there is an AME for the 4-dimensional system of 8 particles.: there exist an AME state for the rest of systems.For the 2-dimensional systems of 8, 9, and 10 particles, as well as for the 3-dimensional system of 8 particles, there exist a state with maximally entangled partitions of 3 particles [152,153].The existence of some of these state does not imply that they have been (or can be) experimentally realized.
quantum protocols like threshold secret sharing or opendestination teleportation [151].On the other hand, given a state of N qudits, ρ ∈ H ⊗N d , we call it k-uniform when the entanglement is maximal for all bipartitions of k qudits [152].GHZ states of N-qudits (see Eq. ( 10)) are examples of 1-uniform states.
With PyTheus we can pick types of bipartitions the entanglement is to be maximized.Choosing all bipartitions targets the production of an AME state, bipartitions of size |A| = k target k-uniform states.A mathematical result of entanglement theory is that AMEs only exist for certain combinations of N and d (see table III).In such situations we choose to optimize for k-uniform states.
a. AME States -Since no AME exist for a system of four qubits (see table III), we start optimizing the entanglement for all possible partitions for five qubits, obtaining two different AME states 36 37 For six qubits we found an asymptotic state 38 This is not exactly the AME state of eight qubits, it has eight terms which vanish asymptotically as ε goes to zero.However, by doing so, we reduce the creation rate of the whole state.The graphs to produce this and the 5-qubits AME states are shown in Fig. 30.b. k-Uniform States -While the AME solution for six qubits was merely asymptotic, we can generate the 2-uniform state of such a system 39 Twelve out of twenty three-qubit bipartitions of the above state are maximally entangled.Similarly, we generated a 7-qubit state that maximizes the entanglement between each of the 21 possible k = 2 partitions except one 40 The graph to produce this 'almost' uniform state and the previous one are shown in Fig. 31.c.Other States -As we have seen, even when an AME or k-uniform state for a given system of qudits exists, it is not always realizable with linear optics.However, even if not perfect, we have found several highly entangled states which are worth mentioning.We refer to them as where n stands for the number of particles, d for their dimensions, and k for the size of the partitions.
For a system of four qubits, we find two interesting states when maximizing the entanglement (see Eq. ( 40)) for every 2-qubit partition (see Fig. 32).We first optimize using real weights 41 This state minimizes the sum of partial traces for k = 2 partitions, following Eq.( 40).However, while the sum its (locally) minimal, and all qubit partitions are equally entangled, they are not maximally entangled for k = 2. and all are equally for all k = 1 partitions and for none of the k = 2.However, all k = 2 partitions lead to the same value for the partial trace defined in Eq. ( 40).The entanglement seems to be 'equally distributed'.
The complex state in Eq. ( 49) gives the same entanglement structure as the Higuchi-Sudbery state presented in [154] where ω = e i2π/3 .
Finally, for a system of 8 qubits, PyTheus found a state for which 48 out of 56 total three-qubit bipartitions  32.The graphs produced maximally entangled states for single qubit partitions on a 4 qubit system, they also present high entanglement between 2 qubit partitions (even if not maximal).The weights on the left graph are real, and the weights on the right graph are complex (the phase of every edge can be found in the repository).
are maximally entangled.43 The graph to produce this state is shown in Fig. 33.
It would be interesting to extend the maximization of other entanglement measures, such as experimental feasible, strong forms of all-vs-nothing violations [104], Hardy's version of local realism experiments which goes beyond the violations in Ref. [155,156] (for example, by involving more particles), or other measures of quantum correlations.Such extensions would contribute to the study of artificial intelligence for the foundations of quantum mechanics [157].

Werner State
The Werner state with the density matrix has different properties for different values of α.For α < 0.683, it is known to be Bell-local.For α > 0.697, it is known to be Bell nonlocal [158].This leaves the gap between 0.683 and 0.697 open without a mathematical proof of its properties.By creating this state, it could be

Counter-Example to the Peres Conjecture
Relations between different notions of quantum correlations are studied in quantum information theory.These insights are important to understand the underlying resources of quantum correlations and their applicability in quantum protocols.In 1999, Asher Peres conjectured that the notion of Bell nonlocality and distillability is equivalent [106].Bell nonlocality, as witnessed by a violation of Bell's inequality, says that no local hiddenvariable model can explain the correlations observed in an experiment.A state is called distillable if a maximally entangled Bell pair can be extracted from multiple copies.The conjecture was open for 15 years until a counter-example was discovered in 2014, first for a strong version of the conjecture [107] and shortly after in its full form [108].These violations are based on the uncovering of a two-particle bound state (a state that cannot be distilled) which can be used for quantum steering and violation of Bell's inequality.The Moroder-Gittsovich-Huber-Gühne-Vertesi-Brunner (MGHG-VB) state can be 0 1 2 3 Fig.35.Graph for the Moroder-Gittsovich-Huber-Gühne-Vertesi-Brunner (MGHG-VB) state, which is a counterexample to the Peres conjecture.Here, vertex 3 is an ancilla photon and vertex 2 is the environment vertex.Due to the structure of the MGHG-VB state, the edge weights are not simple fractions.
written as a mixed state that is an incoherent superposition of four entangled two-qutrit states, 45 with λ = 3257 6884 , 450 1721 , 450 1721 , 27 6884 and The graph that corresponds to this state is shown in Fig. 35.It might be interesting to generate this state and show experimentally that the state can violate Bell's inequality and thereby demonstrate an experimental falsification of Peres's conjecture.The ability to perform precise measurements is always affected by several limitations, some of them avoidable by careful design of experiments and others of a fundamental nature.Classically, one can estimate a phase parameter more precisely by increasing the number of particles N in the measurement process; the precision is typically limited to 1/ √ N , also known as the standard quantum limit (SQL).With the aid of quantum resources, one can beat the SQL, and the measurement precision can be enhanced to scale as 1/N , approaching the Heisenberg limit that is governed by the physical law of quantum mechanics.One prominent representative of quantum states with the ability to break the SQL is the well-known N00N states [8,159], as described in Eq. ( 8).
These N00N states can not only be used to test fundamental physics via violating Bell-type inequalities [160] but also play an important role in quantum-enhanced applications, quantum-enhanced microscopes and imaging systems [161][162][163][164], super-resolving phase measurements [165][166][167][168], and quantum lithography [169], to name a few.Interestingly, as the two-mode N00N states are formed in a superposition of two distinct states |N, 0 and |0, N , one could consider that the two terms correspond to the "dead cat" and "alive cat" in the "Schrödinger-cat" form [170].With high-N00N states, we might step closer to a better understanding of macroscopic entanglement envisioned by Schrödinger [171].In the optical regime, achieving an efficient photonic source of N00N states with large N is very challenging.Several schemes and experiments have been toward the direction of generating photonic high-N00N states in different ways, such as by using strong optical nonlinearities [172], by linear optics and feed-forward [173], and by mixing coherent light with SPDC photon-pair sources on a standard beam splitter [170,[174][175][176].
Additionally, interest has also been growing in the simultaneous estimation of multiple parameters using multi-mode quantum states [74,75].Using a multimode state, one can reach the Heisenberg limit with an O(d) advantage over what is obtained with d copies of a two-mode N00N state [177,178].The generalization of the two-mode N00N states in Eq. ( 8) is given as [74,75] |N00N Here we show how to produce perfect N00N states without using any coherent states or feed-forward.We list some examples that might give a different conceptual understanding and new insight.For more path-entangled states, one can directly employ PyTheus.For the ancillary detectors, we always assume they are reached by single photons, like in previous sections.
a. Two Particles -As we have introduced in section 2.1.4,the simplest N00N state is the |N00N 2 2 state that can be deterministically created via HOM interference when two indistinguishable photons are incident on a standard beam splitter simultaneously [70].From the graph in Fig. 6, we can easily generalize the state to an arbitrary number of modes by adding more vertices, each one with a loop.The coherent superposition of a loop being in one of the vertices indicates the resulting multi-mode two-particle N00N states.
b. Three Particles -For producing 2-mode 3photon N00N states |N00N found by PyTheus in Fig. 36, which uses only one color, thus corresponding to the standard path-entangled N00N states.The edge can also be in different colors such that we are able to construct graphs for polarization-entangled N00N states [179][180][181].We further explore the states in multi-mode cases, as described in Fig. 36 (b), (c) and (d) for 3-, 4-, 5-mode three-photon N00N states.Interestingly, the graphs found by PyTheus exhibit a nice structure, which may be amenable to generalization, to systematically produce other multi-mode NOON states without any optimization process.c.Four Particles -For the previous N00N states, we optimized the graphs using real weights, finding the states |40 − |04 and |400 − |040 − |004 46 47 .However, to generate the same N00N states with zero phase difference between the terms we need to, either add a π/2 phase on the solitary loops from Fig. 37 or, using only real weights, add 2 more ancillas.Additionally, after generating the 4-particle N00N states for 2 and 3 modes, it became obvious how to generate the graphs for an arbitrary number of modes.
It is worth noting that given a ket |40 , each combination of non-repeating edges contributes twice as much as one with duplicate edges (assuming equal weights).This is a consequence of the multinomial theorem applied to the creation operators described in Eq. (2).
d.Other Two-Mode States -For the previous N00N states, the associated graphs have shown some patterns.The more obvious was the increasing need for ancillas, Fig. 37. Graphs with only real weights to generate 4-particle N00N states for 2 and 3 modes.Multiplying the i the loops of the disconnected vertices all the amplitudes of the state's terms become positive.To increase the number of modes, we add a triangular subgraph connected to a loop.The edge connecting the two new ancillas must be negative.whether we were adding more photons or modes.Moreover, based on a few graphs, we realized how to generate N00N states with 2 and 4 photons for an arbitrary number of modes.In Fig. 38 we show how to produce the two-mode N00N state for 5, 6, 7, and 8 photons 48 49 50 51 .As with the 3-photon N00N states, it seems to be an underlying pattern in the graphs solutions when increasing the number of photons.

Platonic Solid States
We have been considering states where all N photons are in the same path, with the other paths empty.However, PyTheus can produce path-entangled states which do not fulfill such restrictions.Among them, a very special case leads to the highly symmetric Platonic Solid State [182][183][184], which can resolve rotations around any axis equally well.In the Platonic picture, shown in Fig. 39, an N -photon state is mapped onto N points on the Poincaré sphere [185], offering a systematic way for visualization.This also relates to a long-lasting problem of distributing N points on the Poincaré sphere in a highly symmetric fashion, where one can have many different solutions based on the function one tries to optimize [186,187].Additionally, the concept of Platonic solids has also been used for fundamental investigations in quantum physics [188,189].Apart from their symmetric elegance, there is plenty of room for applications of these states, for instance, in magnetometry, polarimetry, and metrology.Researchers have started investigating how to generate these Platonic solid state.In this part, we show the examples found by PyTheus.
a. Tetrahedron -Our first Platonic solid state is the tetrahedron [190], which is the unique optimal fourphoton state for characterizing polarization rotations.The state written in the Fock basis reads as It can be produced by the graph in Fig. 39 (top panels), and has already been implemented [191].
The similarity between the graphs that produce the tetrahedron and the three-photon N00N state discovered by PyTheus (see Fig. 36 a) shows a nice pattern: to generate states in the Fock basis, we can add an arbitrary number of photons to any path.In this way, starting with a general state |M,N ± |N,M , we can obtain |M,N ± |N,M ⇒ |M+x,N+y ± |N+x,M+y .(56) We only need to connect the first and second paths to x and y ancillary photons, respectively.This construction can be used for an arbitrary number of modes.
b. Octahedron -The octahedron state reads and was found by PyTheus using only 4 ancillary detectors (see Fig. 39).Alternatively, we can apply the pattern described in Eq. ( 56) to the graph that produces |40 − |04 , which is shown in Fig. 37 a).c.Cube -The last platonic solid we are able to produce is the cube state, which reads 52 In Fig. 39, we show the graph that can be used to generate the cube state.As we can see from the expression and Fig. 39 (bottom), the graph cannot be obtained by modifying one of the previous graphs for a two-mode N00N state.

Towards Quantum Simulation
In this section, we present quantum state generation for states from condensed matter physics which could be interesting for quantum simulation [192].The quantum entangled states of few-or many-body systems can generally be expressed by the tensor network formulations [193,194].One of the most successful members of this family with a vast application in condensed matter physics is the 1D matrix product state (MPS).Here one represents the quantum state of a system with periodic boundary conditions and N particles as where s i = {0, . . .d − 1} denotes the local state of the ith particle with local physical dimension d.Here A (si) i is a complex matrix with dimension χ, also known as the bond (virtual) dimension.The matrix A (si) i can be viewed as a projector from a χ-dimensional virtual (correlation) vector space into the physical d-dimensional space [195].While in non-interacting systems, described by product states, the bond dimension χ is one, this quantity grows exponentially with N in most strongly correlated systems.This results in employing numerical techniques to (approximately) obtain the ground states of most many-body systems.Nevertheless, one can find multiple few-or many-body ground states with χ > 1 but independent of the particle number.Here, we present a collection of these ground states with a concise description of their host Hamiltonian and their physical implication upon realization.While our focus is on zerotemperature ground states, we emphasize that the applicability of PyTheus is not limited to these states.This is because both mixed states 2.1.3,which describe open quantum states, and states constitute combinations of (various) Fock states 2.1.4,can be used to study the (grand) canonical ensemble, are treatable by PyTheus.

Spin-1/2 Systems
Due to the simplicity of spin-1/2 systems and the surge of interest in qubit quantum computation, these manybody systems received ever-growing attention.The local physical space of these systems spanned by {|↑ , |↓ }, or equivalently {|0 , |1 }, results in the local physical dimension d = 2. Despite such a small physical dimension, the obtained ground states can be rich and exotic.In the following, we list some of these states.
a. Spin-1/2 Wire -A computational quantum spin-1/2 wire governed by nearest-neighbor interactions, associated with non-zero two-point correlation functions and arbitrary local entanglement, is described by [195,196] where where φ and τ denote the entanglement factor and period, respectively.
Fig. 40 displays the associated graph for the ground state of the spin-1/2 wire for four particles with φ = π/2.The state, up to normalization, reads 53 b.Spin-1/2 States with No Adjacent Spin-ups -Aside from the previous spin-1/2 state, one can compute entangled states where no two neighboring spin-ups appear in the ground state.One can expect to detect these states in spin systems with nearest-neighbor interactions.In the Rydberg-atom experiments, this situation occurs due to the Rydberg blockade [197].The matrix product representation of these states reads where with σ + = σ x + iσ y .Fig. 41 displays the associated graphs for this system with various numbers of particles whose ground states read • 54 Three particles with one ancillary particle: • 55 Four particles:

6-body
Fig. 41.Associated graphs for spin-1/2 states with no adjacent spin-ups for three, four, five, and six particles.One ancillary particle is included in states with an odd number of particles (left column).
• 56 Five particles with one ancillary particle: • 57 Six particles: c. Majumdar-Gosh Model -The one-dimensional quantum Heisenberg spin model is known as the Majumdar-Gosh model when the value of the nextnearest-neighbor interaction is half the value of the nearest-neighbor antiferromagnetic exchange interaction.The Hamiltonian of this model casts [198] where The ground states of this model Hamiltonian are dimerized states given by products of singlet configurations of spins on neighboring sites.The linear combination of these states reads [198] where This ground state of the Majumdar-Gosh model is one of the simplest spin-1/2 valence-bond solids in onedimensional systems.Fig. 42 displays the associated graphs for the four-and six-particle systems whose ground states read • 58 Four particles: • 59 Six particles with two ancillary particles: d.Dyck Words -The Fredkin spin-1/2 model with a three-body interaction term reads [199][200][201][202] where • 61 Eight particles: The associated graphs for these states are shown in Fig. 43.

Spin-1 Systems
The quest to go beyond the two-level qubit systems in quantum computation put forward other proposals based on three-level qutrit quantum states [203,204].In spin systems, this inquiry is translated into exploring the S = 1 space spanned by {|−1 , |0 , |1 } with physical dimension d = 3.While spin-1 states can be realized experimentally in a controlled fashion [205], often, one may encounter these states as emergent phenomena in various spin-1/2 condensed matter systems, e.g., in describing the low-energy physics of chiral threefold fermions [206].As a result, aside from technological implications, exploring the higher-spin systems may shed light on a better understanding of some emergent phenomena in other fields of physics.
a. Spin-1 Wire -The antiferromagnetic ground state of a spin-1 chain with nearest-neighbor interactions can be represented in the matrix product form as [207] where with nonvanishing a and σ. b.Affleck-Kennedy-Lieb-Tasaki Model -A particular spin-1 bilinear biquadratic Hamiltonian introduced by Affleck, Kennedy, Lieb, and Tasaki (AKLT) is given by [208,209] The ground state of this solvable model, known as the AKLT state, is short-range entangled and classified in symmetry-protected-topological states [210].The MPS representation of this state reads [193,198] |ψ where s i ∈ {0, 1} and Here σ ± = σ x ± iσ y .The AKLT state is the spin-1 valance bond [211].Fig. 45 displays the associated graphs for the threeand four-particle AKLT system whose ground states read, up to normalization 63 64 • 66 Four particles: The associated graphs for these states are presented in Fig. 46.
where The ground states of the spin-3/2 chain, up to normalization, reads 67 The associated graph for this state is shown in Fig. 48.Five-level computational units can further be of interest in quantum computation beyond qubits.The local physical space of these spin-2 units is spanned by {|−2 , |−1 , |0 , |1 , |2 } with local physical dimension d = 5.Similar to other higher-spin systems in condensed matter systems, spin-2 states can also be viewed as emergent states in some (lower-spin with S < 2) many-body systems [217].
a. Spin-2 Wire -The anisotropic spin-2 chain with nearest-neighbour interactions hosts various phases depending on three parameters (a, x, σ) with a ∈ R, σ = ±1 [218].These phases consist of three distinct antiferromagnetic Haldane phases and a weak antiferromagnetic phase.
The ground states of the weak-antiferromagnetic phase have the following matrix product representation: where Here we set a = 0.5.
When the translational symmetry is not broken, i.e., x = 1, two more states can also be identified for this phase, given by ψ When the symmetry is respected, the states, up to normalization, are 70 The Haldane-antiferromagnetic-A is another possible phase in this spin-2 system described by the ground state where Fig. 50 displays the graph associated with the ground state, with three particles and five ancillas, for the Haldane-antiferromagnetic-A phase.Up to normalization, the state reads 71 The ground states of the second antiferromagnetic Haldane phase, referred to as Haldane-antiferromagnetic-B, reads where Similarly, the ground state of the third Haldaneantiferromagnetic phase, known as Haldaneantiferromagnetic-C, is where si∈{−2,0,2} Notice that the last Haldane phases, B and C, have essentially the same Hamiltonian as the weakantiferromagnetic phase when the translational symmetry is preserved (see Eq. ( 99)).One can obtain one from the other by performing |±1 ↔ |±2 .

Quantum Many-Body Scars
The phenomena in which weakly entangled nonthermal quantum eigenstates are embedded in the eigensystem of non-integrable (thermal) systems is dubbed 'quantum many-body scars' [219].The well-known examples of these scar states are shown to be present in the AKLT spin chain models [220,221].The experimental realizations of such states are also reported in Rydberg-atom quantum simulators [197,222].In the following, we suggest that one may also detect these states using quantum optics experiments.
a. Onsager's Scars in Disordered Spin Chains -A non-integrable quantum spin chain that exhibits quantum many-body scars can be described by the coherent state with parameter β as [223] where A, B are n × n matrices with matrix elements Here 0 ≤ i, j ≤ n − 1 with n ≥ 2. This representation ensures that no certain spin configurations occur over three consecutive sites in |ψ β .Fig. 51 displays the graph associated with the Onsager's scar in a system with six and eight spins, with β = 1/ √ 2. Up to normalization, the states read 72 73 b. Scars in the PXP Model -Another platform where quantum scars emerge is in the P XP model.This model on a chain with L sites and with the periodic boundary condition is [224] where P = |0 0| and X = |0 1| + |1 0|.One of the ground states of this model in the matrix product repre-sentation yields where Fig. 52 displays the graph associated with the ground state of the PXP model with six and eight particles.Up to normalization, these states read 74 75

Quantum Measurements
An important tool in quantum information is multiparticle measurements such as the Bell state measurement [78] or the GHZ analyzer [225].Here we present a wider range of measurements that PyTheus has discovered.Many others, such as POVM (positive operatorvalued measure) or their symmetric, informationally complete special case (SIC-POVMs) could be additional targets for future research, given their exceptional importance for quantum information tasks [226,227] as well as their connection to exciting number theoretical questions [228].

Analyzers
Here, we use the word analyzer to refer to experimental setups that confirm a collection of photons to be in a particular state.Their formulation in terms of graphs is described in 2.2.The two-dimensional GHZ analyzer realized in Ref. [225] can be extended towards higher dimensions, giving the 3d GHZ analyzer 76 and the 4d GHZ analyzer 77 .Further, we show analyzers for the W state 78 , the Higuchi-Sudbery state (shown in Eq. ( 50)) 79 and the Yeo-Chua state (shown in Eq. ( 27)) 80 in Fig. 53.

Mean King's Problem
In 1987, L. Vaidman, Y. Akaronov, and D. Z. Albert [105] devised an interesting quantum communication task that can be solved only with quantum resources.Later referred to as the Mean King's Problem (MKP), it involves two parties.Alice, who sends a quantum state which she created to another party -the Mean King.The Mean King then performs a projective measurement on the state in a basis of his choice out of a collection of mutually unbiased bases (MUBs).Alice is then allowed to perform one more measurement, after which the King declares his measurement basis and Alice must correctly guess his result.Should Alice guess incorrectly even once, she will suffer a cruel fate, for the Mean King is exceptionally intolerant of poor guesses.This task has applications in quantum key distribution, wherein even the slightest discrepancy between the shared secret key of Alice and Bob implicates (in principle) the presence of an eavesdropper.
Over the years, various generalizations to the initial solution, proposed in the original paper [105], have been introduced.Here, we employ a generalization proposed by Hayashi, Horibe, and Hashimoto [229] for quantum states of dimension D which is a prime power.This solution proposes that Alice first prepares a maximally entangled, two-photon state |ψ o and sends one of her photons to the Mean King.After the King makes a projective measurement in one of the (D + 1) MUBs, Alice retrieves her photon and performs a measurement in the basis of states credited to Vaidman, Akaronov, and Albert (VAA states).There are D 2 VAA states in all.For D = 2, the first VAA state can be written as For D = 3, the third VAA state can be written as where ω = e −i2π/3 , α = (ω 2 + 2ω)/3, β = (ω 2 + 2)/3, and γ = (ω + 2)/3, Experimentally realizing Alice's measurement in this basis is non-trivial.Setups that recreate the twodimensional VAA measurement using two qubits encoded in a single photon [230,231] and that realize extensions to the Mean King's problem [232] have been proposed; but the original solution to the Mean King's Problem involves two photons, to which no experimental realization has been proposed for any prime-power D.Here we provide examples discovered by PyTheus for select prime-dimensional cases.
a. Two-dimensional Case -The left side of Fig. 54 shows the graph of Alice's measurement in the VAA basis 81 .This graph was found with PyTheus by optimizing for the VAA state projection into |φ 1 .Surprisingly however, during the translation of the graph to an optical setup, we found that several other VAA states can be projected with the same setup, by adding detectors at unused beam splitter ports.Several of the remaining VAA states can then be distinguished by the set of possible simultaneous two-detector click events that they each trigger.Since any result of the Mean King's measurement can be expressed in terms of a superposition of VAA states, Alice is able to guess the result by performing the measurement of her input state in the VAA basis and guessing the state that can be expressed in terms of Alice's measurement result.This procedure works regardless of the Mean King's choice of MUB in his measurement.
b. Three-Dimensional Case -The right-hand side of Fig. 54 shows the graph for the projection of the state into the one of the three-dimensional VAA states |φ 3 82 .As with the two-dimensional case, we add again detectors at the empty port of beam splitters and find that we can distinguish between more three of the nine states without any additional modifications.After post-selection, Alice has a guaranteed chance to correctly guess the Mean King's measurement result so long as the King does not choose the second MUB for his measurement.Were the King to pick that MUB, two of the three results of the measurement are expressed in terms of VAA states that Alice cannot distinguish, giving her a 50% chance of escaping the Mean King's cruelty.

Quantum Communication
Quantum communication refers to communication protocols that involve the transfer of quantum states.Machine learning has been previously employed for the artificial discovery of quantum communication schemes [33].
The first experimental realization of entanglement swapping was presented as a way of entangling two photons that never interacted [81].In this section we show graphs corresponding to experiments that create entanglement between two parties (each party with single or multiple photons) without interaction between the parties.Entanglement swapping has a strong connection to other quantum communication tasks, e.g.teleportation.This opens the door to use PyTheus for discovering related quantum information protocols.
a. Entangling Two Photons that Never Interacted without Bell Pairs -Respecting the constraints that are placed on two particles that do not interact (presented in section 2.3) we show a graph that entangles two photons from independent sources in Fig. 55 83 .The corresponding setup constructed by path identity does not require the initial creation of entangled Bell pairs b.Multiparticle Entanglement Swapping -Performing simultaneous entanglement swapping on multiple pairs of particles is one of the key players in achieving quantum glement swapping between two qubits requires two additional particles for a Bell state measurement.Performing this swapping experiment in parallel for n qubit pairs would require 2n additional photons.We prompted PyTheus to find experiments that beat this naive baseline.With this, we found a three-qubit entanglement swapping experiment (Fig. 56), which produces the state 84 where the photons 0, 1, 2 are separated from 3, 4, 5.This experiment requires four additional particles instead of  the six particles necessary for the parallel case described above.
Similarly, entanglement swapping between a pair of qutrits requires four ancillary particles.We found that "performing entanglement swapping for two pairs of qutrits could also beat the naive baseline by only requiring six ancillas instead of eight, in total, to produce 85 where the photons 0, 1 are separated from 2, 3, and |Φ + 3d is the first three-dimensional Bell state.c.Entanglement Swapping with Single-Photon Sources It is also possible to use single-photon sources for entanglement swapping [83,233,234].In Fig. 57, we show a graph 86 for a higher-dimensional case, performing three-dimensional entanglement swapping with single photon sources.In total, six single photon sources are necessary.

Quantum Gates
Universal quantum gates, which rely on the interaction between two or more photons, can be realized with non-linearities induced by measurements [87].Quantum gates based on this approach, such as a CNOT between two qubits, have been realized experimentally for almost twenty years [88].However, since then, the attempt to experimentally discover a wide range of quantum gates has continued due to the advancement of experimental resources which can deal with higher dimensional systems.a. Heralded -We call a quantum gate heralded when only ancillary particles are detected, meaning that the outgoing particles are not measured.The photons exiting such a gate can continue into further components of a longer circuit.We find that a higher dimensional version of the CNOT gate with a control qubit and a target qutrit (CNOT(2, 3) 87 ) can also be realized with two ancilla photons.Further, we find a heralded Toffoli gate with four ancillas 88 ; see Fig. 58.
b. Reduced Input Space -For some tasks in which quantum gates are applied, there is some prior knowledge about the input state.One simple example is the application of a CNOT gate on a superposition state as the control qubit and a fixed computational basis state as the target qubit, in order to create entanglement.This type of knowledge about the input can be exploited to reduce the experimental resources required to perform the transformation [95,235].A wide range of constraints on the input state can be encoded by our framework.Here we show examples of heralded quantum gates where a target qubit is prepared in the zero state before entering the gate.
PyTheus found gates CNOT(3, 3) 89 , CNOT(4, 4) 90 and the Fredkin gate 91 acting on a target input photon in the computational zero state; see Fig. 59.A post-selected Fredkin gate on the full input space has been experimentally realized [96].c.Post-Selected -When post-selecting a gate, all outgoing photons are detected and thus destroyed.Such a gate does not require as many resources as a heralded gate, but it imposes restrictions, such as not mixing the two output paths, on the remainder of the circuit, to ensure that the presence of a photon in each output of the gate can be ascertained.PyTheus found different post-selected high-dimensional CNOT gates, such as CNOT(2, 3) 92 , CNOT(2, 4) 93 , CNOT (3,3) 94 and the Toffoli gate 95 ; see Fig.  Experiments exploiting single-photon sources as an additional resource for the construction of quantum gates have been previously demonstrated [102].Fig. 61 displays graphs for a heralded CNOT(2, 2) with two additional input photons 96 , a heralded CNOT(2, 3) with three additional input photons 97 , and a post-selected CNOT(2, 3) with two additional input photons 98 .

Combinatorial Measures
In this section, we demonstrate how PyTheus can discover exceptional structures without computing the quantum state.This ability might be useful for finding experimental configurations with particular symmetries or properties that are interesting, independent of the resulting quantum state.Such metrics can also be combined with other objectives mentioned in the previous sections.

Assembly Index
As an example for structural property discovery, we consider the assembly index, which has been invented in chemistry for the search of extraterrestrial life [236,237].Specifically, the assembly index counts the complexity of building up a combinatorial structure, for instance, molecules or -in our case -graphs.It counts the number of independent processes that are necessary to create a structure.The hypothesis is that a structure with a large assembly index cannot be formed by natural processes and would require complex (living) systems for its generation.Strong indications in favor of this hypothesis have been found in the study of millions of molecules on earth [237].
Our goal here is to discover graphs with very high assembly indices.The assembly index is a discrete structural metric that cannot be optimized directly using gradients.However, we can use the weights of edges to transform the discrete metric into a continuously differentiable metric.A general procedure is to compute the average combinatorial value of the weighted graph from sampled discrete graphs.Here, the weights |ω i | 2 are used as probability for sampling discrete graphs.While this pro-  cedure is differential, it is computationally expensive as many sampled graphs need to be evaluated to obtain an average assembly index of the whole graph.
Alternatively, here we restrict ourselves to graphs with exactly eight edges (with 4 99 and 6 100 vertices).Here, the eight highest-weighted edges are used to generate the graph, and in addition, weights are used to change the order of edges.The graphs in Fig. 62 present graphs with very high assembly indices with 4 vertices and 8 edges as well as 6 vertices and 10 edges.

OUTLOOK
This article uses a list of examples to showcase the broad range of possibilities of digital discovery in quantum optics.The goal to design one hundred novel and intriguing experiments has led us to collect a diverse set of tasks for which experimental setups could be designed.To make the discoveries possible, we expanded the theoretical framework underlying the algorithm and produced faster, more versatile open-source software.We hope that this work can be an inspiration for experimental physicists in two ways: (1) to explore some of the experiments as they are proposed in this article (2) to see that PyTheus can be used to design experiments for a wide range of targets and for individually tailored specifications of experimental restrictions and resources.To explore particular examples that have not been covered in this article, the open-source library PyTheus can be used.Many more avenues leave room for significant further exploration, particularly within the optimization for targets other than fidelity, as well as more specific experimental constraints.For this, the PyTheus framework can readily be expanded in the future.
A number of extensions that would be interesting include the discovery of experiments that maximize success probability in terms of heralding efficiency or Bell state measurement efficiency, especially as experimentally available technologies became increasingly powerful [238].The potential of PyTheus on suggesting experimental setups can pave the way to find experiments to simulate quantum states, which are nowadays merely realizable in extreme (thermodynamics) conditions, such as high pressure and low temperature [239].An exciting extension would be the analysation whether we can extend state generation to encoding the dymanics of a quantum state into the weights of the graphs.Along with this line of research, it is theoretically tantalizing to explore the putative correlation between the complexity of time-evolved states [240] and the complexity of associated graphs as outputs of PyTheus.
As a final thought, we want to view our results through an additional lens.We have created a dataset of 100 hand-selected quantum experiments that are some aspects exceptional (which PyTheus has discovered).This dataset might be large enough for highly efficient artificial intelligence algorithms to bootstrap an intuition of what properties make an experiment interesting, and allow them to produce proposals for new, hopefully equally interesting quantum experiments.It would sure be exciting to investigate the physical properties of the proposals that the machine believes are interesting.In the best case, it could act as an inspiration for new ideas for the human scientist [241].

ACKNOWLEDGMENT
photon path to a detector single photon incoming ancillary particle environmental interaction

Fig. 2 .
Fig.2.Asymptotic solution for quantum experiments producing a three-dimensional six-particle GHZ state.There are four perfect matchings in the graph, which contribute to four terms in the quantum state |ψ = ω |000000 + ω |111111 + ω |222222 + ω 3 |002121 .With very small ω, the probability of the unwanted term can be arbitrarily small and negligible.

Fig. 4 .
Fig.4.An abstract graph for quantum experiments producing a Bell state with single-photon sources.The vertices SPS d and SPSc described as triangles stand for the incoming path for single-photon sources while vertices a and b stand for the optical paths.No edges are allowed between input vertices SPS d and SPSc.The perfect matchings in this graph lead to a two-dimensional Bell state.The corresponding experiments are listed below.Experimentally, a single-photon source can be either a heralded single-photon source implemented with a photon-pair source and a photon-number-resolving detector (PNRD) or a deterministic single-photon source which can be an ideal quantum-dot-based source.In this experiment, the two photons arrive at the same time (and have the same wavelength, polarization, and spatial mode) such that they are indistinguishable.

Fig. 5 .
Fig.5.An abstract graph for producing mixed states.The detection paths were labeled a, b, c, and env, and internal modes described in blue and red are mode numbers 0 and 1.A mixed state can be generated by using one of the vertices as the environment (vertex env in this example).Experimentally this could be implemented by measurements that do not discriminate between the photon modes, for instance, detectors with a large active area.The corresponding setups for the graph are listed below.

Fig. 6 .
Fig.6.Graphs for producing |N00N2  2 states and the related experiments.On the left side, the graph with two blue edges (i.e., two self-loops) is for a path-entangled N00N state(|2, 0 a,b − |0, 2 a,b )/ √ 2.We translate this graph into several setups (below the graph).The setups using path identity or path encoding are the same in this case.With bulk optics, one can achieve the state with a Hong-Ou-Mandel interferometry[20,70], where two identical photons enter a 50:50 beam splitter.One can also perform such a state in polarization, i.e., (|2, 0 H,V − |0, 2 V,H )/ √ 2 on the right side.The blue and red colors are, respectively, for horizontal and vertical polarization.The coherent superposition of blue and red self-loops gives the N00N state.Its related setup is described below the graph.There either two horizontally polarized photons (blue edge) or two vertically polarized photons (red edge) are in path a with a single-photon sensitive detector.

Fig. 8 .
Fig. 8.An abstract graph for Bell state measurement.A measurement event happens if the photons in1 and in2 are in the Bell state Ψ − .Simultaneous clicks in the detectors D1 and D2 signify a successful Bell measurement.The corresponding setup is given for the graph, which is a typical Bell state measurement setup.

Fig. 9 .
Fig. 9.An abstract graph for entanglement swapping.On the right, an experimental setup for entanglement swapping is shown.The two particles a and d are entangled when two ancillary detectors click.A common source of particles a and d (as shown crossed out below the setup) would circumvent the point of entanglement swapping.The two particles are to be entangled without having interacted with each other.This restriction manifests in the graph corresponding to the experiment (shown on the left).An edge between the vertices a and d (dashed line) is not permitted.

Fig. 10 .
Fig.10.An abstract graph for a quantum CNOT gate shown on the left side.The right panels show the corresponding setup for a CNOT gate, which was realized by[88].
Heralded 3D Bell state with single photons (improves state-of-the-art design by requiring less ancilla photons) Two-mode five-photon N00N state |50 + |05 (very symmetric shape with an inscribed pentagram) Mixed state with bound entanglement that can violate a Bell inequality (counterexample to the Peres conjecture from 1999, solved 2014)

Fig. 12 .
Fig.12.High-dimensional multiparticle GHZ states with ancillas.The weights here in these graphs are real numbers and the diamonds inserted in the edges represent the negative sign.The vertices in square refer to the detection of an ancillary photon.|GHZ4  4 is a asymptotic solution.

Fig. 13 .
Fig. 13.Graph corresponding to the creation of a 3 qutrit Bell gem.

Fig. 19 .Fig. 20 .
Fig. 19.The three-dimensional Dicke states for three and four particles (top) were found by PyTheus.The 2 graphs in the bottom row were manually produced following the observed pattern.

Fig. 28 .
Fig. 28.Graph to generate the 4-qubit L-state.All the weights in the graph are complex.
) obtaining a state which maximizes all possible partitions except one.For the second solution, we extend the weights to the complex domain, finding a local optimal 42 |Ent(4,2,2) C = |0011 + e −i0.54π |0101 + e −i0.93π |0110 + e i0.45π |1001 + e i0.71π |1010 + e i0.86π |1100 .( Fig.32.The graphs produced maximally entangled states for single qubit partitions on a 4 qubit system, they also present high entanglement between 2 qubit partitions (even if not maximal).The weights on the left graph are real, and the weights on the right graph are complex (the phase of every edge can be found in the repository).

Fig. 40 .
Fig. 40.The associated graph for the ground state of the spin-1/2 wire with four particles.

Fig. 42 .
Fig. 42.Ground states of the Majumdar-Gosh model with four (left panel) and six (right) particles.Two ancillary particles are included in the right panel.

Fig. 43 .
Fig. 43.The graphs corresponding to the creation of Dyck word states.

Fig. 44 Fig. 44 .
Fig.44.The associated graph for the ground states of the spin-1 chain with three particles.

Fig. 45 .
Fig.45.The associated graphs for the ground state of the spin-1 AKLT state with three and four particles.One ancillary particle is included in the first state.

Fig. 47 .
Fig.47.The associated graphs for the ground states of the spin-3/2 chain for three particles.

Fig. 48 .
Fig. 48.The graphs corresponding to the creation of the spin-3/2 letter state.

Fig. 49 =0. 5 (
Fig.49displays the associated graphs for the threeparticle ground states of the weak-antiferromagnetic phase when the translational symmetry is broken (top panel) and respected (bottom).The states with broken translation symmetry, up to normalization, read 69

Fig. 49 .
Fig.49.The associated graphs for the three-particle ground states of the weak-antiferromagnetic phase when the translational symmetry is broken (left) and respected (right).

Fig. 50 .
Fig. 50.The associated graph for the three-particle ground state of the Haldane-antiferromagnetic-A phase.

Fig. 51 .
Fig. 51.The associated graphs for the Onsager's scar in a system with six (left panel) and eight (right) qubits.Here we set β = 1/ √ 2.

Fig. 52 .
Fig. 52.The graphs associated with the ground state of the PXP model with six (left panel) and eight (right) particles.

Fig. 53 .
Fig.53.Graphs for analyzers.When all detectors click, the incoming photons were in the corresponding state.

Fig. 54 .
Fig.54.Graphs realizing the VAA state measurement for the MKP in the 2-dimensional case and 3-dimensional case.

Fig. 55 .
Fig. 55.Entanglement between two qubits without a common source.Because the vertices a and d have no connection in the graph, each of the corresponding photons is created in one of two disjoint subsystems (green boxes).

Fig. 56 .
Fig. 56.Entanglement swapping of 3 Bell pairs measuring only 4 photons.Left: abstract graph for multiparticle entanglement swapping.Right: outline of a multiparticle Entanglement swapping experiment.Alice and Bob each receive three particles from the two independent sources 1 and 2 (each a collection of SPDC crystals).When Charlie measures a coincidence in all four detectors Alice and Bob share three Bell pairs (0&3, 1&4, 2&5) without them having interacted.This is possible due to a superposition of events where Charlie either receives three photons from Alice and one photon from Bob or one photon from Alice and three photons from Bob.

Fig. 61 .
Fig. 61.Graphs for quantum gates with single-photon sources as an additional resource.
The ground state of this model is an equally weighted superposition of spin configurations forming Dyck words.Here one may use the notation |↑ = |( and |↓ = |) to translate the spin states into the Dyck words.In this notation, the ground state forms balanced strings whose segments contain equal numbers of open and closed parentheses.The ground states of the Fredkin model with six and eight particles cast • 60 Six particles: