qcs-sdk-python 0.21.12rc4__tar.gz → 0.21.13__tar.gz

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 (182) hide show
  1. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/Cargo.lock +17 -17
  2. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/Cargo.toml +4 -4
  3. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/PKG-INFO +17 -17
  4. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/CHANGELOG.md +44 -0
  5. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/Cargo.toml +3 -1
  6. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/Makefile.toml +7 -0
  7. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/lib.rs +1 -1
  8. qcs_sdk_python-0.21.13/crates/lib/src/qpu/experimental/mod.rs +10 -0
  9. qcs_sdk_python-0.21.13/crates/lib/src/qpu/experimental/random.rs +372 -0
  10. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/mod.rs +2 -0
  11. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qvm/mod.rs +0 -1
  12. qcs_sdk_python-0.21.13/crates/lib/tests/prng_test_cases.json +339 -0
  13. qcs_sdk_python-0.21.13/crates/lib/tests/secrets.toml +6 -0
  14. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/CHANGELOG.md +44 -0
  15. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/Cargo.toml +3 -2
  16. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/Makefile.toml +9 -4
  17. qcs_sdk_python-0.21.13/crates/python/build.rs +19 -0
  18. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/__init__.py +1 -0
  19. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/__init__.pyi +1 -0
  20. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qpu/__init__.pyi +2 -0
  21. qcs_sdk_python-0.21.13/crates/python/qcs_sdk/qpu/experimental/__init__.pyi +18 -0
  22. qcs_sdk_python-0.21.13/crates/python/qcs_sdk/qpu/experimental/random.pyi +93 -0
  23. qcs_sdk_python-0.21.13/crates/python/src/qpu/experimental/mod.rs +9 -0
  24. qcs_sdk_python-0.21.13/crates/python/src/qpu/experimental/random.rs +80 -0
  25. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/qpu/mod.rs +3 -1
  26. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/conftest.py +1 -1
  27. qcs_sdk_python-0.21.13/crates/python/tests/qpu/experimental/test_random.py +50 -0
  28. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/pyproject.toml +3 -3
  29. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/__init__.py +1 -0
  30. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/__init__.pyi +1 -0
  31. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qpu/__init__.pyi +2 -0
  32. qcs_sdk_python-0.21.13/qcs_sdk/qpu/experimental/__init__.pyi +18 -0
  33. qcs_sdk_python-0.21.13/qcs_sdk/qpu/experimental/random.pyi +93 -0
  34. qcs_sdk_python-0.21.12rc4/crates/lib/tests/secrets.toml +0 -5
  35. qcs_sdk_python-0.21.12rc4/crates/python/build.rs +0 -11
  36. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/README.md +0 -0
  37. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/THIRDPARTY.yaml +0 -0
  38. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/README.md +0 -0
  39. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/build.rs +0 -0
  40. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/examples/delayed_job_retrieval.rs +0 -0
  41. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/examples/execute.rs +0 -0
  42. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/examples/libquil.rs +0 -0
  43. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/examples/local.rs +0 -0
  44. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/examples/parametric_compilation.rs +0 -0
  45. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/examples/quil_t.rs +0 -0
  46. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/bin/diagnostics.rs +0 -0
  47. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/client.rs +0 -0
  48. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/isa/edge.rs +0 -0
  49. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/isa/mod.rs +0 -0
  50. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/isa/operator.rs +0 -0
  51. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/isa/qubit.rs +0 -0
  52. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/libquil.rs +0 -0
  53. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/mod.rs +0 -0
  54. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/quilc.rs +0 -0
  55. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/compiler/rpcq.rs +0 -0
  56. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/diagnostics.rs +0 -0
  57. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/executable.rs +0 -0
  58. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/execution_data.rs +0 -0
  59. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/api.rs +0 -0
  60. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/execution.rs +0 -0
  61. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/result_data.rs +0 -0
  62. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_allocates_for_multiple_expressions-2.snap +0 -0
  63. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_allocates_for_multiple_expressions.snap +0 -0
  64. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_converts_frequency_expressions-2.snap +0 -0
  65. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_converts_frequency_expressions.snap +0 -0
  66. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_converts_phases.snap +0 -0
  67. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_converts_set_scale_units.snap +0 -0
  68. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_substitutes_and_reuses_gate_expressions.snap +0 -0
  69. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/snapshots/qcs__qpu__rewrite_arithmetic__describe_rewrite_arithmetic__it_substitutes_gate_parameters.snap +0 -0
  70. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qpu/translation.rs +0 -0
  71. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qvm/execution.rs +0 -0
  72. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qvm/http.rs +0 -0
  73. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qvm/libquil.rs +0 -0
  74. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/qvm/snapshots/qcs__qvm__test__apply_valid_parameters_to_program.snap +0 -0
  75. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/src/register_data.rs +0 -0
  76. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/aspen_9_isa.json +0 -0
  77. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/basic_qvm.rs +0 -0
  78. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/bell_state_response_data.hex +0 -0
  79. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/compiler-isa-Aspen-8.json +0 -0
  80. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/mocked_qpu.rs +0 -0
  81. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/parametric_compilation.rs +0 -0
  82. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/qcs-isa-Aspen-8.json +0 -0
  83. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/qvm_api.rs +0 -0
  84. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/qvm_isa.json +0 -0
  85. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/lib/tests/settings.toml +0 -0
  86. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/.flake8 +0 -0
  87. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/.stubtest-allowlist +0 -0
  88. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/README.md +0 -0
  89. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/THIRDPARTY.yaml +0 -0
  90. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/poetry.lock +0 -0
  91. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/.stubtest-allowlist +0 -0
  92. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/__init__.py +0 -0
  93. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/__init__.pyi +0 -0
  94. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.py +0 -0
  95. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.pyi +0 -0
  96. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.py +0 -0
  97. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.pyi +0 -0
  98. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/file/__init__.py +0 -0
  99. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/file/__init__.pyi +0 -0
  100. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.py +0 -0
  101. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi +0 -0
  102. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.py +0 -0
  103. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi +0 -0
  104. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/subscriber/__init__.py +0 -0
  105. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/_tracing_subscriber/subscriber/__init__.pyi +0 -0
  106. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/client.py +0 -0
  107. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/client.pyi +0 -0
  108. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/compiler/__init__.py +0 -0
  109. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/compiler/__init__.pyi +0 -0
  110. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/compiler/quilc.pyi +0 -0
  111. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/diagnostics.py +0 -0
  112. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/py.typed +0 -0
  113. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qpu/__init__.py +0 -0
  114. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qpu/api.pyi +0 -0
  115. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qpu/isa.pyi +0 -0
  116. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qpu/translation.pyi +0 -0
  117. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qvm/__init__.py +0 -0
  118. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qvm/__init__.pyi +0 -0
  119. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/qcs_sdk/qvm/api.pyi +0 -0
  120. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/scripts/patch_grpc_web.py +0 -0
  121. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/client.rs +0 -0
  122. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/compiler/mod.rs +0 -0
  123. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/compiler/quilc.rs +0 -0
  124. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/executable.rs +0 -0
  125. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/execution_data.rs +0 -0
  126. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/from_py.rs +0 -0
  127. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/grpc/mod.rs +0 -0
  128. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/grpc/models/controller.rs +0 -0
  129. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/grpc/models/mod.rs +0 -0
  130. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/lib.rs +0 -0
  131. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/qpu/api.rs +0 -0
  132. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/qpu/isa.rs +0 -0
  133. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/qpu/result_data.rs +0 -0
  134. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/qpu/translation.rs +0 -0
  135. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/qvm/api.rs +0 -0
  136. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/qvm/mod.rs +0 -0
  137. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/src/register_data.rs +0 -0
  138. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/_fixtures/aspen-m-3.json +0 -0
  139. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/_fixtures/device-2q.json +0 -0
  140. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/_qcs_config/secrets.toml +0 -0
  141. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/_qcs_config/settings.toml +0 -0
  142. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/compiler/__snapshots__/test_quilc.ambr +0 -0
  143. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/compiler/test_quilc.py +0 -0
  144. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/execution_data/test_execution_data.py +0 -0
  145. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/qpu/test_api.py +0 -0
  146. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/qpu/test_isa.py +0 -0
  147. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/qpu/test_qpu.py +0 -0
  148. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/qpu/test_translation.py +0 -0
  149. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/qvm/test_qvm.py +0 -0
  150. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/test_client.py +0 -0
  151. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/test_diagnostics.py +0 -0
  152. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/test_executable.py +0 -0
  153. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/test_logging.py +0 -0
  154. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/crates/python/tests/test_tracing_subscriber.py +0 -0
  155. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/__init__.py +0 -0
  156. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/__init__.pyi +0 -0
  157. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/common/__init__.py +0 -0
  158. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/common/__init__.pyi +0 -0
  159. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/__init__.py +0 -0
  160. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/__init__.pyi +0 -0
  161. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/file/__init__.py +0 -0
  162. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/file/__init__.pyi +0 -0
  163. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.py +0 -0
  164. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi +0 -0
  165. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.py +0 -0
  166. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi +0 -0
  167. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/subscriber/__init__.py +0 -0
  168. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/_tracing_subscriber/subscriber/__init__.pyi +0 -0
  169. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/client.py +0 -0
  170. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/client.pyi +0 -0
  171. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/compiler/__init__.py +0 -0
  172. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/compiler/__init__.pyi +0 -0
  173. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/compiler/quilc.pyi +0 -0
  174. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/diagnostics.py +0 -0
  175. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/py.typed +0 -0
  176. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qpu/__init__.py +0 -0
  177. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qpu/api.pyi +0 -0
  178. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qpu/isa.pyi +0 -0
  179. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qpu/translation.pyi +0 -0
  180. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qvm/__init__.py +0 -0
  181. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qvm/__init__.pyi +0 -0
  182. {qcs_sdk_python-0.21.12rc4 → qcs_sdk_python-0.21.13}/qcs_sdk/qvm/api.pyi +0 -0
@@ -1806,9 +1806,9 @@ dependencies = [
1806
1806
 
1807
1807
  [[package]]
1808
1808
  name = "libloading"
1809
- version = "0.8.3"
1809
+ version = "0.8.5"
1810
1810
  source = "registry+https://github.com/rust-lang/crates.io-index"
1811
- checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
1811
+ checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
1812
1812
  dependencies = [
1813
1813
  "cfg-if 1.0.0",
1814
1814
  "windows-targets 0.52.6",
@@ -1829,7 +1829,7 @@ dependencies = [
1829
1829
  "bindgen",
1830
1830
  "cc",
1831
1831
  "libc",
1832
- "libloading 0.8.3",
1832
+ "libloading 0.8.5",
1833
1833
  "num-complex",
1834
1834
  "paste",
1835
1835
  "pkg-config",
@@ -2628,7 +2628,7 @@ checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15"
2628
2628
  dependencies = [
2629
2629
  "bytes",
2630
2630
  "heck 0.5.0",
2631
- "itertools 0.13.0",
2631
+ "itertools 0.11.0",
2632
2632
  "log",
2633
2633
  "multimap",
2634
2634
  "once_cell",
@@ -2648,7 +2648,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
2648
2648
  checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5"
2649
2649
  dependencies = [
2650
2650
  "anyhow",
2651
- "itertools 0.13.0",
2651
+ "itertools 0.11.0",
2652
2652
  "proc-macro2",
2653
2653
  "quote",
2654
2654
  "syn 2.0.66",
@@ -2811,7 +2811,7 @@ dependencies = [
2811
2811
 
2812
2812
  [[package]]
2813
2813
  name = "qcs"
2814
- version = "0.25.11-rc.4"
2814
+ version = "0.25.12"
2815
2815
  dependencies = [
2816
2816
  "assert2",
2817
2817
  "async-trait",
@@ -2860,9 +2860,9 @@ dependencies = [
2860
2860
 
2861
2861
  [[package]]
2862
2862
  name = "qcs-api-client-common"
2863
- version = "0.11.8"
2863
+ version = "0.11.9"
2864
2864
  source = "registry+https://github.com/rust-lang/crates.io-index"
2865
- checksum = "ed485c8c48ec362a35bc5106b67520c63495cf04166c9d2733fc971bcf3ca2ca"
2865
+ checksum = "cfd6d5b09d8e6b8576ebf34a26e864c513e402ff49e10222eb04b029909b5253"
2866
2866
  dependencies = [
2867
2867
  "async-tempfile",
2868
2868
  "async-trait",
@@ -2893,9 +2893,9 @@ dependencies = [
2893
2893
 
2894
2894
  [[package]]
2895
2895
  name = "qcs-api-client-grpc"
2896
- version = "0.11.8"
2896
+ version = "0.11.9"
2897
2897
  source = "registry+https://github.com/rust-lang/crates.io-index"
2898
- checksum = "a022867a1995c0509014d2786c3d6e85e0ff2869f5cb42488a92956655548ac2"
2898
+ checksum = "56d06564cd30895f83ac41c7995f0106860308a8b71638b3fd3b9fa532fa1d52"
2899
2899
  dependencies = [
2900
2900
  "backoff",
2901
2901
  "futures-util",
@@ -2932,9 +2932,9 @@ dependencies = [
2932
2932
 
2933
2933
  [[package]]
2934
2934
  name = "qcs-api-client-openapi"
2935
- version = "0.12.8"
2935
+ version = "0.12.9"
2936
2936
  source = "registry+https://github.com/rust-lang/crates.io-index"
2937
- checksum = "42225f82f62536c99a99d50e7b1ab0222afc0053064a0fb8c3f8388e9ade2983"
2937
+ checksum = "9b82adef224d6e01d929dcceb139a33c2c6e0fa9bd6c6263b73e616c802b1790"
2938
2938
  dependencies = [
2939
2939
  "anyhow",
2940
2940
  "http 1.1.0",
@@ -2953,7 +2953,7 @@ dependencies = [
2953
2953
 
2954
2954
  [[package]]
2955
2955
  name = "qcs-sdk-python"
2956
- version = "0.21.12-rc.4"
2956
+ version = "0.21.13"
2957
2957
  dependencies = [
2958
2958
  "async-trait",
2959
2959
  "numpy",
@@ -2988,8 +2988,8 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
2988
2988
 
2989
2989
  [[package]]
2990
2990
  name = "quil-rs"
2991
- version = "0.29.2"
2992
- source = "git+https://github.com/rigetti/quil-rs?tag=quil-py%2Fv0.13.2#f725e9f67ae3a3137cd9033d0f98143e8644b610"
2991
+ version = "0.30.0"
2992
+ source = "git+https://github.com/rigetti/quil-rs?tag=quil-py%2Fv0.15.2#ead13b6c1db0e8089b5c22a1e6125b69632558d4"
2993
2993
  dependencies = [
2994
2994
  "approx",
2995
2995
  "indexmap 2.7.1",
@@ -4496,9 +4496,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
4496
4496
 
4497
4497
  [[package]]
4498
4498
  name = "unicode-width"
4499
- version = "0.1.13"
4499
+ version = "0.1.14"
4500
4500
  source = "registry+https://github.com/rust-lang/crates.io-index"
4501
- checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
4501
+ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
4502
4502
 
4503
4503
  [[package]]
4504
4504
  name = "unindent"
@@ -3,9 +3,9 @@ members = ["crates/*"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.dependencies]
6
- qcs-api-client-common = "0.11.8"
7
- qcs-api-client-grpc = "0.11.8"
8
- qcs-api-client-openapi = "0.12.8"
6
+ qcs-api-client-common = "0.11.9"
7
+ qcs-api-client-grpc = "0.11.9"
8
+ qcs-api-client-openapi = "0.12.9"
9
9
  serde_json = "1.0.86"
10
10
  thiserror = "1.0.57"
11
11
  tokio = "1.36.0"
@@ -15,7 +15,7 @@ tokio = "1.36.0"
15
15
  # `crates/python/pyproject.toml`.
16
16
  # The version must also be specified in order to publish to crates.io. Cargo enforces
17
17
  # that the specified version is the same as the version in the git repository.
18
- quil-rs = { version = "0.29.2", git = "https://github.com/rigetti/quil-rs", tag = "quil-py/v0.13.2" }
18
+ quil-rs = { git = "https://github.com/rigetti/quil-rs", tag = "quil-py/v0.15.2" }
19
19
 
20
20
  # ndarray is used by the `qcs` crate, but it is also used in the `python` crate via a
21
21
  # re-export through the numpy crate. They should be updated as a pair to keep both
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qcs-sdk-python
3
- Version: 0.21.12rc4
3
+ Version: 0.21.13
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: License :: OSI Approved :: Apache Software License
6
6
  Classifier: Programming Language :: Python :: 3.8
@@ -8,22 +8,22 @@ Classifier: Programming Language :: Python :: 3.9
8
8
  Classifier: Programming Language :: Python :: 3.10
9
9
  Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Operating System :: OS Independent
11
- Requires-Dist: quil>=0.15.2
12
- Requires-Dist: qcs-api-client-common>=0.11.8
13
- Requires-Dist: pyquil==4.14.2 ; extra == 'pyquil'
14
- Requires-Dist: black>=24.8.0 ; extra == 'dev'
15
- Requires-Dist: opentelemetry-sdk==1.25.0 ; extra == 'dev'
16
- Requires-Dist: pytest>=8.1.1 ; extra == 'dev'
17
- Requires-Dist: pytest-asyncio>=0.23.6 ; extra == 'dev'
18
- Requires-Dist: pytest-mock>=3.14.0 ; extra == 'dev'
19
- Requires-Dist: pytest-sugar>=1.0.0 ; extra == 'dev'
20
- Requires-Dist: pytest-clarity>=1.0.1 ; extra == 'dev'
21
- Requires-Dist: syrupy>=4.0.0 ; extra == 'dev'
22
- Requires-Dist: maturin==1.5.1 ; extra == 'dev'
23
- Requires-Dist: numpy>=1.24.1 ; extra == 'dev'
24
- Requires-Dist: pdoc>=14.6.1 ; extra == 'dev'
25
- Requires-Dist: ruff>=0.3.5 ; extra == 'dev'
26
- Requires-Dist: mypy>=1.14.1 ; extra == 'dev'
11
+ Requires-Dist: quil >=0.15.2
12
+ Requires-Dist: qcs-api-client-common >=0.11.8
13
+ Requires-Dist: pyquil ==4.14.2 ; extra == 'pyquil'
14
+ Requires-Dist: black >=24.8.0 ; extra == 'dev'
15
+ Requires-Dist: opentelemetry-sdk ==1.25.0 ; extra == 'dev'
16
+ Requires-Dist: pytest >=8.1.1 ; extra == 'dev'
17
+ Requires-Dist: pytest-asyncio >=0.23.6 ; extra == 'dev'
18
+ Requires-Dist: pytest-mock >=3.14.0 ; extra == 'dev'
19
+ Requires-Dist: pytest-sugar >=1.0.0 ; extra == 'dev'
20
+ Requires-Dist: pytest-clarity >=1.0.1 ; extra == 'dev'
21
+ Requires-Dist: syrupy >=4.0.0 ; extra == 'dev'
22
+ Requires-Dist: maturin ==1.7.0 ; extra == 'dev'
23
+ Requires-Dist: numpy >=1.24.1 ; extra == 'dev'
24
+ Requires-Dist: pdoc >=14.6.1 ; extra == 'dev'
25
+ Requires-Dist: ruff >=0.3.5 ; extra == 'dev'
26
+ Requires-Dist: mypy >=1.14.1 ; extra == 'dev'
27
27
  Provides-Extra: pyquil
28
28
  Provides-Extra: dev
29
29
  Summary: Python interface for the QCS Rust SDK
@@ -1,3 +1,47 @@
1
+ ## 0.25.12
2
+
3
+ ### Features
4
+
5
+ - add support for hardware randomization (#515)
6
+
7
+ ### Fixes
8
+
9
+ - update grpc clients (#537)
10
+
11
+ ## 0.25.12-rc.2
12
+
13
+ ### Features
14
+
15
+ - add support for hardware randomization (#515)
16
+
17
+ ### Fixes
18
+
19
+ - update grpc clients (#537)
20
+
21
+ ## 0.25.12-rc.1
22
+
23
+ ### Features
24
+
25
+ - add support for hardware randomization (#515)
26
+
27
+ ## 0.25.12-rc.0
28
+
29
+ ### Features
30
+
31
+ - add support for hardware randomization (#515)
32
+
33
+ ## 0.25.11
34
+
35
+ ### Fixes
36
+
37
+ - wheel building for linux, macos (#535)
38
+
39
+ ## 0.25.11-rc.5
40
+
41
+ ### Fixes
42
+
43
+ - wheel building for linux, macos (#535)
44
+
1
45
  ## 0.25.11-rc.4
2
46
 
3
47
  ### Fixes
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "qcs"
3
3
  description = "High level interface for running Quil on a QPU"
4
- version = "0.25.11-rc.4"
4
+ version = "0.25.12"
5
5
  edition = "2018"
6
6
  license = "Apache-2.0"
7
7
  repository = "https://github.com/rigetti/qcs-sdk-rust"
@@ -17,6 +17,7 @@ otel-tracing = ["tracing-config", "qcs-api-client-grpc/otel-tracing", "qcs-api-c
17
17
  libquil = ["dep:libquil-sys"]
18
18
  grpc-web = ["qcs-api-client-grpc/grpc-web"]
19
19
  tracing-opentelemetry = ["tracing-config", "qcs-api-client-grpc/tracing-opentelemetry", "qcs-api-client-openapi/tracing-opentelemetry"]
20
+ experimental = []
20
21
 
21
22
  [dependencies]
22
23
  cached = "0.44.0"
@@ -73,3 +74,4 @@ built = "0.6.1"
73
74
  name = "compilation-and-simulation-with-libquil"
74
75
  path = "examples/libquil.rs"
75
76
  required-features = ["libquil"]
77
+
@@ -22,9 +22,16 @@ run_task = [{name = "test-flow"}]
22
22
  dependencies = ["clippy-flow"]
23
23
 
24
24
  [tasks.examples]
25
+ dependencies = ["examples-libquil", "examples-experimental"]
26
+
27
+ [tasks.examples-libquil]
25
28
  command = "cargo"
26
29
  args = ["build", "--examples", "--features", "libquil"]
27
30
 
31
+ [tasks.examples-experimental]
32
+ command = "cargo"
33
+ args = ["build", "--examples", "--features", "experimental"]
34
+
28
35
  [tasks.deny]
29
36
  install_crate = "cargo-deny"
30
37
  command = "cargo"
@@ -1,5 +1,4 @@
1
1
  #![deny(clippy::all)]
2
- #![deny(clippy::pedantic)]
3
2
  #![deny(clippy::cargo)]
4
3
  #![allow(clippy::multiple_crate_versions)] // This should be enforced by cargo-deny
5
4
  #![allow(clippy::missing_errors_doc)]
@@ -8,6 +7,7 @@
8
7
  #![forbid(unsafe_code)]
9
8
  #![warn(future_incompatible)]
10
9
  #![warn(rust_2018_compatibility, rust_2018_idioms)]
10
+ #![warn(clippy::pedantic)]
11
11
  #![warn(
12
12
  absolute_paths_not_starting_with_crate,
13
13
  anonymous_parameters,
@@ -0,0 +1,10 @@
1
+ //! This module supports experimental features that meet the following criteria:
2
+ //!
3
+ //! * They support recent and compelling research in quantum computing.
4
+ //! * Implementation is specific to Rigetti's QPUs; implementation may
5
+ //! not othewrise be expressed through a generalized quantum computing
6
+ //! language, such as Quil or QASM.
7
+ //!
8
+ //! As such, the features contained herein should be considered unstable, possibly
9
+ //! ephemeral, and subject to specific authorization checks.
10
+ pub mod random;
@@ -0,0 +1,372 @@
1
+ //! This module supports low-level primitives for randomization on Rigetti's QPUs.
2
+ use std::{convert::TryFrom, ops::BitXor};
3
+
4
+ use num::{complex::Complex64, ToPrimitive};
5
+ use quil_rs::instruction::{ExternParameter, ExternParameterType, ExternSignature};
6
+ use quil_rs::{
7
+ instruction::{Call, CallError, ExternError, UnresolvedCallArgument},
8
+ quil::ToQuilError,
9
+ };
10
+
11
+ /// Hardware values are 48 bits long.
12
+ const MAX_SEQUENCER_VALUE: u64 = 0x0000_FFFF_FFFF_FFFF;
13
+
14
+ /// Hardware multiplication currently uses the lower 16 bits of
15
+ /// the PRNG value.
16
+ const MAX_UNSIGNED_MULTIPLIER: u64 = 0x0000_0000_0000_FFFF;
17
+
18
+ /// The taps for the LFSR used on Rigetti control systems. These taps
19
+ /// have been shown to produce maximal sequence lengths for 48-bit
20
+ /// strings.
21
+ const V1_TAPS: [u32; 4] = [47, 46, 20, 19];
22
+
23
+ /// An error that may occur using the randomization primitives defined
24
+ /// in this module.
25
+ #[derive(Debug, thiserror::Error)]
26
+ pub enum Error {
27
+ /// An invalid seed value was provided.
28
+ #[error(
29
+ "seed values must be in range [1, {MAX_SEQUENCER_VALUE}] and losslessly convertible to f64, found {0}"
30
+ )]
31
+ InvalidSeed(u64),
32
+ /// An error occurred while converting to Quil.
33
+ #[error("error converting to Quil: {0}")]
34
+ ToQuilError(#[from] ToQuilError),
35
+ /// An error occurred while constructing an extern signature.
36
+ #[error("error constructing extern signature: {0}")]
37
+ ExternSignatureError(#[from] ExternError),
38
+ /// The destination must be a `REAL[]`.
39
+ #[error("destination must be a REAL[], found {destination_type:?}")]
40
+ InvalidDestinationType {
41
+ /// The type on the destination declaration.
42
+ destination_type: quil_rs::instruction::ScalarType,
43
+ },
44
+ /// The source must be a `REAL[]`.
45
+ #[error("source must be a REAL[], found {source_type:?}")]
46
+ InvalidSourceType {
47
+ /// The type on the source declaration.
48
+ source_type: quil_rs::instruction::ScalarType,
49
+ },
50
+ /// The destination length must be divisible by the sub-region size.
51
+ #[error(
52
+ "destination length must be in range [0, {}] and divisible by the sub-region size, found {destination_length} % {sub_region_size}", 2u64.pow(f64::MANTISSA_DIGITS) - 1
53
+ )]
54
+ InvalidDestinationLength {
55
+ /// The length of the destination declaration.
56
+ destination_length: u64,
57
+ /// The size of each sub-region in source and destination memory arrays.
58
+ sub_region_size: f64,
59
+ },
60
+ /// The source length must be divisible by the sub-region size.
61
+ #[error(
62
+ "source length must be in range [0, {}] and divisible by the sub-region size, found {source_length} % {sub_region_size}", 2u64.pow(f64::MANTISSA_DIGITS) - 1
63
+ )]
64
+ InvalidSourceLength {
65
+ /// The length of the source declaration.
66
+ source_length: u64,
67
+ /// The size of each sub-region in source and destination memory arrays.
68
+ sub_region_size: f64,
69
+ },
70
+ }
71
+
72
+ /// A specialized `Result` type for hardware extern function calls.
73
+ #[allow(clippy::module_name_repetitions)]
74
+ pub type RandomResult<T> = Result<T, Error>;
75
+
76
+ /// An [`ExternedCall`] that may be used to select one or more random
77
+ /// sub-regions from a source array of real values to a destination array.
78
+ #[derive(Debug, Clone)]
79
+ pub struct ChooseRandomRealSubRegions {
80
+ destination_memory_region_name: String,
81
+ source_memory_region_name: String,
82
+ sub_region_size: f64,
83
+ seed_memory_region_name: String,
84
+ }
85
+
86
+ impl ChooseRandomRealSubRegions {
87
+ /// Create a new instance of [`ChooseRandomRealSubRegions`].
88
+ ///
89
+ /// # Parameters
90
+ ///
91
+ /// * `destination` - The name of the destination array.
92
+ /// * `source` - The identifier of the source array.
93
+ /// * `sub_region_size` - The size of the sub-regions to select from
94
+ /// the source array. Note, `len(source) % sub_region_size` and
95
+ /// `len(destination) % sub_region_size` must be zero.
96
+ /// * `seed` - The name of the seed value.
97
+ ///
98
+ /// The values provided for `destination`, `source`, and `seed` must
99
+ /// be declared within the Quil program where the call is made.
100
+ pub fn try_new<T: Into<f64> + Copy>(
101
+ destination: &quil_rs::instruction::Declaration,
102
+ source: &quil_rs::instruction::Declaration,
103
+ sub_region_size: T,
104
+ seed: &quil_rs::instruction::MemoryReference,
105
+ ) -> RandomResult<Self> {
106
+ if !matches!(
107
+ destination.size.data_type,
108
+ quil_rs::instruction::ScalarType::Real
109
+ ) {
110
+ return Err(Error::InvalidDestinationType {
111
+ destination_type: destination.size.data_type,
112
+ });
113
+ }
114
+ if !matches!(
115
+ source.size.data_type,
116
+ quil_rs::instruction::ScalarType::Real
117
+ ) {
118
+ return Err(Error::InvalidSourceType {
119
+ source_type: source.size.data_type,
120
+ });
121
+ }
122
+ if destination
123
+ .size
124
+ .length
125
+ .to_f64()
126
+ .is_none_or(|destination_length| destination_length % sub_region_size.into() != 0f64)
127
+ {
128
+ return Err(Error::InvalidDestinationLength {
129
+ destination_length: destination.size.length,
130
+ sub_region_size: sub_region_size.into(),
131
+ });
132
+ }
133
+
134
+ if source
135
+ .size
136
+ .length
137
+ .to_f64()
138
+ .is_none_or(|source_length| source_length % sub_region_size.into() != 0f64)
139
+ {
140
+ return Err(Error::InvalidSourceLength {
141
+ source_length: source.size.length,
142
+ sub_region_size: sub_region_size.into(),
143
+ });
144
+ }
145
+
146
+ Ok(Self {
147
+ destination_memory_region_name: destination.name.clone(),
148
+ source_memory_region_name: source.name.clone(),
149
+ sub_region_size: sub_region_size.into(),
150
+ seed_memory_region_name: seed.name.clone(),
151
+ })
152
+ }
153
+
154
+ /// The name of the function referenced by the `PRAGMA EXTERN` and `CALL` instructions.
155
+ pub const EXTERN_NAME: &str = "choose_random_real_sub_regions";
156
+
157
+ #[allow(clippy::doc_markdown)]
158
+ /// Build the signature for the `PRAGMA EXTERN choose_random_real_sub_regions`
159
+ /// instruction. The signature expressed in Quil is as follows:
160
+ ///
161
+ /// ```text
162
+ /// "(destination : mut REAL[], source : REAL[], sub_region_size : INTEGER, seed : mut INTEGER)"
163
+ /// ```
164
+ pub fn build_signature() -> RandomResult<ExternSignature> {
165
+ vec![
166
+ ExternParameter::try_new(
167
+ "destination".to_string(),
168
+ true,
169
+ ExternParameterType::VariableLengthVector(quil_rs::instruction::ScalarType::Real),
170
+ ),
171
+ ExternParameter::try_new(
172
+ "source".to_string(),
173
+ false,
174
+ ExternParameterType::VariableLengthVector(quil_rs::instruction::ScalarType::Real),
175
+ ),
176
+ ExternParameter::try_new(
177
+ "sub_region_size".to_string(),
178
+ false,
179
+ ExternParameterType::Scalar(quil_rs::instruction::ScalarType::Integer),
180
+ ),
181
+ ExternParameter::try_new(
182
+ "seed".to_string(),
183
+ true,
184
+ ExternParameterType::Scalar(quil_rs::instruction::ScalarType::Integer),
185
+ ),
186
+ ]
187
+ .into_iter()
188
+ .map(|r| r.map_err(Error::from))
189
+ .collect::<RandomResult<Vec<ExternParameter>>>()
190
+ .map(|parameters| ExternSignature::new(None, parameters))
191
+ }
192
+
193
+ /// Build a `PRAGMA EXTERN` instruction for the externed function.
194
+ pub(super) fn pragma_extern() -> Result<quil_rs::instruction::Pragma, Error> {
195
+ use quil_rs::quil::Quil;
196
+
197
+ Ok(quil_rs::instruction::Pragma::new(
198
+ quil_rs::instruction::RESERVED_PRAGMA_EXTERN.to_string(),
199
+ vec![quil_rs::instruction::PragmaArgument::Identifier(
200
+ Self::EXTERN_NAME.to_string(),
201
+ )],
202
+ Some(Self::build_signature()?.to_quil().map_err(Error::from)?),
203
+ ))
204
+ }
205
+ }
206
+
207
+ impl TryFrom<ChooseRandomRealSubRegions> for Call {
208
+ type Error = CallError;
209
+
210
+ fn try_from(value: ChooseRandomRealSubRegions) -> Result<Self, Self::Error> {
211
+ Self::try_new(
212
+ ChooseRandomRealSubRegions::EXTERN_NAME.to_string(),
213
+ vec![
214
+ UnresolvedCallArgument::Identifier(value.destination_memory_region_name),
215
+ UnresolvedCallArgument::Identifier(value.source_memory_region_name),
216
+ UnresolvedCallArgument::Immediate(Complex64 {
217
+ re: value.sub_region_size,
218
+ im: 0.0,
219
+ }),
220
+ UnresolvedCallArgument::Identifier(value.seed_memory_region_name),
221
+ ],
222
+ )
223
+ }
224
+ }
225
+
226
+ /// A valid seed value that may be used to initialize the PRNG. Such
227
+ /// values are in the range `[1, MAX_SEQUENCER_VALUE]` and are losslessly
228
+ /// convertible to `f64`.
229
+ #[derive(Debug, Clone, Copy)]
230
+ pub struct PrngSeedValue {
231
+ u64_value: u64,
232
+ f64_value: f64,
233
+ }
234
+
235
+ impl PrngSeedValue {
236
+ /// Attempt to create a new instance of `PrngSeedValue` from a `u64`.
237
+ /// The value must be in the range `[1, MAX_SEQUENCER_VALUE]` and
238
+ /// losslessly convertible to `f64`.
239
+ pub fn try_new(value: u64) -> RandomResult<Self> {
240
+ if !(1..=MAX_SEQUENCER_VALUE).contains(&value) {
241
+ return Err(Error::InvalidSeed(value));
242
+ }
243
+ if let Some(f64_value) = value.to_f64() {
244
+ Ok(Self {
245
+ u64_value: value,
246
+ f64_value,
247
+ })
248
+ } else {
249
+ Err(Error::InvalidSeed(value))
250
+ }
251
+ }
252
+
253
+ pub(super) fn as_f64(&self) -> f64 {
254
+ self.f64_value
255
+ }
256
+ }
257
+
258
+ fn lfsr_next(seed: u64, taps: &[u32]) -> u64 {
259
+ let feedback_value = taps.iter().fold(0, |acc, tap| {
260
+ let base = 2u64.pow(*tap);
261
+ let bit = u64::from((seed & base) != 0);
262
+ acc.bitxor(bit)
263
+ });
264
+ ((seed << 1) & MAX_SEQUENCER_VALUE) | feedback_value
265
+ }
266
+
267
+ /// This represents the [linear feedback shift
268
+ /// register](https://en.wikipedia.org/wiki/Linear-feedback_shift_register)
269
+ /// currently implemented on Rigetti control systems. Specifically,
270
+ /// it implements a 48-bit LFSR with taps at 0-based indices 47, 46, 20, and 19.
271
+ /// The taps have been shown to produce maximal sequence lengths for 48-bit strings.
272
+ #[must_use]
273
+ pub fn lfsr_v1_next(seed: PrngSeedValue) -> u64 {
274
+ lfsr_next(seed.u64_value, &V1_TAPS)
275
+ }
276
+
277
+ fn generate_lfsr_v1_sequence(seed: u64, start_index: u32, series_length: u32) -> Vec<u64> {
278
+ let mut lfsr = seed & MAX_SEQUENCER_VALUE;
279
+
280
+ let range = start_index..(start_index + series_length);
281
+ let mut collection = vec![];
282
+ for i in 0..(start_index + series_length) {
283
+ lfsr = lfsr_next(lfsr, &V1_TAPS);
284
+ if range.contains(&i) {
285
+ collection.push(lfsr);
286
+ }
287
+ }
288
+ collection
289
+ }
290
+
291
+ fn prng_value_to_sub_region_index(value: u64, sub_region_count: u8) -> u8 {
292
+ ((value & MAX_UNSIGNED_MULTIPLIER) % u64::from(sub_region_count))
293
+ .to_u8()
294
+ .expect("modulo u8 should always produce a valid value")
295
+ }
296
+
297
+ /// Given a seed, start index, series length, and sub-region count, this function
298
+ /// will generate and return the sequence of pseudo-randomly chosen indices on
299
+ /// the Rigetti control systems.
300
+ ///
301
+ /// For instance, if the following Quil program is run for 100 shots:
302
+ ///
303
+ /// ```quil
304
+ /// # presumed sub-region size is 3.
305
+ /// DECLARE destination REAL[6] # prng invocations per shot = (6 / sub_region_size) = 2
306
+ /// DECLARE source REAL[12] # implicit sub-region count = (12 / sub_region_size) = 4
307
+ /// DECLARE seed INTEGER[1]
308
+ /// DECLARE ro BIT[1]
309
+ ///
310
+ /// DELAY 0 1e-6
311
+ ///
312
+ /// PRAGMA EXTERN choose_random_real_sub_regions "(destination : mut REAL[], source : REAL[], sub_region_size : INTEGER, seed : mut INTEGER)"
313
+ /// CALL choose_random_real_sub_regions destination source 3 seed
314
+ /// ```
315
+ ///
316
+ /// with a seed of 639,523, the following will provide the random sequence of sub-region indices:
317
+ ///
318
+ /// ```rust
319
+ /// use qcs::qpu::experimental::random::{choose_random_real_sub_region_indices, PrngSeedValue};
320
+ ///
321
+ /// let seed = PrngSeedValue::try_new(639_523).unwrap();
322
+ /// let start_index = 0;
323
+ /// let prng_invocations_per_shot = 2;
324
+ /// let shot_count = 100;
325
+ /// let series_length = prng_invocations_per_shot * shot_count;
326
+ /// let sub_region_count = 4;
327
+ /// let _random_indices = choose_random_real_sub_region_indices(seed, start_index, series_length, sub_region_count);
328
+ /// ```
329
+ #[must_use]
330
+ pub fn choose_random_real_sub_region_indices(
331
+ seed: PrngSeedValue,
332
+ start_index: u32,
333
+ series_length: u32,
334
+ sub_region_count: u8,
335
+ ) -> Vec<u8> {
336
+ generate_lfsr_v1_sequence(seed.u64_value, start_index, series_length)
337
+ .iter()
338
+ .map(|&value| prng_value_to_sub_region_index(value, sub_region_count))
339
+ .collect()
340
+ }
341
+
342
+ #[cfg(test)]
343
+ mod tests {
344
+ use std::{collections::HashMap, fs::File};
345
+
346
+ /// These are values that have been validated as final memory read off Rigetti QPUs.
347
+ fn prng_sequences() -> HashMap<u32, Vec<(u64, u64)>> {
348
+ serde_json::de::from_reader(
349
+ File::open(concat!(
350
+ env!("CARGO_MANIFEST_DIR"),
351
+ "/tests/prng_test_cases.json"
352
+ ))
353
+ .unwrap(),
354
+ )
355
+ .unwrap()
356
+ }
357
+
358
+ #[test]
359
+ fn test_lfsr_v1_next() {
360
+ for (num_shots, sequences) in prng_sequences() {
361
+ for (seed, expected) in sequences {
362
+ let sequence = super::generate_lfsr_v1_sequence(seed, num_shots - 1, 1);
363
+ assert_eq!(sequence.len(), 1);
364
+ let end_of_sequence = sequence[0];
365
+ assert_eq!(
366
+ end_of_sequence, expected,
367
+ "seed={seed}, num_shots={num_shots}",
368
+ );
369
+ }
370
+ }
371
+ }
372
+ }
@@ -16,6 +16,8 @@ use tokio::time::error::Elapsed;
16
16
 
17
17
  pub mod api;
18
18
  mod execution;
19
+ #[cfg(feature = "experimental")]
20
+ pub mod experimental;
19
21
  pub mod result_data;
20
22
  pub mod translation;
21
23