|
35 | 35 | import pandas as pd |
36 | 36 |
|
37 | 37 | from cirq import value, ops |
38 | | -from cirq._compat import deprecated, proper_repr, _warn_or_error |
| 38 | +from cirq._compat import proper_repr |
39 | 39 | from cirq.study import resolver |
40 | 40 |
|
41 | 41 | if TYPE_CHECKING: |
@@ -85,15 +85,6 @@ def _key_to_str(key: TMeasurementKey) -> str: |
85 | 85 | class Result(abc.ABC): |
86 | 86 | """The results of multiple executions of a circuit with fixed parameters.""" |
87 | 87 |
|
88 | | - def __new__(cls, *args, **kwargs): |
89 | | - if cls is Result: |
90 | | - _warn_or_error( |
91 | | - "Result constructor is deprecated and will be removed in cirq v0.15. " |
92 | | - "Use the ResultDict constructor instead, or another concrete subclass." |
93 | | - ) |
94 | | - return ResultDict(*args, **kwargs) |
95 | | - return super().__new__(cls) |
96 | | - |
97 | 88 | @property |
98 | 89 | @abc.abstractmethod |
99 | 90 | def params(self) -> 'cirq.ParamResolver': |
@@ -153,29 +144,6 @@ def dataframe_from_measurements(measurements: Mapping[str, np.ndarray]) -> pd.Da |
153 | 144 | dtype = object if any(bs.shape[1] > 63 for _, bs in measurements.items()) else np.int64 |
154 | 145 | return pd.DataFrame(converted_dict, dtype=dtype) |
155 | 146 |
|
156 | | - @staticmethod |
157 | | - @deprecated( |
158 | | - deadline="v0.15", |
159 | | - fix="The static method from_single_parameter_set is deprecated. " |
160 | | - "Use the ResultDict constructor instead.", |
161 | | - ) |
162 | | - def from_single_parameter_set( |
163 | | - *, # Forces keyword args. |
164 | | - params: resolver.ParamResolver, |
165 | | - measurements: Mapping[str, np.ndarray], |
166 | | - ) -> 'cirq.Result': |
167 | | - """Packages runs of a single parameterized circuit into a Result. |
168 | | -
|
169 | | - Args: |
170 | | - params: A ParamResolver of settings used for this result. |
171 | | - measurements: A dictionary from measurement gate key to measurement |
172 | | - results. The value for each key is a 2-D array of booleans, |
173 | | - with the first index running over the repetitions, and the |
174 | | - second index running over the qubits for the corresponding |
175 | | - measurements. |
176 | | - """ |
177 | | - return ResultDict(params=params, measurements=measurements) |
178 | | - |
179 | 147 | @property |
180 | 148 | def repetitions(self) -> int: |
181 | 149 | if not self.records: |
|
0 commit comments