classiq 0.54.0__py3-none-any.whl → 0.56.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.
Files changed (56) hide show
  1. classiq/interface/_version.py +1 -1
  2. classiq/interface/debug_info/debug_info.py +11 -0
  3. classiq/interface/executor/result.py +0 -3
  4. classiq/interface/generator/functions/builtins/internal_operators.py +9 -1
  5. classiq/interface/generator/generated_circuit_data.py +0 -1
  6. classiq/interface/generator/model/preferences/preferences.py +4 -0
  7. classiq/interface/generator/types/compilation_metadata.py +5 -0
  8. classiq/interface/generator/visitor.py +13 -1
  9. classiq/interface/ide/visual_model.py +5 -1
  10. classiq/interface/interface_version.py +1 -1
  11. classiq/interface/model/control.py +22 -1
  12. classiq/interface/model/handle_binding.py +28 -0
  13. classiq/interface/model/model.py +4 -0
  14. classiq/interface/model/native_function_definition.py +1 -1
  15. classiq/interface/model/quantum_expressions/arithmetic_operation.py +2 -26
  16. classiq/interface/model/quantum_statement.py +6 -0
  17. classiq/model_expansions/capturing/mangling_utils.py +22 -0
  18. classiq/model_expansions/capturing/propagated_var_stack.py +36 -25
  19. classiq/model_expansions/closure.py +77 -12
  20. classiq/model_expansions/function_builder.py +9 -10
  21. classiq/model_expansions/generative_functions.py +2 -2
  22. classiq/model_expansions/interpreter.py +29 -26
  23. classiq/model_expansions/quantum_operations/control.py +114 -29
  24. classiq/model_expansions/quantum_operations/emitter.py +37 -11
  25. classiq/model_expansions/quantum_operations/expression_operation.py +80 -18
  26. classiq/model_expansions/quantum_operations/power.py +5 -0
  27. classiq/model_expansions/quantum_operations/quantum_assignment_operation.py +7 -37
  28. classiq/model_expansions/quantum_operations/quantum_function_call.py +2 -32
  29. classiq/model_expansions/quantum_operations/repeat.py +5 -0
  30. classiq/model_expansions/quantum_operations/within_apply.py +0 -16
  31. classiq/model_expansions/scope_initialization.py +2 -3
  32. classiq/qmod/builtins/functions/arithmetic.py +0 -2
  33. classiq/qmod/builtins/functions/discrete_sine_cosine_transform.py +0 -12
  34. classiq/qmod/builtins/functions/exponentiation.py +0 -6
  35. classiq/qmod/builtins/functions/grover.py +0 -17
  36. classiq/qmod/builtins/functions/linear_pauli_rotation.py +0 -5
  37. classiq/qmod/builtins/functions/modular_exponentiation.py +0 -3
  38. classiq/qmod/builtins/functions/qaoa_penalty.py +0 -8
  39. classiq/qmod/builtins/functions/qft_functions.py +0 -3
  40. classiq/qmod/builtins/functions/qpe.py +0 -6
  41. classiq/qmod/builtins/functions/qsvt.py +0 -12
  42. classiq/qmod/builtins/functions/standard_gates.py +0 -88
  43. classiq/qmod/builtins/functions/state_preparation.py +7 -15
  44. classiq/qmod/builtins/functions/swap_test.py +0 -3
  45. classiq/qmod/builtins/operations.py +152 -17
  46. classiq/qmod/create_model_function.py +10 -12
  47. classiq/qmod/model_state_container.py +5 -1
  48. classiq/qmod/native/pretty_printer.py +6 -1
  49. classiq/qmod/pretty_print/pretty_printer.py +25 -11
  50. classiq/qmod/qmod_constant.py +31 -3
  51. classiq/qmod/quantum_function.py +25 -19
  52. classiq/qmod/synthesize_separately.py +1 -2
  53. {classiq-0.54.0.dist-info → classiq-0.56.0.dist-info}/METADATA +2 -3
  54. {classiq-0.54.0.dist-info → classiq-0.56.0.dist-info}/RECORD +55 -55
  55. classiq/model_expansions/call_to_model_converter.py +0 -190
  56. {classiq-0.54.0.dist-info → classiq-0.56.0.dist-info}/WHEEL +0 -0
@@ -34,9 +34,6 @@ def qsvt_step(
34
34
  u: A block encoded unitary matrix.
35
35
  qvar: The quantum variable to which U is applied, which resides in the entire block encoding space.
36
36
  aux: A zero auxilliary qubit, used for the projector-controlled-phase rotations. Given as an inout so that qsvt can be used as a building-block in a larger algorithm.
37
-
38
- Further reading in Classiq Library:
39
- [QSVT function usage example](https://docs.classiq.io/latest/explore/functions/qmod_library_reference/classiq_open_library/qsvt/qsvt/)
40
37
  """
41
38
  u(qvar)
42
39
  projector_controlled_phase(phase1, proj_cnot_2, qvar, aux)
@@ -80,9 +77,6 @@ def qsvt(
80
77
  u: A block encoded unitary matrix.
81
78
  qvar: The quantum variable to which U is applied, which resides in the entire block encoding space.
82
79
  aux: A zero auxilliary qubit, used for the projector-controlled-phase rotations. Given as an inout so that qsvt can be used as a building-block in a larger algorithm.
83
-
84
- Further reading in Classiq Library:
85
- [QSVT function usage example](https://docs.classiq.io/latest/explore/functions/qmod_library_reference/classiq_open_library/qsvt/qsvt/)
86
80
  """
87
81
  H(aux)
88
82
 
@@ -138,9 +132,6 @@ def projector_controlled_phase(
138
132
  proj_cnot: Projector-controlled-not unitary that sets an auxilliary qubit to |1> when the state is in the projection.
139
133
  qvar: The quantum variable to which the rotation applies, which resides in the entire block encoding space.
140
134
  aux: A zero auxilliary qubit, used for the projector-controlled-phase rotation. Given as an inout so that qsvt can be used as a building-block in a larger algorithm.
141
-
142
- Further reading in Classiq Library:
143
- [QSVT function usage example](https://docs.classiq.io/latest/explore/functions/qmod_library_reference/classiq_open_library/qsvt/qsvt/)
144
135
  """
145
136
  proj_cnot(qvar, aux)
146
137
  RZ(phase, aux)
@@ -167,9 +158,6 @@ def qsvt_inversion(
167
158
  u: A block encoded unitary matrix.
168
159
  qvar: The quantum variable to which U is applied, which resides in the entire block encoding space.
169
160
  aux: A zero auxilliary qubit, used for the projector-controlled-phase rotations. Given as an inout so that qsvt can be used as a building-block in a larger algorithm.
170
-
171
- For usage example, see:
172
- [QSVT matrix inversion example](https://docs.classiq.io/latest/explore/algorithms/qsvt/qsvt_matrix_inversion/qsvt_matrix_inversion)
173
161
  """
174
162
  qsvt(
175
163
  phase_seq,
@@ -18,12 +18,8 @@ def H(target: QBit) -> None:
18
18
  H = \\frac{1}{\\sqrt{2}} \\begin{bmatrix} 1 & 1 \\\\ 1 & -1 \\end{bmatrix}
19
19
  $$
20
20
 
21
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/Quantum_logic_gate).
22
-
23
21
  Args:
24
22
  target: The qubit to apply the Hadamard gate to.
25
-
26
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
27
23
  """
28
24
  pass
29
25
 
@@ -41,12 +37,8 @@ def X(target: QBit) -> None:
41
37
  X = \\begin{bmatrix} 0 & 1 \\\\ 1 & 0 \\end{bmatrix}
42
38
  $$
43
39
 
44
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/Quantum_logic_gate).
45
-
46
40
  Args:
47
41
  target: The qubit to apply the Pauli-X gate to.
48
-
49
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
50
42
  """
51
43
  pass
52
44
 
@@ -64,12 +56,8 @@ def Y(target: QBit) -> None:
64
56
  Y = \\begin{bmatrix} 0 & -i \\\\ i & 0 \\end{bmatrix}
65
57
  $$
66
58
 
67
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/Quantum_logic_gate).
68
-
69
59
  Args:
70
60
  target: The qubit to apply the Pauli-Y gate to.
71
-
72
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
73
61
  """
74
62
  pass
75
63
 
@@ -87,12 +75,8 @@ def Z(target: QBit) -> None:
87
75
  Z = \\begin{bmatrix} 1 & 0 \\\\ 0 & -1 \\end{bmatrix}
88
76
  $$
89
77
 
90
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/Quantum_logic_gate).
91
-
92
78
  Args:
93
79
  target: The qubit to apply the Pauli-Z gate to.
94
-
95
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
96
80
  """
97
81
  pass
98
82
 
@@ -110,12 +94,8 @@ def I(target: QBit) -> None:
110
94
  I = \\begin{bmatrix} 1 & 0 \\\\ 0 & 1 \\end{bmatrix}
111
95
  $$
112
96
 
113
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/Quantum_logic_gate).
114
-
115
97
  Args:
116
98
  target: The qubit to apply the identity gate to.
117
-
118
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
119
99
  """
120
100
  pass
121
101
 
@@ -135,8 +115,6 @@ def S(target: QBit) -> None:
135
115
 
136
116
  Args:
137
117
  target: The qubit to apply the S gate to.
138
-
139
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
140
118
  """
141
119
  pass
142
120
 
@@ -156,8 +134,6 @@ def T(target: QBit) -> None:
156
134
 
157
135
  Args:
158
136
  target: The qubit to apply the T gate to.
159
-
160
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
161
137
  """
162
138
  pass
163
139
 
@@ -177,8 +153,6 @@ def SDG(target: QBit) -> None:
177
153
 
178
154
  Args:
179
155
  target: The qubit to apply the S-dagger gate to.
180
-
181
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
182
156
  """
183
157
  pass
184
158
 
@@ -198,8 +172,6 @@ def TDG(target: QBit) -> None:
198
172
 
199
173
  Args:
200
174
  target: The qubit to apply the T-dagger gate to.
201
-
202
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
203
175
  """
204
176
  pass
205
177
 
@@ -217,13 +189,9 @@ def PHASE(theta: CReal, target: QBit) -> None:
217
189
  PHASE(\\theta) = \\begin{bmatrix} 1 & 0 \\\\ 0 & e^{i\\theta} \\end{bmatrix}
218
190
  $$
219
191
 
220
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Relative_phase_gates).
221
-
222
192
  Args:
223
193
  theta: The phase angle in radians.
224
194
  target: The qubit to apply the phase gate to.
225
-
226
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
227
195
  """
228
196
  pass
229
197
 
@@ -242,13 +210,9 @@ def RX(theta: CReal, target: QBit) -> None:
242
210
  = \\begin{bmatrix} cos(\\frac{\\theta}{2}) & -i sin(\\frac{\\theta}{2}) \\\\ -i sin(\\frac{\\theta}{2}) & cos(\\frac{\\theta}{2}) \\end{bmatrix}
243
211
  $$
244
212
 
245
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Rotation_operator_gates).
246
-
247
213
  Args:
248
214
  theta: The rotation angle in radians.
249
215
  target: The qubit to apply the Pauli-X rotation gate to.
250
-
251
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
252
216
  """
253
217
  pass
254
218
 
@@ -267,13 +231,9 @@ def RY(theta: CReal, target: QBit) -> None:
267
231
  = \\begin{bmatrix} cos(\\frac{\\theta}{2}) & -sin(\\frac{\\theta}{2}) \\\\ -sin(\\frac{\\theta}{2}) & cos(\\frac{\\theta}{2}) \\end{bmatrix}
268
232
  $$
269
233
 
270
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Rotation_operator_gates).
271
-
272
234
  Args:
273
235
  theta: The rotation angle in radians.
274
236
  target: The qubit to apply the Pauli-Y rotation gate to.
275
-
276
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
277
237
  """
278
238
  pass
279
239
 
@@ -292,13 +252,9 @@ def RZ(theta: CReal, target: QBit) -> None:
292
252
  = \\begin{bmatrix} e^{-i\\frac{\\theta}{2}} & 0 \\\\ 0 & e^{i\\frac{\\theta}{2}} \\end{bmatrix}
293
253
  $$
294
254
 
295
- More information on quantum logic gates can be found on [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Rotation_operator_gates).
296
-
297
255
  Args:
298
256
  theta: The rotation angle in radians.
299
257
  target: The qubit to apply the Pauli-Z rotation gate to.
300
-
301
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
302
258
  """
303
259
  pass
304
260
 
@@ -317,14 +273,10 @@ def R(theta: CReal, phi: CReal, target: QBit) -> None:
317
273
  = \\begin{bmatrix} cos(\\frac{\\theta}{2}) & -i e^{-i\\phi} sin(\\frac{\\theta}{2}) \\\\ -i e^{i\\phi} sin(\\frac{\\theta}{2}) & cos(\\frac{\\theta}{2}) \\end{bmatrix}
318
274
  $$
319
275
 
320
- More information on this gate can be found in the [Qiskit documentation](https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.RGate).
321
-
322
276
  Args:
323
277
  theta: The rotation angle in radians.
324
278
  phi: The phase angle in radians.
325
279
  target: The qubit to apply the general single-qubit rotation gate to.
326
-
327
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
328
280
  """
329
281
  pass
330
282
 
@@ -343,13 +295,9 @@ def RXX(theta: CReal, target: QArray[QBit, Literal[2]]) -> None:
343
295
  = \\begin{bmatrix} cos(\\frac{\\theta}{2}) & 0 & 0 & -i sin(\\frac{\\theta}{2}) \\\\ 0 & cos(\\frac{\\theta}{2}) & -i sin(\\frac{\\theta}{2}) & 0 \\\\ 0 & -i sin(\\frac{\\theta}{2}) & cos(\\frac{\\theta}{2}) & 0 \\\\ -i sin(\\frac{\\theta}{2}) & 0 & 0 & cos(\\frac{\\theta}{2}) \\end{bmatrix}
344
296
  $$
345
297
 
346
- For more information on quantum logic gates, see [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Two-qubit_interaction_gates).
347
-
348
298
  Args:
349
299
  theta: The rotation angle in radians.
350
300
  target: The pair of qubits to apply the XX rotation gate to.
351
-
352
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
353
301
  """
354
302
  pass
355
303
 
@@ -368,13 +316,9 @@ def RYY(theta: CReal, target: QArray[QBit, Literal[2]]) -> None:
368
316
  = \\begin{bmatrix} cos(\\frac{\\theta}{2}) & 0 & 0 & -sin(\\frac{\\theta}{2}) \\\\ 0 & cos(\\frac{\\theta}{2}) & sin(\\frac{\\theta}{2}) & 0 \\\\ 0 & sin(\\frac{\\theta}{2}) & cos(\\frac{\\theta}{2}) & 0 \\\\ -sin(\\frac{\\theta}{2}) & 0 & 0 & cos(\\frac{\\theta}{2}) \\end{bmatrix}
369
317
  $$
370
318
 
371
- For more information on quantum logic gates, see [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Two-qubit_interaction_gates).
372
-
373
319
  Args:
374
320
  theta: The rotation angle in radians.
375
321
  target: The pair of qubits to apply the YY rotation gate to.
376
-
377
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
378
322
  """
379
323
  pass
380
324
 
@@ -393,13 +337,9 @@ def RZZ(theta: CReal, target: QArray[QBit, Literal[2]]) -> None:
393
337
  = \\begin{bmatrix} e^{-i\\frac{\\theta}{2}} & 0 & 0 & 0 \\\\ 0 & e^{i\\frac{\\theta}{2}} & 0 & 0 \\\\ 0 & 0 & e^{i\\frac{\\theta}{2}} & 0 \\\\ 0 & 0 & 0 & e^{-i\\frac{\\theta}{2}} \\end{bmatrix}
394
338
  $$
395
339
 
396
- For more information on quantum logic gates, see [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Two-qubit_interaction_gates).
397
-
398
340
  Args:
399
341
  theta: The rotation angle in radians.
400
342
  target: The pair of qubits to apply the ZZ rotation gate to.
401
-
402
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
403
343
  """
404
344
  pass
405
345
 
@@ -425,8 +365,6 @@ def CH(ctrl: QBit, target: QBit) -> None:
425
365
  Args:
426
366
  ctrl: The control qubit.
427
367
  target: The qubit to apply the Hadamard gate on.
428
-
429
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
430
368
  """
431
369
  pass
432
370
 
@@ -452,8 +390,6 @@ def CX(ctrl: QBit, target: QBit) -> None:
452
390
  Args:
453
391
  ctrl: The control qubit.
454
392
  target: The qubit to apply the Pauli-X gate on.
455
-
456
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
457
393
  """
458
394
  pass
459
395
 
@@ -479,8 +415,6 @@ def CY(ctrl: QBit, target: QBit) -> None:
479
415
  Args:
480
416
  ctrl: The control qubit.
481
417
  target: The qubit to apply the Pauli-Y gate on.
482
-
483
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
484
418
  """
485
419
  pass
486
420
 
@@ -506,8 +440,6 @@ def CZ(ctrl: QBit, target: QBit) -> None:
506
440
  Args:
507
441
  ctrl: The control qubit.
508
442
  target: The qubit to apply the Pauli-Z gate on.
509
-
510
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
511
443
  """
512
444
  pass
513
445
 
@@ -534,8 +466,6 @@ def CRX(theta: CReal, ctrl: QBit, target: QBit) -> None:
534
466
  theta: The rotation angle in radians.
535
467
  ctrl: The control qubit.
536
468
  target: The qubit to apply the RX gate on.
537
-
538
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
539
469
  """
540
470
  pass
541
471
 
@@ -562,8 +492,6 @@ def CRY(theta: CReal, ctrl: QBit, target: QBit) -> None:
562
492
  theta (CReal): The rotation angle in radians.
563
493
  ctrl (QBit): The control qubit.
564
494
  target (QBit): The qubit to apply the RY gate on.
565
-
566
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
567
495
  """
568
496
  pass
569
497
 
@@ -590,8 +518,6 @@ def CRZ(theta: CReal, ctrl: QBit, target: QBit) -> None:
590
518
  theta (CReal): The rotation angle in radians.
591
519
  ctrl (QBit): The control qubit.
592
520
  target (QBit): The qubit to apply the RZ gate on.
593
-
594
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
595
521
  """
596
522
  pass
597
523
 
@@ -618,8 +544,6 @@ def CPHASE(theta: CReal, ctrl: QBit, target: QBit) -> None:
618
544
  theta (CReal): The rotation angle in radians.
619
545
  ctrl (QBit): The control qubit.
620
546
  target (QBit): The qubit to apply the PHASE gate on.
621
-
622
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
623
547
  """
624
548
  pass
625
549
 
@@ -645,8 +569,6 @@ def SWAP(qbit0: QBit, qbit1: QBit) -> None:
645
569
  Args:
646
570
  qbit0 (QBit): The first qubit.
647
571
  qbit1 (QBit): The second qubit.
648
-
649
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
650
572
  """
651
573
  pass
652
574
 
@@ -669,8 +591,6 @@ def IDENTITY(target: QArray[QBit]) -> None:
669
591
 
670
592
  Args:
671
593
  target (QArray[QBit]): The qubits to apply the IDENTITY gate on.
672
-
673
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
674
594
  """
675
595
  pass
676
596
 
@@ -692,16 +612,12 @@ def U(theta: CReal, phi: CReal, lam: CReal, gam: CReal, target: QBit) -> None:
692
612
  \\end{bmatrix}
693
613
  $$
694
614
 
695
- More information on this gate can be found on [Wikipedia](https://en.wikipedia.org/wiki/List_of_quantum_logic_gates#Other_named_gates).
696
-
697
615
  Args:
698
616
  theta (CReal): The first Euler angle in radians.
699
617
  phi (CReal): The second Euler angle in radians.
700
618
  lam (CReal): The third Euler angle in radians.
701
619
  gam (CReal): The global phase angle in radians.
702
620
  target (QBit): The qubit to apply the general single-qubit unitary gate to.
703
-
704
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
705
621
  """
706
622
  pass
707
623
 
@@ -728,12 +644,8 @@ def CCX(ctrl: QArray[QBit, Literal[2]], target: QBit) -> None:
728
644
  \\end{bmatrix}
729
645
  $$
730
646
 
731
- More information can be found on [Wikipedia](https://en.wikipedia.org/wiki/Toffoli_gate).
732
-
733
647
  Args:
734
648
  ctrl (QArray[QBit, Literal[2]]): The control qubits.
735
649
  target (QBit): The qubit to apply the conditioned Pauli-X gate on.
736
-
737
- Link: [Reference Manual](https://docs.classiq.io/latest/reference-manual/qmod/library-reference/core-library-functions/standard_gates/standard_gates/)
738
650
  """
739
651
  pass
@@ -37,12 +37,11 @@ def allocate(
37
37
 
38
38
  Args:
39
39
  num_qubits: The number of qubits to allocate. Must be a positive integer.
40
- out: The quantum variable that will receive the allocated qubits. Must be uninitialized before allocation. For more information on quantum variable initialization, see [here](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-variables/).
40
+ out: The quantum variable that will receive the allocated qubits. Must be uninitialized before allocation.
41
41
 
42
42
  Notes:
43
43
  1. If the output variable has been declared with a specific number of qubits, the number of qubits allocated must match the declared number.
44
44
  2. The synthesis engine automatically handles the allocation, either by drawing new qubits from the available pool or by reusing existing ones.
45
-
46
45
  """
47
46
  pass
48
47
 
@@ -65,9 +64,6 @@ def allocate_num(
65
64
  num_qubits: The number of qubits to allocate.
66
65
  is_signed: Whether the number is signed or unsigned.
67
66
  fraction_digits: The number of fractional digits.
68
-
69
- Further reading is available on the [reference manual](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-types#allocate-num)
70
-
71
67
  """
72
68
  allocate(num_qubits, out)
73
69
 
@@ -80,7 +76,7 @@ def free(in_: Input[QArray[QBit]]) -> None:
80
76
  Releases the qubits allocated to a quantum variable, allowing them to be reused.
81
77
 
82
78
  Args:
83
- in_: The quantum variable that will be freed. Must be initialized before. For more information on quantum variable initialization, see [here](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-variables/).
79
+ in_: The quantum variable that will be freed. Must be initialized before.
84
80
 
85
81
  Note:
86
82
  This operation does not uncompute the qubits. It is the responsibility of the user to ensure that the qubits are at the zero state before freeing them.
@@ -108,12 +104,11 @@ def prepare_state(
108
104
  Args:
109
105
  probabilities: The probability distribution to initialize the quantum variable. Must be a valid probability distribution, i.e., a list of non-negative real numbers that sum to 1. Must have a valid length (a power of 2).
110
106
  bound: An error bound, expressed as the $L^{2}$ norm between the expected and actual distributions. A larger bound can reduce the circuit size at the expense of accuracy. Must be a positive real number.
111
- out: The quantum variable that will receive the initialized state. Must be uninitialized. For more information on quantum variable initialization, see [here](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-variables/).
107
+ out: The quantum variable that will receive the initialized state. Must be uninitialized.
112
108
 
113
109
  Notes:
114
110
  1. If the output variable has been declared with a specific number of qubits, the number of qubits formed by the distribution must match the declared number.
115
111
  2. The synthesis engine automatically handles the allocation, either by drawing new qubits from the available pool or by reusing existing ones.
116
-
117
112
  """
118
113
  pass
119
114
 
@@ -138,12 +133,11 @@ def prepare_amplitudes(
138
133
  Args:
139
134
  amplitudes: The amplitudes to initialize the quantum variable. Must be a valid real quantum state vector, i.e., the sum of squares should be 1. Must have a valid length (a power of 2).
140
135
  bound: An error bound, expressed as the $L^{2}$ norm between the expected and actual distributions. A larger bound can reduce the circuit size at the expense of accuracy. Must be a positive real number.
141
- out: The quantum variable that will receive the initialized state. Must be uninitialized. For more information on quantum variable initialization, see [here](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-variables/).
136
+ out: The quantum variable that will receive the initialized state. Must be uninitialized.
142
137
 
143
138
  Notes:
144
139
  1. If the output variable has been declared with a specific number of qubits, the number of qubits formed by the distribution must match the declared number.
145
140
  2. The synthesis engine automatically handles the allocation, either by drawing new qubits from the available pool or by reusing existing ones.
146
-
147
141
  """
148
142
  pass
149
143
 
@@ -237,7 +231,7 @@ def prepare_uniform_trimmed_state(m: CInt, q: QArray[QBit]) -> None:
237
231
 
238
232
  Args:
239
233
  m: The number of states to load in the superposition.
240
- q: The quantum variable that will receive the initialized state. Must be uninitialized. For more information on quantum variable initialization, see [here](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-variables/).
234
+ q: The quantum variable that will receive the initialized state. Must be uninitialized.
241
235
 
242
236
  Notes:
243
237
  1. If the output variable has been declared with a specific number of qubits, it must match the number of allocated qubits.
@@ -283,7 +277,7 @@ def prepare_uniform_interval_state(start: CInt, end: CInt, q: QArray[QBit]) -> N
283
277
  Args:
284
278
  start: The lower bound of the interval to load (inclusive).
285
279
  end: The upper bound of the interval to load (exclusive).
286
- q: The quantum variable that will receive the initialized state. Must be uninitialized. For more information on quantum variable initialization, see [here](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-variables/).
280
+ q: The quantum variable that will receive the initialized state. Must be uninitialized.
287
281
 
288
282
  Notes:
289
283
  1. If the output variable has been declared with a specific number of qubits, it must match the number of allocated qubits.
@@ -340,8 +334,6 @@ def prepare_exponential_state(rate: CInt, q: QArray[QBit]) -> None:
340
334
  Args:
341
335
  rate: The rate of the exponential decay.
342
336
  q: The quantum register to prepare.
343
-
344
- Further reading is available on the [reference manual](https://docs.classiq.io/latest/explore/functions/qmod_library_reference/classiq_open_library/special_state_preparations/prepare_exponential_state)
345
337
  """
346
338
  repeat(q.len, lambda i: RY(2.0 * atan(exp((-rate * 2.0**i) / 2.0)), q[i]))
347
339
 
@@ -433,7 +425,7 @@ def prepare_int(
433
425
 
434
426
  Args:
435
427
  value: The value to assign to the quantum variable.
436
- out: The allocated quantum variable. Must be uninitialized. For more information on quantum variable initialization, see [here](https://docs.classiq.io/latest/reference-manual/qmod/language-reference/quantum-variables/).
428
+ out: The allocated quantum variable. Must be uninitialized.
437
429
 
438
430
  Note:
439
431
  If the output variable has been declared with a specific number of qubits, it must match the number of allocated qubits.
@@ -21,9 +21,6 @@ def swap_test(state1: QArray[QBit], state2: QArray[QBit], test: Output[QBit]) ->
21
21
  state1: A quantum state to check its overlap with state2.
22
22
  state2: A quantum state to check its overlap with state1.
23
23
  test: A qubit for which the probability of measuring 0 is $0.5*(|\\langle state1 | state2 \\rangle |^2+1)$
24
-
25
- Example:
26
- Further reading in the Classiq library is found [here](https://docs.classiq.io/latest/explore/algorithms/swap_test/swap_test/).
27
24
  """
28
25
  allocate(1, test)
29
26
  H(test)