qciconnect-applib 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qciconnect/applib/__init__.py +4 -0
- qciconnect/applib/algorithm/__init__.py +26 -0
- qciconnect/applib/algorithm/imaginary_time_evolution.py +54 -0
- qciconnect/applib/algorithm/imaginary_time_evolution_params.py +30 -0
- qciconnect/applib/algorithm/optimizer/__init__.py +1 -0
- qciconnect/applib/algorithm/optimizer/scipy_optimizer.py +66 -0
- qciconnect/applib/algorithm/quench.py +35 -0
- qciconnect/applib/algorithm/quench_params.py +25 -0
- qciconnect/applib/algorithm/time_evolution.py +52 -0
- qciconnect/applib/algorithm/time_evolution_params.py +44 -0
- qciconnect/applib/algorithm/vqe.py +113 -0
- qciconnect/applib/algorithm/vqe_params.py +38 -0
- qciconnect/applib/app/__init__.py +19 -0
- qciconnect/applib/app/schemas/alf.schema.json +417 -0
- qciconnect/applib/app/schemas/runner.schema.json +28 -0
- qciconnect/applib/app/time_evolution/Dockerfile +14 -0
- qciconnect/applib/app/time_evolution/README.md +59 -0
- qciconnect/applib/app/time_evolution/__init__.py +3 -0
- qciconnect/applib/app/time_evolution/app_config.json +46 -0
- qciconnect/applib/app/time_evolution/main.py +40 -0
- qciconnect/applib/app/time_evolution/parse_input.py +79 -0
- qciconnect/applib/app/time_evolution/preview_media/time_evolution_plot.svg +1174 -0
- qciconnect/applib/app/time_evolution/thumbnail.svg +311 -0
- qciconnect/applib/app/time_evolution/write_output.py +105 -0
- qciconnect/applib/circuit/__init__.py +3 -0
- qciconnect/applib/circuit/builder/__init__.py +11 -0
- qciconnect/applib/circuit/builder/efficient_su2_ansatz_builder.py +37 -0
- qciconnect/applib/circuit/builder/imaginary_trotter_builder.py +101 -0
- qciconnect/applib/circuit/builder/imaginary_trotter_step_builder.py +95 -0
- qciconnect/applib/circuit/builder/qsp_circuit.py +48 -0
- qciconnect/applib/circuit/builder/trotter_builder.py +142 -0
- qciconnect/applib/circuit/builder/trotter_step_builder.py +35 -0
- qciconnect/applib/circuit/efficient_su2.py +19 -0
- qciconnect/applib/mitigation/__init__.py +12 -0
- qciconnect/applib/mitigation/noise_amplifier.py +43 -0
- qciconnect/applib/mitigation/postselection_sampler.py +29 -0
- qciconnect/applib/mitigation/twirled_readout_sampler.py +49 -0
- qciconnect/applib/mitigation/unitary_folding.py +73 -0
- qciconnect/applib/mitigation/zne_estimator.py +79 -0
- qciconnect/applib/problem/__init__.py +6 -0
- qciconnect/applib/problem/problem_input/__init__.py +4 -0
- qciconnect/applib/problem/problem_input/fermi_hubbard_hamiltonians.py +10 -0
- qciconnect/applib/problem/problem_input/tfi_hamiltonians.py +46 -0
- qciconnect/applib/problem/time_evolution_problem.py +12 -0
- qciconnect_applib-0.2.0.dist-info/METADATA +58 -0
- qciconnect_applib-0.2.0.dist-info/RECORD +47 -0
- qciconnect_applib-0.2.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://gitlab.dlr.de/qci-connect/partners/all/qci-connect-sdk/applib/-/tree/main/src/qciconnect/applib/apps/schemas/alf.schema.json",
|
|
4
|
+
"title": "ALF application config",
|
|
5
|
+
"description": "Use this as the schema for you app_config.json file",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["display_name", "abstract", "affiliations", "mail"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"display_name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "The name of your application. This will be shown to users when they select an application to run."
|
|
13
|
+
},
|
|
14
|
+
"abstract": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "A very short description of your application. This will be shown to users when they select an application to run."
|
|
17
|
+
},
|
|
18
|
+
"affiliations": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"description": "The affiliations / authors of this application. This will be shown to users when they select an application to run."
|
|
24
|
+
},
|
|
25
|
+
"mail": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The email address of the author of this application. This will be shown to users when they select an application to run."
|
|
28
|
+
},
|
|
29
|
+
"tags": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"description": "A list of tags that describe your application. This can be used for filtering applications when users select an application to run."
|
|
35
|
+
},
|
|
36
|
+
"allowed_qpus": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"enum": ["statevector_simulator", "sq_rt", "xq1i", "xq2i", "carina_emulator", "carina", "qsea1_digital_twin", "qsea1", "qsea2_digital_twin", "qsea2", "redac", "dinaqc", "legato", "toccata", "xaphiro", "sunqc", "dedalo", "comiqc", "kratos", "caro_cara", "qpu_priority"]
|
|
41
|
+
},
|
|
42
|
+
"description": "A list of QPU aliases that are allowed to run this application. If empty, all QPUs are allowed."
|
|
43
|
+
},
|
|
44
|
+
"$schema": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "The URL of the JSON schema that this application config adheres to."
|
|
47
|
+
},
|
|
48
|
+
"parameters": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"$ref": "#/$defs/parameter"
|
|
52
|
+
},
|
|
53
|
+
"description": "A list of parameters that can be configured for this application."
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"$defs": {
|
|
57
|
+
"parameter": {
|
|
58
|
+
"oneOf": [
|
|
59
|
+
{
|
|
60
|
+
"$ref": "#/$defs/booleanParameter"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"$ref": "#/$defs/floatParameter"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"$ref": "#/$defs/integerParameter"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"$ref": "#/$defs/stringParameter"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"$ref": "#/$defs/enumParameter"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"$ref": "#/$defs/listBooleanParameter"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"$ref": "#/$defs/listFloatParameter"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"$ref": "#/$defs/listIntegerParameter"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"$ref": "#/$defs/listStringParameter"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"$ref": "#/$defs/listEnumParameter"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"baseParameter": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"properties": {
|
|
94
|
+
"id": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "The id of the parameter. This will be used as the key for this parameter when users configure the application."
|
|
97
|
+
},
|
|
98
|
+
"display_name": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "The name of the parameter. This will be shown to users when they configure the application."
|
|
101
|
+
},
|
|
102
|
+
"tag": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "A tag that describes the type of the parameter. This can be used to determine how to show this parameter to users when they configure the application."
|
|
105
|
+
},
|
|
106
|
+
"description": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "A description of the parameter. This will be shown to users when they configure the application."
|
|
109
|
+
},
|
|
110
|
+
"required": {
|
|
111
|
+
"type": "boolean",
|
|
112
|
+
"description": "Whether this parameter is required or not. If true, users must provide a value for this parameter when they configure the application."
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"required": ["id", "display_name"]
|
|
116
|
+
},
|
|
117
|
+
"booleanParameter": {
|
|
118
|
+
"allOf": [
|
|
119
|
+
{
|
|
120
|
+
"$ref": "#/$defs/baseParameter"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"properties": {
|
|
124
|
+
"type": {
|
|
125
|
+
"const": "boolean"
|
|
126
|
+
},
|
|
127
|
+
"default": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"description": "The default value of the parameter."
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"floatParameter": {
|
|
137
|
+
"allOf": [
|
|
138
|
+
{
|
|
139
|
+
"$ref": "#/$defs/baseParameter"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"properties": {
|
|
143
|
+
"type": {
|
|
144
|
+
"const": "float"
|
|
145
|
+
},
|
|
146
|
+
"default": {
|
|
147
|
+
"type": "number",
|
|
148
|
+
"description": "The default value of the parameter."
|
|
149
|
+
},
|
|
150
|
+
"min": {
|
|
151
|
+
"type": "number",
|
|
152
|
+
"description": "The minimum value of the parameter."
|
|
153
|
+
},
|
|
154
|
+
"max": {
|
|
155
|
+
"type": "number",
|
|
156
|
+
"description": "The maximum value of the parameter."
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"integerParameter": {
|
|
164
|
+
"allOf": [
|
|
165
|
+
{
|
|
166
|
+
"$ref": "#/$defs/baseParameter"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"properties": {
|
|
170
|
+
"type": {
|
|
171
|
+
"const": "integer"
|
|
172
|
+
},
|
|
173
|
+
"default": {
|
|
174
|
+
"type": "integer",
|
|
175
|
+
"description": "The default value of the parameter."
|
|
176
|
+
},
|
|
177
|
+
"min": {
|
|
178
|
+
"type": "integer",
|
|
179
|
+
"description": "The minimum value of the parameter."
|
|
180
|
+
},
|
|
181
|
+
"max": {
|
|
182
|
+
"type": "integer",
|
|
183
|
+
"description": "The maximum value of the parameter."
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"stringParameter": {
|
|
191
|
+
"allOf": [
|
|
192
|
+
{
|
|
193
|
+
"$ref": "#/$defs/baseParameter"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"properties": {
|
|
197
|
+
"type": {
|
|
198
|
+
"const": "string"
|
|
199
|
+
},
|
|
200
|
+
"default": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"description": "The default value of the parameter."
|
|
203
|
+
},
|
|
204
|
+
"minLength": {
|
|
205
|
+
"type": "integer",
|
|
206
|
+
"description": "The minimum length of the parameter."
|
|
207
|
+
},
|
|
208
|
+
"maxLength": {
|
|
209
|
+
"type": "integer",
|
|
210
|
+
"description": "The maximum length of the parameter."
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
"enumParameter": {
|
|
218
|
+
"allOf": [
|
|
219
|
+
{
|
|
220
|
+
"$ref": "#/$defs/baseParameter"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"properties": {
|
|
224
|
+
"type": {
|
|
225
|
+
"const": "enum"
|
|
226
|
+
},
|
|
227
|
+
"default": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"description": "The default value of the parameter."
|
|
230
|
+
},
|
|
231
|
+
"options": {
|
|
232
|
+
"type": "array",
|
|
233
|
+
"items": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
},
|
|
236
|
+
"description": "The options that can be selected for this parameter."
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"required": ["type", "id", "display_name", "tag", "options"]
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
"listBooleanParameter": {
|
|
244
|
+
"allOf": [
|
|
245
|
+
{
|
|
246
|
+
"$ref": "#/$defs/baseParameter"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"properties": {
|
|
250
|
+
"type": {
|
|
251
|
+
"const": "list-boolean"
|
|
252
|
+
},
|
|
253
|
+
"default": {
|
|
254
|
+
"type": "array",
|
|
255
|
+
"items": {
|
|
256
|
+
"type": "boolean"
|
|
257
|
+
},
|
|
258
|
+
"description": "The default value of the parameter."
|
|
259
|
+
},
|
|
260
|
+
"minListLength": {
|
|
261
|
+
"type": "integer",
|
|
262
|
+
"description": "The minimum length of the list."
|
|
263
|
+
},
|
|
264
|
+
"maxListLength": {
|
|
265
|
+
"type": "integer",
|
|
266
|
+
"description": "The maximum length of the list."
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
"listFloatParameter": {
|
|
274
|
+
"allOf": [
|
|
275
|
+
{
|
|
276
|
+
"$ref": "#/$defs/baseParameter"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"properties": {
|
|
280
|
+
"type": {
|
|
281
|
+
"const": "list-float"
|
|
282
|
+
},
|
|
283
|
+
"default": {
|
|
284
|
+
"type": "array",
|
|
285
|
+
"items": {
|
|
286
|
+
"type": "number"
|
|
287
|
+
},
|
|
288
|
+
"description": "The default value of the parameter."
|
|
289
|
+
},
|
|
290
|
+
"min": {
|
|
291
|
+
"type": "number",
|
|
292
|
+
"description": "The minimum value of the parameter."
|
|
293
|
+
},
|
|
294
|
+
"max": {
|
|
295
|
+
"type": "number",
|
|
296
|
+
"description": "The maximum value of the parameter."
|
|
297
|
+
},
|
|
298
|
+
"minListLength": {
|
|
299
|
+
"type": "integer",
|
|
300
|
+
"description": "The minimum length of the list."
|
|
301
|
+
},
|
|
302
|
+
"maxListLength": {
|
|
303
|
+
"type": "integer",
|
|
304
|
+
"description": "The maximum length of the list."
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
"listIntegerParameter": {
|
|
312
|
+
"allOf": [
|
|
313
|
+
{
|
|
314
|
+
"$ref": "#/$defs/baseParameter"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"properties": {
|
|
318
|
+
"type": {
|
|
319
|
+
"const": "list-integer"
|
|
320
|
+
},
|
|
321
|
+
"default": {
|
|
322
|
+
"type": "array",
|
|
323
|
+
"items": {
|
|
324
|
+
"type": "integer"
|
|
325
|
+
},
|
|
326
|
+
"description": "The default value of the parameter."
|
|
327
|
+
},
|
|
328
|
+
"min": {
|
|
329
|
+
"type": "integer",
|
|
330
|
+
"description": "The minimum value of the parameter."
|
|
331
|
+
},
|
|
332
|
+
"max": {
|
|
333
|
+
"type": "integer",
|
|
334
|
+
"description": "The maximum value of the parameter."
|
|
335
|
+
},
|
|
336
|
+
"minListLength": {
|
|
337
|
+
"type": "integer",
|
|
338
|
+
"description": "The minimum length of the list."
|
|
339
|
+
},
|
|
340
|
+
"maxListLength": {
|
|
341
|
+
"type": "integer",
|
|
342
|
+
"description": "The maximum length of the list."
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"listStringParameter": {
|
|
350
|
+
"allOf": [
|
|
351
|
+
{
|
|
352
|
+
"$ref": "#/$defs/baseParameter"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"properties": {
|
|
356
|
+
"type": {
|
|
357
|
+
"const": "list-string"
|
|
358
|
+
},
|
|
359
|
+
"default": {
|
|
360
|
+
"type": "array",
|
|
361
|
+
"items": {
|
|
362
|
+
"type": "string"
|
|
363
|
+
},
|
|
364
|
+
"description": "The default value of the parameter."
|
|
365
|
+
},
|
|
366
|
+
"minLength": {
|
|
367
|
+
"type": "integer",
|
|
368
|
+
"description": "The minimum length of the strings."
|
|
369
|
+
},
|
|
370
|
+
"maxLength": {
|
|
371
|
+
"type": "integer",
|
|
372
|
+
"description": "The maximum length of the strings."
|
|
373
|
+
},
|
|
374
|
+
"minListLength": {
|
|
375
|
+
"type": "integer",
|
|
376
|
+
"description": "The minimum length of the list."
|
|
377
|
+
},
|
|
378
|
+
"maxListLength": {
|
|
379
|
+
"type": "integer",
|
|
380
|
+
"description": "The maximum length of the list."
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"required": ["type", "id", "display_name", "tag"]
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
"listEnumParameter": {
|
|
388
|
+
"allOf": [
|
|
389
|
+
{
|
|
390
|
+
"$ref": "#/$defs/baseParameter"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"properties": {
|
|
394
|
+
"type": {
|
|
395
|
+
"const": "list-enum"
|
|
396
|
+
},
|
|
397
|
+
"default": {
|
|
398
|
+
"type": "array",
|
|
399
|
+
"items": {
|
|
400
|
+
"type": "string"
|
|
401
|
+
},
|
|
402
|
+
"description": "The default value of the parameter."
|
|
403
|
+
},
|
|
404
|
+
"options": {
|
|
405
|
+
"type": "array",
|
|
406
|
+
"items": {
|
|
407
|
+
"type": "string"
|
|
408
|
+
},
|
|
409
|
+
"description": "The options that can be selected for this parameter."
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"required": ["type", "id", "display_name", "tag", "options"]
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parameters": [
|
|
3
|
+
{
|
|
4
|
+
"id": "qpu_alias",
|
|
5
|
+
"type": "string",
|
|
6
|
+
"display_name": "QPU Alias",
|
|
7
|
+
"description": "Alias of the QPU to be used",
|
|
8
|
+
"default": "statevector_simulator",
|
|
9
|
+
"tag": "runner"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "token",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"display_name": "Token",
|
|
15
|
+
"description": "Token to access QCI Connect",
|
|
16
|
+
"default": "",
|
|
17
|
+
"tag": "runner"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "cost_bearer",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"display_name": "Cost Bearer",
|
|
23
|
+
"description": "Cost Bearer for HPC resources",
|
|
24
|
+
"default": "",
|
|
25
|
+
"tag": "runner"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
FROM python:3.14-slim
|
|
2
|
+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
COPY . /app
|
|
6
|
+
|
|
7
|
+
RUN apt-get update && apt-get install -y --no-install-recommends git
|
|
8
|
+
RUN git submodule update --init
|
|
9
|
+
RUN uv venv
|
|
10
|
+
RUN uv sync
|
|
11
|
+
RUN apt-get purge -y --auto-remove git
|
|
12
|
+
RUN rm -rf /var/lib/apt/lists/*
|
|
13
|
+
|
|
14
|
+
CMD ["uv", "run", "python", "-m", "src.main"]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# TimeEvolutionApp
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The `TimeEvolutionApp` simulates the time evolution of a set of observables for a given Hamiltonian and initial state.
|
|
6
|
+
It returns expectation values at user-defined time points.
|
|
7
|
+
|
|
8
|
+
Internally, the application uses the `TimeEvolution` algorithm,
|
|
9
|
+
which by default uses a Trotter time evolution.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
The simulation for the Hamiltonian
|
|
15
|
+
|
|
16
|
+
$$
|
|
17
|
+
H = Z_0 + Z_1 - 0.5\, Y_0 Y_1
|
|
18
|
+
$$
|
|
19
|
+
|
|
20
|
+
and the observables
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
O_1 = \frac{1}{2}(Z_0 + Z_1)
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
$$
|
|
27
|
+
O_2 = \frac{1}{2}(X_0 + X_1)
|
|
28
|
+
$$
|
|
29
|
+
|
|
30
|
+
starting from the initial state
|
|
31
|
+
|
|
32
|
+
$$
|
|
33
|
+
|\Psi(t=0)\rangle = |X_-\rangle
|
|
34
|
+
$$
|
|
35
|
+
|
|
36
|
+
with a time grid defined by 51 time steps of length $0.03$ and measurements every 5 steps yields the time-evolution result.
|
|
37
|
+
|
|
38
|
+
### Results
|
|
39
|
+
|
|
40
|
+
The expectation values of the observables over time are:
|
|
41
|
+
|
|
42
|
+
| Time | $m_z$ (Z-magnetization) | $m_x$ (X-magnetization) |
|
|
43
|
+
|--------|------------------------|------------------------|
|
|
44
|
+
| 0.0000 | 0.0160 | -1.0000 |
|
|
45
|
+
| 0.1500 | 0.0240 | -0.9540 |
|
|
46
|
+
| 0.3000 | 0.1060 | -0.7700 |
|
|
47
|
+
| 0.4500 | 0.1780 | -0.5580 |
|
|
48
|
+
| 0.6000 | 0.2300 | -0.2280 |
|
|
49
|
+
| 0.7500 | 0.2500 | 0.0700 |
|
|
50
|
+
| 0.9000 | 0.2340 | 0.3620 |
|
|
51
|
+
| 1.0500 | 0.1960 | 0.5900 |
|
|
52
|
+
| 1.2000 | 0.1120 | 0.7420 |
|
|
53
|
+
| 1.3500 | 0.0320 | 0.8100 |
|
|
54
|
+
| 1.5000 | 0.0160 | 0.7760 |
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
The corresponding time evolution is shown below:
|
|
58
|
+
|
|
59
|
+

|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"display_name": "Time Evolution",
|
|
3
|
+
"abstract": "Trotter time evolution of selected observables.",
|
|
4
|
+
"affiliations": ["DLR-SC"],
|
|
5
|
+
"mail": "qc-software@dlr.de",
|
|
6
|
+
"tags": ["Simulation", "Time Evolution"],
|
|
7
|
+
"allowed_qpus": [],
|
|
8
|
+
"parameters": [
|
|
9
|
+
{
|
|
10
|
+
"id": "paulis",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"display_name": "Hamiltonian",
|
|
13
|
+
"description": "Hamiltonian governing the time evolution",
|
|
14
|
+
"default": "Z0 + Z1 - 0.5 Y0Y1",
|
|
15
|
+
"tag": "problem"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "time_grid",
|
|
19
|
+
"type": "list-float",
|
|
20
|
+
"display_name": "Time Grid",
|
|
21
|
+
"description": "Grid of time points to evaluate",
|
|
22
|
+
"default": [0.03, 0.06, 0.09, 0.12, 0.15, 0.18, 0.21, 0.24, 0.27, 0.3],
|
|
23
|
+
"tag": "algorithm"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "observables",
|
|
27
|
+
"type": "list-string",
|
|
28
|
+
"display_name": "Observables",
|
|
29
|
+
"description": "List of observables whose expectation values are time evolved",
|
|
30
|
+
"default": [
|
|
31
|
+
"0.5 Z0 + 0.5 Z1",
|
|
32
|
+
"0.5 X0 + 0.5 X1"
|
|
33
|
+
],
|
|
34
|
+
"tag": "algorithm"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "state_preparation",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"display_name": "State Preparation",
|
|
40
|
+
"description": "Circuit preparing initial state",
|
|
41
|
+
"default": "OPENQASM 3.0;\ninclude 'stdgates.inc';\nqubit[2] q;\nx q[0];\nh q[0];\nx q[1];\nh q[1];",
|
|
42
|
+
"tag": "algorithm"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"$schema": "../schemas/alf.schema.json"
|
|
46
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Main entry point for running the time evolution application."""
|
|
2
|
+
from qciconnect.alf.execution import Runner
|
|
3
|
+
from qciconnect.alf.problem.problem_input import Hamiltonian
|
|
4
|
+
|
|
5
|
+
from qciconnect.applib.algorithm.time_evolution import TimeEvolution
|
|
6
|
+
from qciconnect.applib.algorithm.time_evolution_params import TimeEvolutionParams
|
|
7
|
+
|
|
8
|
+
from .parse_input import parse_input_files
|
|
9
|
+
from .write_output import create_markdown, create_plots, write_raw_output
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def run_app(parameters: dict[str, dict] | None = None) -> None:
|
|
13
|
+
"""Read input, run application, and create output for web interface.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
----
|
|
17
|
+
parameters (dict[str, dict]): A dictionary containing a parameter dictionary split
|
|
18
|
+
by their tags as defined in the alf.json
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
if parameters is None:
|
|
22
|
+
parameters = parse_input_files(input_dir="inputs")
|
|
23
|
+
|
|
24
|
+
params = TimeEvolutionParams(**parameters["algorithm"])
|
|
25
|
+
problem = Hamiltonian(**parameters["problem"])
|
|
26
|
+
|
|
27
|
+
time_evolution_algorithm = TimeEvolution(
|
|
28
|
+
params=params,
|
|
29
|
+
runner=Runner(**parameters["runner"])
|
|
30
|
+
)
|
|
31
|
+
result = time_evolution_algorithm(
|
|
32
|
+
problem_input=problem
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
create_markdown(params, problem, result)
|
|
36
|
+
create_plots(params, problem, result)
|
|
37
|
+
write_raw_output(result)
|
|
38
|
+
|
|
39
|
+
if __name__ == "__main__":
|
|
40
|
+
run_app()
|