qcs-sdk-python 0.26.0__cp313-cp313-win_amd64.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.
Files changed (36) hide show
  1. README-py.md +111 -0
  2. THIRDPARTY.yaml +40894 -0
  3. qcs_sdk/__init__.py +23 -0
  4. qcs_sdk/__init__.pyi +441 -0
  5. qcs_sdk/_qcs_sdk.cp313-win_amd64.pyd +0 -0
  6. qcs_sdk/_tracing_subscriber/.stubtest-allowlist +7 -0
  7. qcs_sdk/_tracing_subscriber/__init__.py +17 -0
  8. qcs_sdk/_tracing_subscriber/__init__.pyi +131 -0
  9. qcs_sdk/_tracing_subscriber/common/__init__.py +18 -0
  10. qcs_sdk/_tracing_subscriber/common/__init__.pyi +46 -0
  11. qcs_sdk/_tracing_subscriber/layers/__init__.py +18 -0
  12. qcs_sdk/_tracing_subscriber/layers/__init__.pyi +30 -0
  13. qcs_sdk/_tracing_subscriber/layers/file/__init__.py +19 -0
  14. qcs_sdk/_tracing_subscriber/layers/file/__init__.pyi +42 -0
  15. qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.py +18 -0
  16. qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi +118 -0
  17. qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.py +18 -0
  18. qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi +38 -0
  19. qcs_sdk/_tracing_subscriber/subscriber/__init__.py +18 -0
  20. qcs_sdk/_tracing_subscriber/subscriber/__init__.pyi +25 -0
  21. qcs_sdk/client.pyi +124 -0
  22. qcs_sdk/compiler/__init__.pyi +5 -0
  23. qcs_sdk/compiler/quilc.pyi +316 -0
  24. qcs_sdk/diagnostics.pyi +36 -0
  25. qcs_sdk/qpu/__init__.pyi +216 -0
  26. qcs_sdk/qpu/api.pyi +484 -0
  27. qcs_sdk/qpu/experimental/__init__.pyi +5 -0
  28. qcs_sdk/qpu/experimental/random.pyi +98 -0
  29. qcs_sdk/qpu/isa.pyi +472 -0
  30. qcs_sdk/qpu/translation.pyi +180 -0
  31. qcs_sdk/qvm/__init__.pyi +162 -0
  32. qcs_sdk/qvm/api.pyi +236 -0
  33. qcs_sdk_python-0.26.0.dist-info/METADATA +130 -0
  34. qcs_sdk_python-0.26.0.dist-info/RECORD +36 -0
  35. qcs_sdk_python-0.26.0.dist-info/WHEEL +4 -0
  36. qcs_sdk_python-0.26.0.dist-info/sboms/qcs.cyclonedx.json +19204 -0
qcs_sdk/qpu/isa.pyi ADDED
@@ -0,0 +1,472 @@
1
+ # This file is automatically generated by pyo3_stub_gen
2
+ # ruff: noqa: E501, F401
3
+
4
+ import builtins
5
+ import collections.abc
6
+ import enum
7
+ import typing
8
+ from qcs_sdk import QcsSdkError
9
+ from qcs_sdk.client import QCSClient
10
+
11
+ @typing.final
12
+ class Architecture:
13
+ r"""
14
+ Represents the logical underlying architecture of a quantum processor.
15
+
16
+ The architecture is defined in detail by the nodes and edges that constitute the quantum
17
+ processor. This defines the set of all nodes that could be operated upon, and indicates to
18
+ some approximation their physical layout. The main purpose of this is to support geometry
19
+ calculations that are independent of the available operations, and rendering ISA-based
20
+ information. Architecture layouts are defined by the `family`, as follows.
21
+
22
+ The "Aspen" family of quantum processor indicates a 2D planar grid layout of octagon unit
23
+ cells. The `node_id` in this architecture is computed as :math:`100 p_y + 10 p_x + p_u` where
24
+ :math:`p_y` is the zero-based Y position in the unit cell grid, :math:`p_x` is the zero-based
25
+ X position in the unit cell grid, and :math:`p_u` is the zero-based position in the octagon
26
+ unit cell and always ranges from 0 to 7.
27
+
28
+ The "Ankaa" architecture is based on a grid topology; having, in "vertical" orientation,
29
+ qubits numbered starting from 0 at the top-left and increasing from left to right,
30
+ then top to bottom, so the final qubit is in the bottom-right. Each qubit is connected
31
+ with a tunable coupler to their direct vertical and horizontal neighbors, producing an edge.
32
+ Edges are ordered top-left to bottom-right in this orientation as well, with horizontal rows
33
+ alternating with vertical rows. Ankaa chips are, in vertical orientation,
34
+ 7 qubits wide and 12 tall. This architecture may also be presented in "landscape"
35
+ orientation, which is a simple 90-degree clockwise rotation of the vertical orientation.
36
+
37
+ Note that the operations that are actually available are defined entirely by ``Operation``
38
+ instances. The presence of a node or edge in the ``Architecture`` model provides no guarantee
39
+ that any 1Q or 2Q operation will be available to users writing QUIL programs.
40
+ """
41
+ @property
42
+ def edges(self) -> builtins.list[Edge]:
43
+ r"""
44
+ A list of all computational edges in the instruction set architecture.
45
+ """
46
+ @edges.setter
47
+ def edges(self, value: builtins.list[Edge]) -> None:
48
+ r"""
49
+ A list of all computational edges in the instruction set architecture.
50
+ """
51
+ @property
52
+ def family(self) -> typing.Optional[Family | builtins.str]:
53
+ r"""
54
+ The architecture family. The nodes and edges conform to this family.
55
+ """
56
+ @family.setter
57
+ def family(self, value: typing.Optional[Family | builtins.str]) -> None:
58
+ r"""
59
+ The architecture family. The nodes and edges conform to this family.
60
+ """
61
+ @property
62
+ def nodes(self) -> builtins.list[Node]:
63
+ r"""
64
+ A list of all computational nodes in the instruction set architecture.
65
+ """
66
+ @nodes.setter
67
+ def nodes(self, value: builtins.list[Node]) -> None:
68
+ r"""
69
+ A list of all computational nodes in the instruction set architecture.
70
+ """
71
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
72
+ def __new__(cls, edges: typing.Sequence[Edge], family: typing.Optional[Family | builtins.str], nodes: typing.Sequence[Node]) -> Architecture: ...
73
+ def __repr__(self) -> builtins.str:
74
+ r"""
75
+ Implements `__repr__` for Python in terms of the Rust
76
+ [`Debug`](std::fmt::Debug) implementation.
77
+ """
78
+
79
+ @typing.final
80
+ class Characteristic:
81
+ r"""
82
+ A measured characteristic of an operation.
83
+ """
84
+ @property
85
+ def error(self) -> typing.Optional[builtins.float]:
86
+ r"""
87
+ The error in the characteristic value, or None otherwise.
88
+ """
89
+ @error.setter
90
+ def error(self, value: typing.Optional[builtins.float]) -> None:
91
+ r"""
92
+ The error in the characteristic value, or None otherwise.
93
+ """
94
+ @property
95
+ def name(self) -> builtins.str:
96
+ r"""
97
+ The name of the characteristic.
98
+ """
99
+ @name.setter
100
+ def name(self, value: builtins.str) -> None:
101
+ r"""
102
+ The name of the characteristic.
103
+ """
104
+ @property
105
+ def node_ids(self) -> typing.Optional[builtins.list[builtins.int]]:
106
+ r"""
107
+ The list of architecture node ids for the site where the characteristic is measured, if that is different from the site of the enclosing operation. None if it is the same. The order of this or the enclosing node ids obey the definition of node symmetry from the enclosing operation.
108
+ """
109
+ @node_ids.setter
110
+ def node_ids(self, value: typing.Optional[builtins.list[builtins.int]]) -> None:
111
+ r"""
112
+ The list of architecture node ids for the site where the characteristic is measured, if that is different from the site of the enclosing operation. None if it is the same. The order of this or the enclosing node ids obey the definition of node symmetry from the enclosing operation.
113
+ """
114
+ @property
115
+ def parameter_values(self) -> typing.Optional[builtins.list[builtins.float]]:
116
+ r"""
117
+ The optional ordered list of parameter values used to generate the characteristic. The order matches the parameters in the enclosing operation, and so the lengths of these two lists must match.
118
+ """
119
+ @parameter_values.setter
120
+ def parameter_values(self, value: typing.Optional[builtins.list[builtins.float]]) -> None:
121
+ r"""
122
+ The optional ordered list of parameter values used to generate the characteristic. The order matches the parameters in the enclosing operation, and so the lengths of these two lists must match.
123
+ """
124
+ @property
125
+ def timestamp(self) -> builtins.str:
126
+ r"""
127
+ The date and time at which the characteristic was measured.
128
+ """
129
+ @timestamp.setter
130
+ def timestamp(self, value: builtins.str) -> None:
131
+ r"""
132
+ The date and time at which the characteristic was measured.
133
+ """
134
+ @property
135
+ def value(self) -> builtins.float:
136
+ r"""
137
+ The characteristic value measured.
138
+ """
139
+ @value.setter
140
+ def value(self, value: builtins.float) -> None:
141
+ r"""
142
+ The characteristic value measured.
143
+ """
144
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
145
+ def __new__(cls, name: builtins.str, timestamp: builtins.str, value: builtins.float) -> Characteristic:
146
+ r"""
147
+ A measured characteristic of an operation.
148
+ """
149
+ def __repr__(self) -> builtins.str:
150
+ r"""
151
+ Implements `__repr__` for Python in terms of the Rust
152
+ [`Debug`](std::fmt::Debug) implementation.
153
+ """
154
+
155
+ @typing.final
156
+ class Edge:
157
+ r"""
158
+ A degree-two logical connection in the quantum processor's architecture.
159
+
160
+ The existence of an edge in the ISA ``Architecture`` does not necessarily mean that a given 2Q
161
+ operation will be available on the edge. This information is conveyed by the presence of the
162
+ two `node_id` values in instances of ``Instruction``.
163
+
164
+ Note that edges are undirected in this model. Thus edge :math:`(a, b)` is equivalent to edge
165
+ :math:`(b, a)`.
166
+ """
167
+ @property
168
+ def node_ids(self) -> builtins.list[builtins.int]:
169
+ r"""
170
+ The integer ids of the computational nodes at the two ends of the edge.
171
+ Order is not important; an architecture edge is treated as undirected.
172
+ """
173
+ @node_ids.setter
174
+ def node_ids(self, value: builtins.list[builtins.int]) -> None:
175
+ r"""
176
+ The integer ids of the computational nodes at the two ends of the edge.
177
+ Order is not important; an architecture edge is treated as undirected.
178
+ """
179
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
180
+ def __new__(cls, node_ids: typing.Sequence[builtins.int]) -> Edge: ...
181
+ def __repr__(self) -> builtins.str:
182
+ r"""
183
+ Implements `__repr__` for Python in terms of the Rust
184
+ [`Debug`](std::fmt::Debug) implementation.
185
+ """
186
+
187
+ class GetISAError(QcsSdkError):
188
+ r"""
189
+ Errors raised due to failure to get an ISA.
190
+ """
191
+ ...
192
+
193
+ @typing.final
194
+ class InstructionSetArchitecture:
195
+ r"""
196
+ The native instruction set architecture (ISA) of a quantum processor, annotated with characteristics.
197
+
198
+ The operations described by the `instructions` field are named by their QUIL instruction name,
199
+ while the operation described by the `benchmarks` field are named by their benchmark routine
200
+ and are a future extension point.
201
+
202
+ The characteristics that annotate both instructions and benchmarks assist the user to generate
203
+ the best native QUIL program for a desired task, and so are provided as part of the native ISA.
204
+ """
205
+ @property
206
+ def architecture(self) -> Architecture: ...
207
+ @architecture.setter
208
+ def architecture(self, value: Architecture) -> None: ...
209
+ @property
210
+ def benchmarks(self) -> builtins.list[Operation]:
211
+ r"""
212
+ The list of benchmarks that have characterized the quantum processor.
213
+ """
214
+ @benchmarks.setter
215
+ def benchmarks(self, value: builtins.list[Operation]) -> None:
216
+ r"""
217
+ The list of benchmarks that have characterized the quantum processor.
218
+ """
219
+ @property
220
+ def instructions(self) -> builtins.list[Operation]:
221
+ r"""
222
+ The list of native QUIL instructions supported by the quantum processor.
223
+ """
224
+ @instructions.setter
225
+ def instructions(self, value: builtins.list[Operation]) -> None:
226
+ r"""
227
+ The list of native QUIL instructions supported by the quantum processor.
228
+ """
229
+ @property
230
+ def name(self) -> builtins.str:
231
+ r"""
232
+ The name of the quantum processor.
233
+ """
234
+ @name.setter
235
+ def name(self, value: builtins.str) -> None:
236
+ r"""
237
+ The name of the quantum processor.
238
+ """
239
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
240
+ def __new__(cls, architecture: Architecture, benchmarks: typing.Sequence[Operation], instructions: typing.Sequence[Operation], name: builtins.str) -> InstructionSetArchitecture: ...
241
+ def __repr__(self) -> builtins.str:
242
+ r"""
243
+ Implements `__repr__` for Python in terms of the Rust
244
+ [`Debug`](std::fmt::Debug) implementation.
245
+ """
246
+ @staticmethod
247
+ def from_raw(json: builtins.str) -> InstructionSetArchitecture:
248
+ r"""
249
+ Deserialize an `InstructionSetArchitecture` from a json representation.
250
+
251
+ # Errors
252
+
253
+ Returns [`SerializeIsaError`] if the input string was not deserialized correctly.
254
+ """
255
+ def json(self, pretty: builtins.bool = False) -> builtins.str:
256
+ r"""
257
+ Serialize the `InstructionSetArchitecture` to a json string, optionally pretty-printed.
258
+
259
+ If `pretty` is true, the json output should be pretty-printed with newlines and indents.
260
+
261
+ # Errors
262
+
263
+ Returns [`SerializeIsaError`] if the ISA could not be serialized.
264
+ """
265
+
266
+ @typing.final
267
+ class Node:
268
+ r"""
269
+ A logical node in the quantum processor's architecture.
270
+
271
+ The existence of a node in the ISA ``Architecture`` does not necessarily mean that a given 1Q
272
+ operation will be available on the node. This information is conveyed by the presence of the
273
+ specific `node_id` in instances of ``Instruction``.
274
+ """
275
+ @property
276
+ def node_id(self) -> builtins.int:
277
+ r"""
278
+ An integer id assigned to the computational node.
279
+
280
+ The ids may not be contiguous and will be assigned based on the architecture family.
281
+ """
282
+ @node_id.setter
283
+ def node_id(self, value: builtins.int) -> None:
284
+ r"""
285
+ An integer id assigned to the computational node.
286
+
287
+ The ids may not be contiguous and will be assigned based on the architecture family.
288
+ """
289
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
290
+ def __new__(cls, node_id: builtins.int) -> Node: ...
291
+ def __repr__(self) -> builtins.str:
292
+ r"""
293
+ Implements `__repr__` for Python in terms of the Rust
294
+ [`Debug`](std::fmt::Debug) implementation.
295
+ """
296
+
297
+ @typing.final
298
+ class Operation:
299
+ r"""
300
+ An operation, with its sites and site-independent characteristics.
301
+ """
302
+ @property
303
+ def characteristics(self) -> builtins.list[Characteristic]:
304
+ r"""
305
+ The list of site-independent characteristics of this operation.
306
+ """
307
+ @characteristics.setter
308
+ def characteristics(self, value: builtins.list[Characteristic]) -> None:
309
+ r"""
310
+ The list of site-independent characteristics of this operation.
311
+ """
312
+ @property
313
+ def name(self) -> builtins.str:
314
+ r"""
315
+ The name of the operation.
316
+ """
317
+ @name.setter
318
+ def name(self, value: builtins.str) -> None:
319
+ r"""
320
+ The name of the operation.
321
+ """
322
+ @property
323
+ def node_count(self) -> typing.Optional[builtins.int]:
324
+ r"""
325
+ The number of nodes that this operation applies to. None if unspecified.
326
+ """
327
+ @node_count.setter
328
+ def node_count(self, value: typing.Optional[builtins.int]) -> None:
329
+ r"""
330
+ The number of nodes that this operation applies to. None if unspecified.
331
+ """
332
+ @property
333
+ def parameters(self) -> builtins.list[Parameter]:
334
+ r"""
335
+ The list of parameters. Each parameter must be uniquely named. May be empty.
336
+ """
337
+ @parameters.setter
338
+ def parameters(self, value: builtins.list[Parameter]) -> None:
339
+ r"""
340
+ The list of parameters. Each parameter must be uniquely named. May be empty.
341
+ """
342
+ @property
343
+ def sites(self) -> builtins.list[OperationSite]:
344
+ r"""
345
+ The list of sites at which this operation can be applied, together with its site-dependent characteristics.
346
+ """
347
+ @sites.setter
348
+ def sites(self, value: builtins.list[OperationSite]) -> None:
349
+ r"""
350
+ The list of sites at which this operation can be applied, together with its site-dependent characteristics.
351
+ """
352
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
353
+ def __new__(cls, characteristics: typing.Sequence[Characteristic], name: builtins.str, parameters: typing.Sequence[Parameter], sites: typing.Sequence[OperationSite]) -> Operation:
354
+ r"""
355
+ An operation, with its sites and site-independent characteristics.
356
+ """
357
+ def __repr__(self) -> builtins.str:
358
+ r"""
359
+ Implements `__repr__` for Python in terms of the Rust
360
+ [`Debug`](std::fmt::Debug) implementation.
361
+ """
362
+
363
+ @typing.final
364
+ class OperationSite:
365
+ r"""
366
+ A site for an operation, with its site-dependent characteristics.
367
+ """
368
+ @property
369
+ def characteristics(self) -> builtins.list[Characteristic]:
370
+ r"""
371
+ The list of site-dependent characteristics of this operation.
372
+ """
373
+ @characteristics.setter
374
+ def characteristics(self, value: builtins.list[Characteristic]) -> None:
375
+ r"""
376
+ The list of site-dependent characteristics of this operation.
377
+ """
378
+ @property
379
+ def node_ids(self) -> builtins.list[builtins.int]:
380
+ r"""
381
+ The list of architecture node ids for the site.
382
+
383
+ The order of these node ids obey the definition of node symmetry from the enclosing operation.
384
+ """
385
+ @node_ids.setter
386
+ def node_ids(self, value: builtins.list[builtins.int]) -> None:
387
+ r"""
388
+ The list of architecture node ids for the site.
389
+
390
+ The order of these node ids obey the definition of node symmetry from the enclosing operation.
391
+ """
392
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
393
+ def __new__(cls, characteristics: typing.Sequence[Characteristic], node_ids: typing.Sequence[builtins.int]) -> OperationSite:
394
+ r"""
395
+ A site for an operation, with its site-dependent characteristics.
396
+ """
397
+ def __repr__(self) -> builtins.str:
398
+ r"""
399
+ Implements `__repr__` for Python in terms of the Rust
400
+ [`Debug`](std::fmt::Debug) implementation.
401
+ """
402
+
403
+ @typing.final
404
+ class Parameter:
405
+ r"""
406
+ A parameter to an operation.
407
+ """
408
+ @property
409
+ def name(self) -> builtins.str:
410
+ r"""
411
+ The name of the parameter, such as the name of a mathematical symbol.
412
+ """
413
+ @name.setter
414
+ def name(self, value: builtins.str) -> None:
415
+ r"""
416
+ The name of the parameter, such as the name of a mathematical symbol.
417
+ """
418
+ def __eq__(self, other: builtins.object) -> builtins.bool: ...
419
+ def __new__(cls, name: builtins.str) -> Parameter: ...
420
+ def __repr__(self) -> builtins.str:
421
+ r"""
422
+ Implements `__repr__` for Python in terms of the Rust
423
+ [`Debug`](std::fmt::Debug) implementation.
424
+ """
425
+
426
+ class SerializeISAError(QcsSdkError):
427
+ r"""
428
+ Errors raised due to failure to serialize an ISA.
429
+ """
430
+ ...
431
+
432
+ @typing.final
433
+ class Family(enum.Enum):
434
+ r"""
435
+ The architecture family identifier of an ``InstructionSetArchitecture``.
436
+
437
+ Value 'NONE' implies the architecture has no specific layout topology.
438
+ Value 'FULL' implies that each node is connected to every other (a fully-connected architecture).
439
+ For other values based on deployed architecture layouts (e.g. `Aspen` and `Ankaa`),
440
+ refer to the architecture classes themselves for more details.
441
+
442
+ Note: Within an ``InstructionSetArchitecture``, the `family` may be one of these,
443
+ or may be a `str` for an unknown family, or may be `None` if the `family` is not specified.
444
+ The latter in particular is distinct from the `NONE` value within this enumeration.
445
+ """
446
+ NONE = ...
447
+ FULL = ...
448
+ ASPEN = ...
449
+ ANKAA = ...
450
+
451
+ def get_instruction_set_architecture(quantum_processor_id: builtins.str, client: typing.Optional[QCSClient] = None) -> InstructionSetArchitecture:
452
+ r"""
453
+ Fetch the ``InstructionSetArchitecture`` (ISA) for a given `quantum_processor_id` from the QCS API.
454
+
455
+ :param quantum_processor_id: The ID of the quantum processor.
456
+ :param client: The ``Qcs`` client to use. Creates one using environment configuration if unset - see https://docs.rigetti.com/qcs/references/qcs-client-configuration
457
+
458
+ :raises LoadClientError: If ``client`` was not provided to the function, and failed to load internally.
459
+ :raises GetISAError: If there was an issue fetching the ISA from the QCS API.
460
+ """
461
+
462
+ def get_instruction_set_architecture_async(quantum_processor_id: builtins.str, client: typing.Optional[QCSClient] = None) -> collections.abc.Awaitable[InstructionSetArchitecture]:
463
+ r"""
464
+ Fetch the ``InstructionSetArchitecture`` (ISA) for a given `quantum_processor_id` from the QCS API.
465
+
466
+ :param quantum_processor_id: The ID of the quantum processor.
467
+ :param client: The ``Qcs`` client to use. Creates one using environment configuration if unset - see https://docs.rigetti.com/qcs/references/qcs-client-configuration
468
+
469
+ :raises LoadClientError: If ``client`` was not provided to the function, and failed to load internally.
470
+ :raises GetISAError: If there was an issue fetching the ISA from the QCS API.
471
+ """
472
+
@@ -0,0 +1,180 @@
1
+ # This file is automatically generated by pyo3_stub_gen
2
+ # ruff: noqa: E501, F401
3
+
4
+ import builtins
5
+ import collections.abc
6
+ import enum
7
+ import typing
8
+ from qcs_sdk import QcsSdkError
9
+ from qcs_sdk.client import QCSClient
10
+
11
+ @typing.final
12
+ class QCtrl:
13
+ r"""
14
+ Options for compiling programs through the Q-CTRL API.
15
+
16
+ Options here are specially authorized and are not generally available to the client.
17
+ """
18
+ def __new__(cls, fixed_layout: typing.Optional[builtins.bool] = None) -> QCtrl: ...
19
+
20
+ @typing.final
21
+ class Riverlane:
22
+ r"""
23
+ Options for configuring Riverlane features prior to execution.
24
+
25
+ Options here are specially authorized and are not generally available to the client.
26
+ """
27
+ def __new__(cls, qeci_configuration_data: typing.Mapping[builtins.str, typing.Sequence[builtins.int]], qeci_max_nanoseconds_until_read_available: builtins.int) -> Riverlane: ...
28
+
29
+ class TranslationError(QcsSdkError):
30
+ r"""
31
+ Errors raised due to failure to translate a program.
32
+ """
33
+ ...
34
+
35
+ @typing.final
36
+ class TranslationOptions:
37
+ r"""
38
+ Options available for Quil program translation.
39
+
40
+ This wraps [`ApiTranslationOptions`] in order to improve the user experience,
41
+ because the structs auto-generated by `prost` can be clumsy to use directly.
42
+ """
43
+ @property
44
+ def backend(self) -> typing.Optional[TranslationBackend]:
45
+ r"""
46
+ Get the backend used for translation
47
+ """
48
+ def __new__(cls) -> TranslationOptions: ...
49
+ def __repr__(self) -> builtins.str:
50
+ r"""
51
+ Implements `__repr__` for Python in terms of the Rust
52
+ [`Debug`](std::fmt::Debug) implementation.
53
+ """
54
+ def encode_as_protobuf(self) -> bytes:
55
+ r"""
56
+ Serialize these translation options into the Protocol Buffer format.
57
+ """
58
+ def use_backend_v1(self) -> None:
59
+ r"""
60
+ Use the first-generation translation backend available on QCS since 2018.
61
+ """
62
+ def use_backend_v2(self) -> None:
63
+ r"""
64
+ Use the second-generation translation backend available on QCS since 2023.
65
+ """
66
+ def use_q_ctrl(self, q_ctrl: typing.Optional[QCtrl] = None) -> None:
67
+ r"""
68
+ Compile the program through Q-CTRL's API prior to translation.
69
+
70
+ The client should generally leave the `q_ctrl` compile options unset
71
+ as it is specially authorized and not generally available.
72
+ """
73
+ def use_riverlane(self, riverlane: Riverlane = ...) -> None:
74
+ r"""
75
+ Configure Riverlane features prior to execution.
76
+
77
+ Options here are specially authorized and are not generally available to the client.
78
+ """
79
+ @staticmethod
80
+ def v1() -> TranslationOptions:
81
+ r"""
82
+ Use the v1 backend for translation, available on QCS since 2018.
83
+ """
84
+ @staticmethod
85
+ def v2(*, prepend_default_calibrations: typing.Optional[builtins.bool] = None, passive_reset_delay_seconds: typing.Optional[builtins.float] = None, allow_unchecked_pointer_arithmetic: typing.Optional[builtins.bool] = None, allow_frame_redefinition: typing.Optional[builtins.bool] = None) -> TranslationOptions:
86
+ r"""
87
+ Use the v2 backend for translation, available on QCS since 2023.
88
+
89
+ :param `prepend_default_calibrations`: If False, do not prepend the default calibrations to the translated program.
90
+ :param `passive_reset_delay_seconds`: The delay between passive resets, in seconds.
91
+ :param `allow_unchecked_pointer_arithmetic`: If True, disable runtime memory bounds checking. Only available to certain users.
92
+ :param `allow_frame_redefinition`: If True, allow defined frames to differ from Rigetti defaults. Only available to certain users. Otherwise, only ``INITIAL-FREQUENCY`` and ``CHANNEL-DELAY`` may be modified.
93
+ """
94
+
95
+ @typing.final
96
+ class TranslationResult:
97
+ r"""
98
+ The result of a call to [`translate`] which provides information about the translated program.
99
+ """
100
+ @property
101
+ def program(self) -> builtins.str:
102
+ r"""
103
+ The translated program.
104
+ """
105
+ @property
106
+ def ro_sources(self) -> typing.Optional[builtins.dict[builtins.str, builtins.str]]:
107
+ r"""
108
+ A mapping from the program's memory references to the key used to index the results map.
109
+ """
110
+
111
+ @typing.final
112
+ class TranslationBackend(enum.Enum):
113
+ r"""
114
+ The backend used for translation.
115
+ """
116
+ V1 = ...
117
+ r"""
118
+ The first-generation translation backend available on QCS since 2018.
119
+ """
120
+ V2 = ...
121
+ r"""
122
+ The second-generation translation backend available on QCS since 2023.
123
+ """
124
+
125
+ def get_quilt_calibrations(quantum_processor_id: builtins.str, client: typing.Optional[QCSClient] = None, timeout: typing.Optional[builtins.float] = None) -> builtins.str:
126
+ r"""
127
+ Retrieve the calibration data used for client-side Quil-T generation.
128
+
129
+ :param `quantum_processor_id`: The ID of the quantum processor.
130
+ :param `client`: The ``Qcs`` client to use. Creates one using environment configuration if unset - see https://docs.rigetti.com/qcs/references/qcs-client-configuration
131
+ :param `timeout`: Maximum duration to wait for API calls to complete, in seconds. Defaults to 10 seconds.
132
+
133
+ :returns: The Quil calibration program for the requested quantum processor.
134
+
135
+ :raises `LoadClientError`: If there is an issue loading the QCS Client configuration.
136
+ :raises `TranslationError`: If there was a problem fetching Quil-T calibrations.
137
+ """
138
+
139
+ def get_quilt_calibrations_async(quantum_processor_id: builtins.str, client: typing.Optional[QCSClient] = None, timeout: typing.Optional[builtins.float] = None) -> collections.abc.Awaitable[builtins.str]:
140
+ r"""
141
+ Retrieve the calibration data used for client-side Quil-T generation.
142
+
143
+ :param `quantum_processor_id`: The ID of the quantum processor.
144
+ :param `client`: The ``Qcs`` client to use. Creates one using environment configuration if unset - see https://docs.rigetti.com/qcs/references/qcs-client-configuration
145
+ :param `timeout`: Maximum duration to wait for API calls to complete, in seconds. Defaults to 10 seconds.
146
+
147
+ :returns: The Quil calibration program for the requested quantum processor.
148
+
149
+ :raises `LoadClientError`: If there is an issue loading the QCS Client configuration.
150
+ :raises `TranslationError`: If there was a problem fetching Quil-T calibrations.
151
+ """
152
+
153
+ def translate(native_quil: builtins.str, num_shots: builtins.int, quantum_processor_id: builtins.str, client: typing.Optional[QCSClient] = None, translation_options: typing.Optional[TranslationOptions] = None) -> TranslationResult:
154
+ r"""
155
+ Translates a native Quil program into an executable program.
156
+
157
+ :param `native_quil`: A Quil program.
158
+ :param `num_shots`: The number of shots to perform.
159
+ :param `quantum_processor_id`: The ID of the quantum processor the executable will run on (e.g. "Aspen-M-2").
160
+ :param `client`: The ``Qcs`` client to use. Creates one using environment configuration if unset - see https://docs.rigetti.com/qcs/references/qcs-client-configuration
161
+ :param `translation_options`: Optional translation options.
162
+
163
+ :raises `LoadClientError`: If there is an issue loading the QCS Client configuration.
164
+ :raises `TranslationError`: If the `native_quil` program could not be translated.
165
+ """
166
+
167
+ def translate_async(native_quil: builtins.str, num_shots: builtins.int, quantum_processor_id: builtins.str, client: typing.Optional[QCSClient] = None, translation_options: typing.Optional[TranslationOptions] = None) -> collections.abc.Awaitable[TranslationResult]:
168
+ r"""
169
+ Translates a native Quil program into an executable program.
170
+
171
+ :param `native_quil`: A Quil program.
172
+ :param `num_shots`: The number of shots to perform.
173
+ :param `quantum_processor_id`: The ID of the quantum processor the executable will run on (e.g. "Aspen-M-2").
174
+ :param `client`: The ``Qcs`` client to use. Creates one using environment configuration if unset - see https://docs.rigetti.com/qcs/references/qcs-client-configuration
175
+ :param `translation_options`: Optional translation options.
176
+
177
+ :raises `LoadClientError`: If there is an issue loading the QCS Client configuration.
178
+ :raises `TranslationError`: If the `native_quil` program could not be translated.
179
+ """
180
+