You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* added figure and text to help describe the system
* updates to figures
* separated table construction figure from ideas file
* quick tidy-up of docs
Since these files are still a work in progress, it's probably better to hide them from the user for now.
* upgraded code blocks
* fixing demo dependency
* Added timeline example to the README.
Timeline creation and management for open-loop control in AMO experiments and beyond.
4
+
Timeline creation and management for open-loop control in AMO experiments and beyond. Keep scrolling for a quick overview.
5
5
6
6
## Status
7
-
This is currently an alpha release. Usable, but subject to breaking changes.
8
-
We will release the first stable version soon.
7
+
This is currently an alpha release. Usable, but subject to breaking changes. We will release the first stable version soon.
9
8
10
9
11
10
## Optional dependencies (package `extras`)
@@ -17,4 +16,202 @@ We will release the first stable version soon.
17
16
Tests can be run from the root folder with
18
17
```bash
19
18
poetry run pytest
19
+
20
+
20
21
```
22
+
23
+
# Getting Started
24
+
25
+
1.[Abstract](#orgfb88e4f)
26
+
2.[Why not ADbasic?](#org231a69c)
27
+
3.[Why Wigner Time?](#org5e1d714)
28
+
1.[Easy (separation of concerns)](#org154d75b)
29
+
2.[’Simple’](#org2528e95)
30
+
3.[Flexible](#org1877e40)
31
+
4.[Portable](#org99c74fd)
32
+
5.[Robust](#orgb155d13)
33
+
6.[Graphical display](#org6bc654b)
34
+
4.[How it works?](#org95dac3d)
35
+
5.[Example (For ADwin systems)](#orge8cea69)
36
+
6.[Future?](#orge0a7f00)
37
+
7.[Status](#org48d7fda)
38
+
39
+
40
+
41
+
<aid="orgfb88e4f"></a>
42
+
43
+
# Abstract
44
+
45
+
We introduce Wigner Time, an approach and Python package for defining and
46
+
manipulating experimental timelines in real-time open-loop control systems.
47
+
Fundamentally, procedures are expressed functionally and implemented tabularly, such that the core timelines can be represented with in-memory databases, e.g. `pandas.DataFrame`. The associated functional-style API is clear, flexible, and integrates well with the broader scientific Python ecosystem. The package has been optimized for ADwin-based quantum-optics experiments, but is broadly applicable to any experimental domain requiring precisely timed, multi-device control.
48
+
49
+

50
+
51
+
52
+
<aid="org231a69c"></a>
53
+
54
+
# Why not ADbasic?
55
+
56
+
> **ADbasic** combines the **power and precision** of a low-level programming language with the **intuitive clarity** of a low-level programming languge.
57
+
58
+
59
+
<aid="org5e1d714"></a>
60
+
61
+
# Why Wigner Time?
62
+
63
+
64
+
<aid="org154d75b"></a>
65
+
66
+
## Easy (separation of concerns)
67
+
68
+
So much of physics is choosing the right level of abstraction.
69
+
70
+
Wigner Time allows you to use a normal and popular programming language to design your experimental timelines, while still utilizing the low-level features of other languages when you really need it.
71
+
72
+
Don’t write ADbasic unless you need to!
73
+
74
+
75
+
<aid="org2528e95"></a>
76
+
77
+
## ’Simple’
78
+
79
+
Easy tools often become complicated, but Wigner Time has been carefully designed so that all conveniences are **optional**. You can always drop down a level of abstraction to manually implement a new feature - to the point of just adding CSV tables.
80
+
81
+
82
+
<aid="org1877e40"></a>
83
+
84
+
## Flexible
85
+
86
+
By using a functional, data-oriented and bottom-up programming approach to timeline creation, Wigner Time makes it very easy to add and substract changes from the timeline and so can repsond to fast-changing lab requirements.
87
+
88
+
89
+
<aid="org99c74fd"></a>
90
+
91
+
## Portable
92
+
93
+
The essential data is always accesible and transferrable to any other language or collaborator
94
+
95
+
- even a spreadsheet!
96
+
97
+
98
+
<aid="orgb155d13"></a>
99
+
100
+
## Robust
101
+
102
+
Implemented ontop of the \`pandas\` system, the most widely-used data science package.
103
+
104
+
105
+
<aid="org6bc654b"></a>
106
+
107
+
## Graphical display
108
+
109
+
Easily generate and investigate your timeline.
110
+
111
+
112
+
<aid="org95dac3d"></a>
113
+
114
+
# How it works?
115
+
116
+
Wigner Time is based around the idea of a ’timeline’, which is, at heart, simply a table of rows and columns. The columns detail ’parameters’, e.g. ’variable’ (the name of a quantity), ’time’, ’value’, ’context’ (a concise description of a real-world situation, e.g. ’OpticalTrap’ )
117
+
118
+
- Add more parameters by adding columns
119
+
- Add more operations by adding rows
120
+
121
+
By boiling the design down to a ’table’ as the foundation, then we can benfit from decades of database development, particularly in-memory database-like systems like \`pandas\`. Therefore, when in doubt, the user can simply manipulate their timeline using the well-developed \`pandas\` ecosystem. For most operations however, even this won’t be necessary as wigner<sub>time</sub> provides layers of conveninece functions ontop of this for designing open-loop experiments.
122
+
123
+
124
+
<aid="orge8cea69"></a>
125
+
126
+
# Example (For ADwin systems)
127
+
128
+
You want to digitally control an optical shutter and AOM.
129
+
130
+
For digital channels, simply *name* the ADwin ports using standard Python lists. These keep track of the physical connections.
131
+
132
+
```python
133
+
from wigner_time.adwin import connection as adcon
134
+
from wigner_time import device
135
+
from wigner_time import conversion as conv
136
+
137
+
connections = adcon.new(
138
+
["shutter_MOT", 1, 11],
139
+
["AOM_MOT", 1, 1])
140
+
```
141
+
For analogue connections, do the same, but specify a linear factor, conversion function or calibration file.
142
+
143
+
```python
144
+
devices = device.new(
145
+
["lockbox_MOT__MHz", 0.05, -200, 200],
146
+
[
147
+
"AOM_MOT__transmission",
148
+
conv.function_from_file(
149
+
"resources/calibration/aom_calibration.dat",
150
+
sep=r"\s+",
151
+
),
152
+
0.0,
153
+
1.0,
154
+
],
155
+
)
156
+
```
157
+
Specify how you want your experiment to begin and end, using readable options and user-specific keywords.
158
+
159
+
N.B. The use of *pandas.DataFrame* for convenient edits.
160
+
161
+
```python
162
+
import timeline as tl
163
+
164
+
initial = tl.create(
165
+
t=1e-6,
166
+
context="ADwin_LowInit",
167
+
168
+
shutter_MOT=1
169
+
AOM_MOT=0,
170
+
)
171
+
final = init
172
+
final['context']="ADwin_Finish"
173
+
```
174
+
175
+
And any key processes…
176
+
177
+
```python
178
+
MOT= tl.update(
179
+
shutter_MOT=0
180
+
AOM_MOT=1,
181
+
context="MOT",
182
+
)
183
+
detuned_growth = tl.ramp(
184
+
lockbox_MOT__MHz=-5,
185
+
duration=10e-3,
186
+
),
187
+
```
188
+
Then combine it all together in readable and modular fashion.
189
+
190
+
Due to the (hopefully) sensible defaults, each component, e.g. \`ramp\`, will automatically join onto the end of the previous operation in a causal chain.
191
+
192
+
```python
193
+
tline = tl.stack(
194
+
initial,
195
+
MOT,
196
+
detuned_growth,
197
+
final
198
+
)
199
+
200
+
```
201
+
202
+
203
+
The timeline can then be exported to an ADwin-compatible format.
0 commit comments