azure-quantum 1.2.0__tar.gz → 1.2.1__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 (89) hide show
  1. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/PKG-INFO +1 -1
  2. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/_version.py +1 -1
  3. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/__init__.py +2 -1
  4. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/job.py +1 -1
  5. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/__init__.py +2 -1
  6. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/backends/__init__.py +6 -0
  7. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/provider.py +14 -12
  8. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/elements/dft/job.py +1 -1
  9. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/pasqal/result.py +4 -4
  10. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/pasqal/target.py +26 -1
  11. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/rigetti/result.py +15 -10
  12. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/rigetti/target.py +19 -0
  13. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/target.py +1 -1
  14. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/version.py +1 -1
  15. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/workspace.py +286 -111
  16. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure_quantum.egg-info/PKG-INFO +1 -1
  17. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/README.md +0 -0
  18. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/__init__.py +0 -0
  19. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_authentication/__init__.py +0 -0
  20. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_authentication/_chained.py +0 -0
  21. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_authentication/_default.py +0 -0
  22. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_authentication/_token.py +0 -0
  23. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/__init__.py +0 -0
  24. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/_client.py +0 -0
  25. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/_configuration.py +0 -0
  26. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/_patch.py +0 -0
  27. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/_serialization.py +0 -0
  28. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/_vendor.py +0 -0
  29. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/models/__init__.py +0 -0
  30. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/models/_enums.py +0 -0
  31. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/models/_models.py +0 -0
  32. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/models/_patch.py +0 -0
  33. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/operations/__init__.py +0 -0
  34. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/operations/_operations.py +0 -0
  35. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_client/operations/_patch.py +0 -0
  36. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_constants.py +0 -0
  37. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/_workspace_connection_params.py +0 -0
  38. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/argument_types/__init__.py +0 -0
  39. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/argument_types/types.py +0 -0
  40. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/chemistry/__init__.py +0 -0
  41. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/cirq/__init__.py +0 -0
  42. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/cirq/job.py +0 -0
  43. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/cirq/service.py +0 -0
  44. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/cirq/targets/__init__.py +0 -0
  45. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/cirq/targets/ionq.py +0 -0
  46. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/cirq/targets/quantinuum.py +0 -0
  47. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/cirq/targets/target.py +0 -0
  48. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/base_job.py +0 -0
  49. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/filtered_job.py +0 -0
  50. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/job_failed_with_results_error.py +0 -0
  51. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/session.py +0 -0
  52. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/workspace_item.py +0 -0
  53. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/job/workspace_item_factory.py +0 -0
  54. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/backends/backend.py +0 -0
  55. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/backends/ionq.py +0 -0
  56. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/backends/microsoft.py +0 -0
  57. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/backends/qci.py +0 -0
  58. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/backends/quantinuum.py +0 -0
  59. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/backends/rigetti.py +0 -0
  60. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/job.py +0 -0
  61. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/results/__init__.py +0 -0
  62. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/qiskit/results/resource_estimator.py +0 -0
  63. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/storage.py +0 -0
  64. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/__init__.py +0 -0
  65. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/ionq.py +0 -0
  66. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/__init__.py +0 -0
  67. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/elements/__init__.py +0 -0
  68. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/elements/dft/__init__.py +0 -0
  69. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/elements/dft/target.py +0 -0
  70. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/job.py +0 -0
  71. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/result.py +0 -0
  72. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/microsoft/target.py +0 -0
  73. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/params.py +0 -0
  74. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/pasqal/__init__.py +0 -0
  75. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/quantinuum.py +0 -0
  76. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/rigetti/__init__.py +0 -0
  77. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure/quantum/target/target_factory.py +0 -0
  78. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure_quantum.egg-info/SOURCES.txt +0 -0
  79. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure_quantum.egg-info/dependency_links.txt +0 -0
  80. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure_quantum.egg-info/requires.txt +0 -0
  81. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/azure_quantum.egg-info/top_level.txt +0 -0
  82. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/requirements-cirq.txt +0 -0
  83. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/requirements-dev.txt +0 -0
  84. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/requirements-qiskit.txt +0 -0
  85. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/requirements-qsharp.txt +0 -0
  86. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/requirements-quil.txt +0 -0
  87. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/requirements.txt +0 -0
  88. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/setup.cfg +0 -0
  89. {azure-quantum-1.2.0 → azure-quantum-1.2.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azure-quantum
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Python client for Azure Quantum
5
5
  Home-page: https://github.com/microsoft/azure-quantum-python
6
6
  Author: Microsoft
@@ -6,4 +6,4 @@
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
8
 
9
- VERSION = "1.2.0"
9
+ VERSION = "1.2.1"
@@ -8,7 +8,7 @@
8
8
  from azure.quantum._client.models import JobDetails
9
9
  from .base_job import BaseJob
10
10
  from .filtered_job import FilteredJob
11
- from .job import Job
11
+ from .job import Job, ContentType
12
12
  from .job_failed_with_results_error import JobFailedWithResultsError
13
13
  from .workspace_item import WorkspaceItem
14
14
  from .workspace_item_factory import WorkspaceItemFactory
@@ -17,6 +17,7 @@ from .session import Session, SessionHost, SessionDetails, SessionStatus, Sessio
17
17
  __all__ = [
18
18
  "Job",
19
19
  "JobDetails",
20
+ "ContentType",
20
21
  "BaseJob",
21
22
  "FilteredJob",
22
23
  "WorkspaceItem",
@@ -114,7 +114,7 @@ class Job(BaseJob, FilteredJob):
114
114
  :param timeout_secs: Timeout in seconds, defaults to 300
115
115
  :type timeout_secs: float
116
116
  :return: Results dictionary with histogram shots, or raw results if not a json object.
117
- :rtype: Any
117
+ :rtype: typing.Any
118
118
  """
119
119
  if self.results is not None:
120
120
  return self.results
@@ -5,10 +5,11 @@
5
5
 
6
6
  """Azure Quantum Qiskit Provider"""
7
7
 
8
- from .provider import AzureQuantumProvider
8
+ from .provider import AzureQuantumProvider, AzureQuantumJob
9
9
  from azure.quantum import __version__
10
10
 
11
11
  __all__ = [
12
12
  "AzureQuantumProvider",
13
+ "AzureQuantumJob",
13
14
  "__version__"
14
15
  ]
@@ -43,3 +43,9 @@ from azure.quantum.qiskit.backends.microsoft import (
43
43
  MicrosoftBackend,
44
44
  MicrosoftResourceEstimationBackend,
45
45
  )
46
+
47
+ from .backend import AzureBackendBase
48
+
49
+ __all__ = [
50
+ "AzureBackendBase"
51
+ ]
@@ -6,7 +6,7 @@
6
6
  import warnings
7
7
  import inspect
8
8
  from itertools import groupby
9
- from typing import Dict, List, Tuple, Type
9
+ from typing import Dict, List, Optional, Tuple, Type
10
10
  from azure.quantum import Workspace
11
11
 
12
12
  try:
@@ -24,17 +24,13 @@ from azure.quantum.qiskit.backends.backend import AzureBackendBase
24
24
  from azure.quantum.qiskit.job import AzureQuantumJob
25
25
  from azure.quantum.qiskit.backends import *
26
26
 
27
-
28
27
  QISKIT_USER_AGENT = "azure-quantum-qiskit"
29
28
 
30
-
31
29
  class AzureQuantumProvider(Provider):
32
- """
33
- Class for interfacing with the Azure Quantum service
34
- using Qiskit quantum circuits
35
- """
36
- def __init__(self, workspace: Workspace=None, **kwargs):
37
- """AzureQuantumService class
30
+
31
+ def __init__(self, workspace: Optional[Workspace]=None, **kwargs):
32
+ """Class for interfacing with the Azure Quantum service
33
+ using Qiskit quantum circuits.
38
34
 
39
35
  :param workspace: Azure Quantum workspace. If missing it will create a new Workspace passing `kwargs` to the constructor. Defaults to None.
40
36
  :type workspace: Workspace
@@ -66,7 +62,7 @@ class AzureQuantumProvider(Provider):
66
62
  name (str): name of the backend.
67
63
  **kwargs: dict used for filtering.
68
64
  Returns:
69
- Backend: a backend matching the filtering.
65
+ azure.quantum.qiskit.backends.AzureBackendBase: a backend matching the filtering.
70
66
  Raises:
71
67
  QiskitBackendNotFoundError: if no backend could be found or
72
68
  more than one backend matches the filtering criteria.
@@ -110,7 +106,7 @@ see https://aka.ms/AQ/Docs/AddProvider"
110
106
  name (str): name of the backend.
111
107
  **kwargs: dict used for filtering.
112
108
  Returns:
113
- typing.List[qiskit.providers.BackendV1]: a list of Backends that match the filtering
109
+ typing.List[azure.quantum.qiskit.backends.AzureBackendBase]: a list of Backends that match the filtering
114
110
  criteria.
115
111
  """
116
112
 
@@ -143,7 +139,13 @@ see https://aka.ms/AQ/Docs/AddProvider"
143
139
  return backends
144
140
 
145
141
  def get_job(self, job_id) -> AzureQuantumJob:
146
- """Returns the Job instance associated with the given id."""
142
+ """Returns the Job instance associated with the given id.
143
+
144
+ Args:
145
+ job_id (str): Id of the Job to return.
146
+ Returns:
147
+ AzureQuantumJob: Job instance.
148
+ """
147
149
  azure_job = self._workspace.get_job(job_id)
148
150
  backend = self.get_backend(azure_job.details.target)
149
151
  return AzureQuantumJob(backend, azure_job)
@@ -30,7 +30,7 @@ class MicrosoftElementsDftJob(Job):
30
30
  :raises: :class:`RuntimeError` if job execution failed.
31
31
  :raises: :class:`azure.quantum.job.JobFailedWithResultsError` if job execution failed,
32
32
  but failure results could still be retrieved.
33
- :return: Results dictionary with histogram shots, or raw results if not a json object.
33
+ :return: Results dictionary.
34
34
  """
35
35
 
36
36
  try:
@@ -26,16 +26,16 @@ class Result:
26
26
  job = Job(...) # This job should come from a Pasqal target
27
27
  job.wait_until_completed()
28
28
  result = Result(job)
29
-
30
29
  """
31
30
 
32
31
  def __init__(self, job: Job) -> None:
33
32
  """
34
33
  Decode the results of a Job with output type of "pasqal.pulser-results.v1"
35
34
 
36
- :param job: Azure Quantum job
37
- :type job: Job
38
- :raises: RuntimeError if the job has not completed successfully
35
+ Args:
36
+ job (Job): Azure Quantum job
37
+ Raises:
38
+ RuntimeError: if the job has not completed successfully
39
39
  """
40
40
 
41
41
  if job.details.status != "Succeeded":
@@ -25,6 +25,8 @@ class PasqalTarget(str, Enum):
25
25
  """
26
26
 
27
27
  SIM_EMU_TN = "pasqal.sim.emu-tn"
28
+ """pasqal.sim.emu-tn target"""
29
+
28
30
  QPU_FRESNEL = "pasqal.qpu.fresnel"
29
31
  """A simulator target for Quil. See https://github.com/quil-lang/qvm for more info."""
30
32
 
@@ -52,7 +54,11 @@ class PasqalTarget(str, Enum):
52
54
 
53
55
  @dataclass
54
56
  class InputParams:
55
- """Input parameters"""
57
+ """Input parameters
58
+
59
+ Args:
60
+ runs (int): The number of times to run the experiment.
61
+ """
56
62
 
57
63
  runs: int = 1
58
64
  """The number of times to run the experiment."""
@@ -79,6 +85,25 @@ class Pasqal(Target):
79
85
  encoding: str = "",
80
86
  **kwargs,
81
87
  ):
88
+ """
89
+ Initializes a new target.
90
+
91
+ :param workspace: Associated workspace
92
+ :type workspace: Workspace
93
+ :param name: Target name
94
+ :type name: str
95
+ :param input_data_format: Format of input data (ex. "pasqal.pulser.v1")
96
+ :type input_data_format: str
97
+ :param output_data_format: Format of output data (ex. "pasqal.pulser-results.v1")
98
+ :type output_data_format: str
99
+ :param capability: QIR capability
100
+ :type capability: str
101
+ :param provider_id: Id of provider (ex. "pasqal")
102
+ :type provider_id: str
103
+ :param encoding: "Content-Encoding" attribute value to set on input blob (ex. "gzip")
104
+ :type encoding: str
105
+ """
106
+
82
107
  super().__init__(
83
108
  workspace=workspace,
84
109
  name=name,
@@ -21,22 +21,26 @@ RawData = Union[int, float, List[float]]
21
21
  class Result:
22
22
  """Downloads the data of a completed Job and extracts the ``Readout`` for each register.
23
23
 
24
- >>> from azure.quantum.job import Job
25
- >>> from azure.quantum.target.rigetti import Result
26
- >>> job = Job(...) # This job should come from a Rigetti target
27
- >>> job.wait_until_completed()
28
- >>> result = Result(job)
29
- >>> ro_data = result["ro"]
30
- >>> first_shot_data = ro_data[0]
24
+ .. highlight:: python
25
+ .. code-block::
26
+
27
+ from azure.quantum.job import Job
28
+ from azure.quantum.target.rigetti import Result
29
+ job = Job(...) # This job should come from a Rigetti target
30
+ job.wait_until_completed()
31
+ result = Result(job)
32
+ ro_data = result["ro"]
33
+ first_shot_data = ro_data[0]
31
34
  """
32
35
 
33
36
  def __init__(self, job: Job) -> None:
34
37
  """
35
38
  Decode the results of a Job with output type of "rigetti.quil-results.v1"
36
39
 
37
- :param job: Azure Quantum Job
38
- :type job: Job
39
- :raises: RuntimeError if the job has not completed successfully
40
+ Args:
41
+ job (Job): Azure Quantum job
42
+ Raises:
43
+ RuntimeError: if the job has not completed successfully
40
44
  """
41
45
 
42
46
  if job.details.status != "Succeeded":
@@ -53,6 +57,7 @@ class Result:
53
57
 
54
58
 
55
59
  T = TypeVar("T", bound=Union[int, float, complex])
60
+
56
61
  Readout = List[List[T]]
57
62
  """Contains the data of a declared "readout" memory region, usually the ``ro`` register.
58
63
 
@@ -146,6 +146,25 @@ class Rigetti(Target):
146
146
  encoding: str = "",
147
147
  **kwargs,
148
148
  ):
149
+ """
150
+ Initializes a new target.
151
+
152
+ :param workspace: Associated workspace
153
+ :type workspace: Workspace
154
+ :param name: Target name
155
+ :type name: str
156
+ :param input_data_format: Format of input data (ex. "rigetti.quil.v1")
157
+ :type input_data_format: str
158
+ :param output_data_format: Format of output data (ex. "rigetti.quil-results.v1")
159
+ :type output_data_format: str
160
+ :param capability: QIR capability
161
+ :type capability: str
162
+ :param provider_id: Id of provider (ex. "rigetti")
163
+ :type provider_id: str
164
+ :param encoding: "Content-Encoding" attribute value to set on input blob (ex. "gzip")
165
+ :type encoding: str
166
+ """
167
+
149
168
  super().__init__(
150
169
  workspace=workspace,
151
170
  name=name,
@@ -77,7 +77,7 @@ class Target(abc.ABC, SessionHost):
77
77
  :param provider_id: Id of provider (ex. "microsoft-qc")
78
78
  :type provider_id: str
79
79
  :param content_type: "Content-Type" attribute value to set on input blob (ex. "application/json")
80
- :type content_type: ContentType
80
+ :type content_type: azure.quantum.job.ContentType
81
81
  :param encoding: "Content-Encoding" attribute value to set on input blob (ex. "gzip")
82
82
  :type encoding: str
83
83
  :param average_queue_time: Set average queue time (for internal use)
@@ -5,4 +5,4 @@
5
5
  # Copyright (c) Microsoft Corporation. All rights reserved.
6
6
  # Licensed under the MIT License.
7
7
  ##
8
- __version__ = "1.2.0"
8
+ __version__ = "1.2.1"