Skip to content

Commit d5812d9

Browse files
authored
Update README.md
1 parent 100e6d8 commit d5812d9

File tree

1 file changed

+356
-1
lines changed

1 file changed

+356
-1
lines changed

README.md

Lines changed: 356 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,362 @@ Options:
5252
--help Show this message and exit.
5353
```
5454

55-
## Development
55+
# Discovery for Diverse Experimental Resources
56+
57+
Our package allows for the discovery of quantum experiments for a range of experimental goals, constraints and
58+
resources. Experiments that can be produced include:
59+
60+
* state creation (heralded or post-selected)
61+
* quantum gates (heralded or post-selected)
62+
* measurements of quantum states
63+
* entanglement swapping
64+
* (covered elsewhere: mixed state creation)
65+
66+
Sources for photons in these experiments can be SPDC sources, deterministic single-photon sources or a mix of the two.
67+
68+
Detectors can be photon-number-resolving or not.
69+
70+
Each of these experiments can be described with a graph. The interpretation of nodes and edges varies with the kind of
71+
experiment.
72+
73+
### Rules for Loss Functions
74+
75+
With these varying interpretations (e.g. for single photon sources, input photons, entanglement swapping), different
76+
constraints apply on what kind of graph can correspond to an experiment (Topological Rules).
77+
78+
With the different ways of performing the experiments (heralded/post-selected & number-resolving/non-number-resolving),
79+
different events are selected out of all possibilities (post-selection rules).
80+
81+
#### Topological Rules
82+
83+
All experiments that our package is applied to can be described by a graph. When describing state creation using SPDC
84+
each edge can be interpreted as a pair-creation. In this case all edges of the complete graph can be considered
85+
physically legitimate. When describing other experiments edges can be interpreted differently. Not every edge will be
86+
physically meaningful. Consequentially there are constraints on which connections of the complete graph are used in the
87+
optimization.
88+
89+
*(A) Single Photon Sources and Input Photons*
90+
91+
Deterministic single photon sources and input photons (such as in gates) are described as (input) vertices in a graph.
92+
An edge connecting an input vertex to a detector describes a path in which a photon can travel from the input into the
93+
detector. This interpretation stems from the [Klyshko picture](https://arxiv.org/pdf/1805.06484.pdf). From this a
94+
constraint on the graph follows. Two input vertices can not be connected by an edge. It could not be interpreted
95+
physically.
96+
97+
*(B) Entanglement Swapping and Teleportation*
98+
99+
In entanglement swapping, photons are entangled that have not interacted before. If we want to design an entanglement
100+
swapping experiment of two photons, the target is to discover a graph that produces an entangled state between the two
101+
photons. However any edge between the corresponding vertices would translate into a common source crystal. A constraint
102+
that ensures legitimate entanglement swapping is to remove any edge between the two parties
103+
104+
#### Post-Selection Rules
105+
106+
The rules for post-selecting coincidence events have been described in the
107+
[Theseus paper](https://journals.aps.org/prx/abstract/10.1103/PhysRevX.11.031044). Here, post-selection projects the
108+
space of possibilities containing arbitrary combinations of crystals firing into the space of possibilities where only
109+
crystals fire for which all detectors at the end of the experiment click. In the graph picture these combinations
110+
correspond to the perfect matchings. A state is produced with fidelity one in post-selection if all possibilities of
111+
coincidence events contribute to that state.
112+
113+
Other experimental settings (such as heralding) and additional experimental resources (such as number-resolving
114+
detectors)
115+
perform a different kind of projection on the space of possibilities by selecting for different events. This different
116+
selection is reflected in the fidelity of the state. The products of the edge weights belonging to each possibility
117+
contribute to the norm of the fidelity.
118+
119+
*(A) Heralding*
120+
121+
Heralding is a less strict form of selecting events. Instead of putting a detector in every path and selecting for
122+
coincidence, only a subset of the paths are detected _heralding_ an output state in the unmeasured paths. This selection
123+
rule not only allows for possibilities where one photon is in every path (perfect matchings) but also for other
124+
possibilities (edge covers) as long as they cover the heralding detectors. This can lead to cross-terms that are not
125+
present when post-selecting for coincidence in all paths. Consequentially it is more difficult to find a graph with
126+
fidelity one, also requiring more experimental resources.
127+
128+
*(B) Single Photon Sources and Input Photons*
129+
130+
When describing heralded experiments (above) one has to consider edge covers instead of perfect matchings in the graph
131+
for possible events. These possibilities include one edge being included twice in an edge cover, corresponding to a
132+
crystal firing twice in an experiment. For single photon sources and other deterministic input photons such
133+
possibilities do not exist. Only edge covers that cover the input vertices exactly once are considered for the norm of
134+
the fidelity.
135+
136+
*(C) Photon Number-Resolving Detectors*
137+
138+
Photon number-resolving detectors are a valuable resource that can restrict the space of possibilities more than a
139+
regular detector. When one can be certain that exactly one photon, and not two, has entered a detector it reduces the
140+
number of events that could have led to this outcome, eliminating cross terms.
141+
142+
*(D) States in Fock Basis*
143+
144+
...
145+
146+
## Loss Functions For Target State Optimization
147+
148+
As explained above, the loss function depend largely on the different experimental conditions. Independent of these
149+
conditions they fall into two categories.
150+
151+
* Fidelity
152+
* Count Rate
153+
154+
A Fidelity of one ensures that an experiment has no unwanted cross terms. Every possibility that is selected for
155+
contributes directly to the target outcome.
156+
157+
However, we have come to find that optimizing exclusively for fidelity in some cases can lead the optimization to scale
158+
down the weights of the entire graph to minimize the contributions of crossterms. While the fidelity will be very close
159+
to one in those cases the generally low edge weights would lead to very low count rates of successful events in actual
160+
experiments.
161+
162+
To find solutions with higher weights we have introduced the _simplified count rate_ as a loss function.
163+
164+
# Config Examples
165+
166+
This section gives examples for config files showcasing the features for different kinds of experiments that can
167+
searched for.
168+
169+
## Target State Optimization
170+
171+
This is used when the in- and out-going states can be clearly defined by a state functions. For those, the loss
172+
functions `cr` and `fid` are used.
173+
174+
Below are some examples to give an idea of the scope.
175+
176+
For further details, refer to the definition of the function `setup_for_target` in `main.py`.
177+
178+
### Post-selected State creation
179+
180+
Here is an example for a config file optimizing for a graph that creates a three particle four-dimensional GHZ state.
181+
182+
```json
183+
{
184+
"description": "Finding a setup for the creation of the three-particle four-dimensional GHZ state. It can be realized with three ancillary particles",
185+
"foldername": "ghz_346",
186+
"target_state": [
187+
"000",
188+
"111",
189+
"222",
190+
"333"
191+
],
192+
"num_anc": 3,
193+
"loss_func": "cr",
194+
"thresholds": [
195+
0.25,
196+
0.1
197+
],
198+
"samples": 10,
199+
"optimizer": "L-BFGS-B",
200+
"ftol": 1e-06,
201+
"edges_tried": 20,
202+
"tries_per_edge": 5
203+
}
204+
205+
```
206+
207+
General info is given by `description`. With `foldername` one can give a custom name for the subfolder where solutions
208+
are saved.
209+
210+
In the simple case of post-selected state creation with SPDC crystals, `target_state`, `num_anc` and `loss_func` are all
211+
that are needed to define the objective of the optimization.
212+
213+
`thresholds` is necessary to decide whether a topological optimization step has been successful. In this case,
214+
when `1-countrate < 0.25` and `1-fidelity < 0.1`.
215+
216+
### Post-Selected Quantum Gates
217+
218+
For an example how topological constraints on the starting graph of the optimization are dealt with, consider the
219+
example of a post-selected CNOT(2,3) quantum gate.
220+
221+
```json
222+
{
223+
"description": "Postselected CNOT between a qubit (control) and a qutrit (target). Two ancillary photons from SPDC.",
224+
"foldername": "cnot_23",
225+
"target_state": [
226+
"0000",
227+
"0101",
228+
"0202",
229+
"1011",
230+
"1112",
231+
"1210"
232+
],
233+
"in_nodes": [
234+
0,
235+
1
236+
],
237+
"out_nodes": [
238+
2,
239+
3
240+
],
241+
"num_anc": 2,
242+
"loss_func": "cr",
243+
"thresholds": [
244+
0.3,
245+
0.1
246+
],
247+
"samples": 10,
248+
"optimizer": "L-BFGS-B",
249+
"ftol": 1e-06,
250+
"edges_tried": 30,
251+
"tries_per_edge": 5
252+
}
253+
```
254+
255+
Here, `target_state` defines a logic table. It is defined through `in_nodes` and `out_nodes`, which entries belong to
256+
incoming photons and which belong to outgoing photons. These definitions suffice to automatically put constraints on the
257+
starting graph.
258+
259+
### Heralded Quantum Gates with Single Photon Sources
260+
261+
Two additional features are heralding and single photon sources. A simple example is a CNOT gate between two qubits
262+
heralding on two ancillary detectors.
263+
264+
```json
265+
{
266+
"description": "Heralded CNOT gate between two qubits with two single photon sources. Similar has been done: https://journals.aps.org/prl/pdf/10.1103/PhysRevLett.126.140501 could this have a better success probability?",
267+
"foldername": "cnot22sp",
268+
"target_state": [
269+
"0000",
270+
"0101",
271+
"1011",
272+
"1110"
273+
],
274+
"num_anc": 2,
275+
"in_nodes": [
276+
0,
277+
1
278+
],
279+
"out_nodes": [
280+
2,
281+
3
282+
],
283+
"single_emitters": [
284+
4,
285+
5
286+
],
287+
"heralding_out": true,
288+
"loss_func": "cr",
289+
"thresholds": [
290+
1,
291+
0.1
292+
],
293+
"samples": 10,
294+
"optimizer": "L-BFGS-B",
295+
"ftol": 1e-06,
296+
"edges_tried": 30,
297+
"tries_per_edge": 5
298+
}
299+
```
300+
301+
Here, the two single photon sources given by `single_emitters` introduce further topological constraints on the starting
302+
graph. As they have the role of ancillary photons in this case, we need to set `num_anc` accordingly. The graph
303+
corresponding to this optimization will have a total of eight nodes. Two for incoming, two for outgoing, two for single
304+
photon sources and two for ancillary detectors.
305+
306+
If `num_anc` is larger than the sum of lengths of `in_nodes` and `single_emitters`, the necessary amount of particles is
307+
created through SPDC.
308+
309+
Additionaly `heralding_out` is set to `true` here. The photons corresponding to `out_nodes` will not be detected.
310+
311+
### Measurement
312+
313+
```json
314+
{
315+
"description": "Measurement for three particle W state",
316+
"foldername": "W_measurement",
317+
"target_state": [
318+
"001",
319+
"010",
320+
"100"
321+
],
322+
"in_nodes": [
323+
0,
324+
1,
325+
2
326+
],
327+
"num_anc": 0,
328+
"loss_func": "cr",
329+
"samples": 10,
330+
"optimizer": "L-BFGS-B",
331+
"ftol": 1e-06,
332+
"thresholds": [
333+
0.3,
334+
0.1
335+
],
336+
"tries_per_edge": 5,
337+
"edges_tried": 30
338+
}
339+
340+
```
341+
342+
## Entanglement Optimization
343+
344+
When `loss_func` is set to `"ent"`, no target state is set. Instead the optimizer maximizes the entanglement that can be
345+
achieved by a graph with the local dimensions given by `dim`.
346+
347+
```json
348+
{
349+
"description": "Maximizing entanglement in k=2 bi-partitions for four qubits.",
350+
"K": 2,
351+
"dim": 2222,
352+
"ftol": 1e-07,
353+
"loss_func": "ent",
354+
"min_edge": 4,
355+
"num_pre": 5,
356+
"optimizer": "SLSQP",
357+
"imaginary": false,
358+
"samples": 10,
359+
"thresholds": [
360+
0.000001
361+
],
362+
"tries_per_edge": 3,
363+
"var_factor": 0
364+
}
365+
```
366+
367+
## Optimizing for Arbitrary Functions of the Graph
368+
369+
There is also the option to define an arbitrary loss function, which should be defined or imported in `lossfunctions.py`
370+
.
371+
372+
Here is an example for optimizing the assembly index of the graph.
373+
374+
```json
375+
{
376+
"foldername": "assembly",
377+
"loss_func": "lff",
378+
"lff_name": "top_n_assembly",
379+
"dimensions": [
380+
2,
381+
2,
382+
2,
383+
2
384+
],
385+
"num_vertices": 4,
386+
"num_cols": 2,
387+
"size_of_graph": 8,
388+
"optimizer": "L-BFGS-B",
389+
"ftol": 1e-06,
390+
"samples": 1,
391+
"thresholds": [
392+
99999
393+
],
394+
"topopt": false,
395+
"edges_tried": 30,
396+
"tries_per_edge": 5,
397+
"unicolor": false,
398+
"imaginary": false,
399+
"num_pre": 1,
400+
"save_history": true
401+
}
402+
```
403+
404+
To use a custom defined loss function `loss_func` should be set to `"lff"` (loss from function).
405+
406+
The name of the loss function is given as a string to `lff_name`. This function should be defined or imported
407+
in `lossfunctions.py`. It should take a `Graph` object and a `cnfg` dictionary as arguments and return a real number.
408+
409+
410+
# Development
56411

57412
### Clone repository
58413

0 commit comments

Comments
 (0)