@@ -179,6 +179,7 @@ def run_local(job: Job) -> Result:
179
179
)
180
180
else :
181
181
return extract_result_OBSERVABLE_shot_noise (
182
+ # TODO: here precise the 'grouper' argument of measure_observable to precise the pauli grouping strategy
182
183
measure_observables (
183
184
cirq_circuit ,
184
185
observables = ( # pyright: ignore[reportArgumentType]
@@ -248,10 +249,10 @@ def run_local_processor(job: Job) -> Result:
248
249
from cirq .ops .linear_combinations import PauliSum as Cirq_PauliSum
249
250
from cirq .ops .pauli_string import PauliString as Cirq_PauliString
250
251
251
- # TODO: update this to take into account the case when we have list of Observables
252
252
if TYPE_CHECKING :
253
253
assert isinstance (job .measure , ExpectationMeasure )
254
254
255
+ # TODO: update this to take into account the case when we have list of Observables
255
256
cirq_obs = job .measure .observable .to_other_language (
256
257
language = Language .CIRQ , circuit = cirq_circuit
257
258
)
@@ -264,7 +265,10 @@ def run_local_processor(job: Job) -> Result:
264
265
)
265
266
return extract_result_OBSERVABLE_processors (
266
267
simulator .get_sampler (job .device .value ).sample_expectation_values (
267
- cirq_circuit , observables = cirq_obs , num_samples = job .measure .shots
268
+ # TODO: update for multi-observable runs
269
+ cirq_circuit ,
270
+ observables = cirq_obs ,
271
+ num_samples = job .measure .shots ,
268
272
),
269
273
job ,
270
274
)
@@ -351,6 +355,7 @@ def extract_result_OBSERVABLE_processors(
351
355
NotImplementedError: If the job does not contain a measurement (i.e.,
352
356
``job.measure`` is ``None``).
353
357
"""
358
+ # TODO: update for multi-observable runs
354
359
if job .measure is None :
355
360
raise NotImplementedError ("job.measure is None" )
356
361
mean = 0
@@ -377,12 +382,13 @@ def extract_result_OBSERVABLE_ideal(
377
382
but this might result in slightly unexpected results.
378
383
379
384
Args:
380
- result : The result of the simulation.
381
- job : The original job.
385
+ results : The result of the simulation.
386
+ job: The original job.
382
387
383
388
Returns:
384
389
The formatted result.
385
390
"""
391
+ # TODO: update for multi-observable runs
386
392
if job .measure is None :
387
393
raise NotImplementedError ("job.measure is None" )
388
394
return Result (job , sum (map (lambda r : r .real , results )), 0 , job .measure .shots )
@@ -395,12 +401,13 @@ def extract_result_OBSERVABLE_shot_noise(
395
401
"""Extracts the result from an observable-based job.
396
402
397
403
Args:
398
- result : The result of the simulation.
399
- job : The original job.
404
+ results : The result of the simulation.
405
+ job: The original job.
400
406
401
407
Returns:
402
408
The formatted result.
403
409
"""
410
+ # TODO: update for multi-observable runs
404
411
if job .measure is None :
405
412
raise NotImplementedError ("job.measure is None" )
406
413
pauli_mono = PauliString .from_other_language (
0 commit comments