azure-quantum 3.1.1.dev1__tar.gz → 3.2.0__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 (84) hide show
  1. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/PKG-INFO +1 -1
  2. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/_version.py +1 -1
  3. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/cirq/targets/quantinuum.py +2 -1
  4. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/backends/ionq.py +3 -1
  5. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/params.py +1 -1
  6. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/rigetti/target.py +5 -0
  7. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/target.py +1 -1
  8. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/version.py +1 -1
  9. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure_quantum.egg-info/PKG-INFO +1 -1
  10. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure_quantum.egg-info/SOURCES.txt +0 -2
  11. azure_quantum-3.1.1.dev1/azure/quantum/chemistry/__init__.py +0 -13
  12. azure_quantum-3.1.1.dev1/azure/quantum/target/microsoft/target.py +0 -142
  13. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/README.md +0 -0
  14. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/__init__.py +0 -0
  15. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_authentication/__init__.py +0 -0
  16. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_authentication/_chained.py +0 -0
  17. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_authentication/_default.py +0 -0
  18. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_authentication/_token.py +0 -0
  19. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/__init__.py +0 -0
  20. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/_client.py +0 -0
  21. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/_configuration.py +0 -0
  22. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/_model_base.py +0 -0
  23. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/_patch.py +0 -0
  24. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/_serialization.py +0 -0
  25. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/models/__init__.py +0 -0
  26. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/models/_enums.py +0 -0
  27. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/models/_models.py +0 -0
  28. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/models/_patch.py +0 -0
  29. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/operations/__init__.py +0 -0
  30. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/operations/_operations.py +0 -0
  31. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_client/operations/_patch.py +0 -0
  32. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_constants.py +0 -0
  33. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/_workspace_connection_params.py +0 -0
  34. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/argument_types/__init__.py +0 -0
  35. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/argument_types/types.py +0 -0
  36. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/cirq/__init__.py +0 -0
  37. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/cirq/job.py +0 -0
  38. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/cirq/service.py +0 -0
  39. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/cirq/targets/__init__.py +0 -0
  40. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/cirq/targets/ionq.py +0 -0
  41. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/cirq/targets/target.py +0 -0
  42. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/__init__.py +0 -0
  43. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/base_job.py +0 -0
  44. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/filtered_job.py +0 -0
  45. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/job.py +0 -0
  46. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/job_failed_with_results_error.py +0 -0
  47. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/session.py +0 -0
  48. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/workspace_item.py +0 -0
  49. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/job/workspace_item_factory.py +0 -0
  50. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/__init__.py +0 -0
  51. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/backends/__init__.py +0 -0
  52. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/backends/backend.py +0 -0
  53. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/backends/qci.py +0 -0
  54. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/backends/quantinuum.py +0 -0
  55. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/backends/rigetti.py +0 -0
  56. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/job.py +0 -0
  57. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/qiskit/provider.py +0 -0
  58. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/storage.py +0 -0
  59. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/__init__.py +0 -0
  60. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/ionq.py +0 -0
  61. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/microsoft/elements/__init__.py +0 -0
  62. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/microsoft/elements/dft/__init__.py +0 -0
  63. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/microsoft/elements/dft/job.py +0 -0
  64. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/microsoft/elements/dft/target.py +0 -0
  65. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/pasqal/__init__.py +0 -0
  66. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/pasqal/result.py +0 -0
  67. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/pasqal/target.py +0 -0
  68. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/quantinuum.py +0 -0
  69. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/rigetti/__init__.py +0 -0
  70. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/rigetti/result.py +0 -0
  71. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/target/target_factory.py +0 -0
  72. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure/quantum/workspace.py +0 -0
  73. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure_quantum.egg-info/dependency_links.txt +0 -0
  74. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure_quantum.egg-info/requires.txt +0 -0
  75. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/azure_quantum.egg-info/top_level.txt +0 -0
  76. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/requirements-cirq.txt +0 -0
  77. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/requirements-dev.txt +0 -0
  78. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/requirements-pulser.txt +0 -0
  79. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/requirements-qiskit.txt +0 -0
  80. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/requirements-qsharp.txt +0 -0
  81. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/requirements-quil.txt +0 -0
  82. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/requirements.txt +0 -0
  83. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/setup.cfg +0 -0
  84. {azure_quantum-3.1.1.dev1 → azure_quantum-3.2.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azure-quantum
3
- Version: 3.1.1.dev1
3
+ Version: 3.2.0
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 = "3.1.1.dev1"
9
+ VERSION = "3.2.0"
@@ -2,6 +2,7 @@
2
2
  # Copyright (c) Microsoft Corporation.
3
3
  # Licensed under the MIT License.
4
4
  ##
5
+ import json
5
6
  import numpy as np
6
7
 
7
8
  from typing import TYPE_CHECKING, Any, Dict, Sequence
@@ -97,7 +98,7 @@ class QuantinuumTarget(Quantinuum, CirqTarget):
97
98
  metadata = {
98
99
  "qubits": len(program.all_qubits()),
99
100
  "repetitions": repetitions,
100
- "measurement_dict": self._measurement_dict(program)
101
+ "measurement_dict": json.dumps(self._measurement_dict(program))
101
102
  }
102
103
  # Override metadata with value from kwargs
103
104
  metadata.update(kwargs.get("metadata", {}))
@@ -27,6 +27,8 @@ from qiskit_ionq.helpers import (
27
27
  if TYPE_CHECKING:
28
28
  from azure.quantum.qiskit import AzureQuantumProvider
29
29
 
30
+ import json
31
+
30
32
  import logging
31
33
 
32
34
  logger = logging.getLogger(__name__)
@@ -244,7 +246,7 @@ class IonQBackend(AzureBackend):
244
246
  _, _, meas_map = qiskit_circ_to_ionq_circ(circuit, gateset=self.gateset())
245
247
 
246
248
  metadata = super()._prepare_job_metadata(circuit, **kwargs)
247
- metadata["meas_map"] = meas_map
249
+ metadata["meas_map"] = json.dumps(meas_map)
248
250
 
249
251
  return metadata
250
252
 
@@ -250,4 +250,4 @@ class InputParams(InputParamsItem):
250
250
  if len(self.file_uris) > 0:
251
251
  result["fileUris"] = self.file_uris
252
252
 
253
- return result
253
+ return result
@@ -32,6 +32,8 @@ class RigettiTarget(str, Enum):
32
32
 
33
33
  ANKAA_3 = "rigetti.qpu.ankaa-3"
34
34
 
35
+ CEPHEUS_1_36Q = "rigetti.qpu.cepheus-1-36q"
36
+
35
37
  def simulators() -> List[str]:
36
38
  """Returns a list of simulator targets"""
37
39
  return [
@@ -42,6 +44,7 @@ class RigettiTarget(str, Enum):
42
44
  """Returns a list of QPU targets"""
43
45
  return [
44
46
  RigettiTarget.ANKAA_3.value,
47
+ RigettiTarget.CEPHEUS_1_36Q
45
48
  ]
46
49
 
47
50
  def num_qubits(target_name) -> int:
@@ -51,6 +54,8 @@ class RigettiTarget(str, Enum):
51
54
  return 20
52
55
  elif target_name == RigettiTarget.ANKAA_3.value:
53
56
  return 84
57
+ elif target_name == RigettiTarget.CEPHEUS_1_36Q.value:
58
+ return 36
54
59
  else:
55
60
  raise ValueError(f"Unknown target {target_name}")
56
61
 
@@ -84,7 +84,7 @@ class Target(abc.ABC, SessionHost):
84
84
  :type output_data_format: str
85
85
  :param capability: QIR capability. Deprecated, use `target_profile`
86
86
  :type capability: str
87
- :param provider_id: Id of provider (ex. "microsoft-qc")
87
+ :param provider_id: Id of provider
88
88
  :type provider_id: str
89
89
  :param content_type: "Content-Type" attribute value to set on input blob (ex. "application/json")
90
90
  :type content_type: azure.quantum.job.ContentType
@@ -5,4 +5,4 @@
5
5
  # Copyright (c) Microsoft Corporation. All rights reserved.
6
6
  # Licensed under the MIT License.
7
7
  ##
8
- __version__ = "3.1.1.dev1"
8
+ __version__ = "3.2.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: azure-quantum
3
- Version: 3.1.1.dev1
3
+ Version: 3.2.0
4
4
  Summary: Python client for Azure Quantum
5
5
  Home-page: https://github.com/microsoft/azure-quantum-python
6
6
  Author: Microsoft
@@ -33,7 +33,6 @@ azure/quantum/_client/operations/_operations.py
33
33
  azure/quantum/_client/operations/_patch.py
34
34
  azure/quantum/argument_types/__init__.py
35
35
  azure/quantum/argument_types/types.py
36
- azure/quantum/chemistry/__init__.py
37
36
  azure/quantum/cirq/__init__.py
38
37
  azure/quantum/cirq/job.py
39
38
  azure/quantum/cirq/service.py
@@ -64,7 +63,6 @@ azure/quantum/target/params.py
64
63
  azure/quantum/target/quantinuum.py
65
64
  azure/quantum/target/target.py
66
65
  azure/quantum/target/target_factory.py
67
- azure/quantum/target/microsoft/target.py
68
66
  azure/quantum/target/microsoft/elements/__init__.py
69
67
  azure/quantum/target/microsoft/elements/dft/__init__.py
70
68
  azure/quantum/target/microsoft/elements/dft/job.py
@@ -1,13 +0,0 @@
1
- ##
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License.
4
- ##
5
-
6
- from urllib.request import urlopen
7
-
8
- def df_chemistry() -> bytes:
9
- """
10
- Returns bitcode of a QIR program for the double-factorized chemistry
11
- quantum algorithm.
12
- """
13
- return urlopen("https://aka.ms/RE/df_chemistry").read()
@@ -1,142 +0,0 @@
1
- ##
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License.
4
- ##
5
- import re
6
- import warnings
7
- from dataclasses import dataclass, field
8
- from typing import Any, Dict, Optional, Type, Union, List
9
-
10
- from ...job import Job
11
- from ...job.base_job import ContentType
12
- from ...workspace import Workspace
13
- from ..params import InputParams, InputParamsItem, AutoValidatingParams, \
14
- validating_field
15
- from ..target import Target
16
-
17
- def _check_error_rate(name, value):
18
- if value <= 0.0 or value >= 1.0:
19
- raise ValueError(f"{name} must be between 0 and 1")
20
-
21
- def _check_error_rate_or_process_and_readout(name, value):
22
- if value is None:
23
- return
24
-
25
- if isinstance(value, float):
26
- _check_error_rate(name, value)
27
- return
28
-
29
- if not isinstance(value, MeasurementErrorRate):
30
- raise ValueError(f"{name} must be either a float or "
31
- "MeasurementErrorRate with two fields: 'process' and 'readout'")
32
-
33
- def check_time(name, value):
34
- pat = r"^(\+?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\s*(s|ms|μs|µs|us|ns)$"
35
- if re.match(pat, value) is None:
36
- raise ValueError(f"{name} is not a valid time string; use a "
37
- "suffix s, ms, us, or ns")
38
-
39
- @dataclass
40
- class MeasurementErrorRate(AutoValidatingParams):
41
- process: float = field(metadata={"validate": _check_error_rate})
42
- readout: float = field(metadata={"validate": _check_error_rate})
43
-
44
- @dataclass
45
- class ProtocolSpecificDistillationUnitSpecification(AutoValidatingParams):
46
- num_unit_qubits: Optional[int] = None
47
- duration_in_qubit_cycle_time: Optional[int] = None
48
-
49
- def post_validation(self, result):
50
- if self.num_unit_qubits is None:
51
- raise LookupError("num_unit_qubits must be set")
52
-
53
- if self.duration_in_qubit_cycle_time is None:
54
- raise LookupError("duration_in_qubit_cycle_time must be set")
55
-
56
-
57
- @dataclass
58
- class DistillationUnitSpecification(AutoValidatingParams):
59
- name: Optional[str] = None
60
- display_name: Optional[str] = None
61
- num_input_ts: Optional[int] = None
62
- num_output_ts: Optional[int] = None
63
- failure_probability_formula: Optional[str] = None
64
- output_error_rate_formula: Optional[str] = None
65
- physical_qubit_specification: Optional[ProtocolSpecificDistillationUnitSpecification] = None
66
- logical_qubit_specification: Optional[ProtocolSpecificDistillationUnitSpecification] = None
67
- logical_qubit_specification_first_round_override: \
68
- Optional[ProtocolSpecificDistillationUnitSpecification] = None
69
-
70
- def has_custom_specification(self):
71
- return \
72
- self.display_name is not None \
73
- or self.num_input_ts is not None \
74
- or self.num_output_ts is not None \
75
- or self.failure_probability_formula is not None \
76
- or self.output_error_rate_formula is not None \
77
- or self.physical_qubit_specification is not None \
78
- or self.logical_qubit_specification is not None \
79
- or self.logical_qubit_specification_first_round_override is not None
80
-
81
- def has_predefined_name(self):
82
- return self.name is not None
83
-
84
- def post_validation(self, result):
85
- if not self.has_custom_specification() and not self.has_predefined_name():
86
- raise LookupError("name must be set or custom specification must be provided")
87
-
88
- if self.has_custom_specification() and self.has_predefined_name():
89
- raise LookupError("If predefined name is provided, "
90
- "custom specification is not allowed. "
91
- "Either remove name or remove all other "
92
- "specification of the distillation unit")
93
-
94
- if self.has_predefined_name():
95
- return # all other validation is on the server side
96
-
97
- if self.num_input_ts is None:
98
- raise LookupError("num_input_ts must be set")
99
-
100
- if self.num_output_ts is None:
101
- raise LookupError("num_output_ts must be set")
102
-
103
- if self.failure_probability_formula is None:
104
- raise LookupError("failure_probability_formula must be set")
105
-
106
- if self.output_error_rate_formula is None:
107
- raise LookupError("output_error_rate_formula must be set")
108
-
109
- if self.physical_qubit_specification is not None:
110
- self.physical_qubit_specification.post_validation(result)
111
-
112
- if self.logical_qubit_specification is not None:
113
- self.logical_qubit_specification.post_validation(result)
114
-
115
- if self.logical_qubit_specification_first_round_override is not None:
116
- self.logical_qubit_specification_first_round_override.post_validation(result)
117
-
118
- def as_dict(self, validate=True) -> Dict[str, Any]:
119
- specification_dict = super().as_dict(validate)
120
- if len(specification_dict) != 0:
121
- if self.physical_qubit_specification is not None:
122
- physical_qubit_specification_dict = \
123
- self.physical_qubit_specification.as_dict(validate)
124
- if len(physical_qubit_specification_dict) != 0:
125
- specification_dict["physicalQubitSpecification"] = \
126
- physical_qubit_specification_dict
127
-
128
- if self.logical_qubit_specification is not None:
129
- logical_qubit_specification_dict = \
130
- self.logical_qubit_specification.as_dict(validate)
131
- if len(logical_qubit_specification_dict) != 0:
132
- specification_dict["logicalQubitSpecification"] = \
133
- logical_qubit_specification_dict
134
-
135
- if self.logical_qubit_specification_first_round_override is not None:
136
- logical_qubit_specification_first_round_override_dict = \
137
- self.logical_qubit_specification_first_round_override.as_dict(validate)
138
- if len(logical_qubit_specification_first_round_override_dict) != 0:
139
- specification_dict["logicalQubitSpecificationFirstRoundOverride"] = \
140
- logical_qubit_specification_first_round_override_dict
141
-
142
- return specification_dict