Skip to content

Commit 35e50fc

Browse files
fix: remove set for device, for sorted result
1 parent 653a7d0 commit 35e50fc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mpqp/execution/runner.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,18 @@ def run(
237237
... )
238238
>>> print(batch_result)
239239
BatchResult: 2 results
240-
Result: X CNOT circuit, AWSDevice, BRAKET_LOCAL_SIMULATOR
240+
Result: X CNOT circuit, ATOSDevice, MYQLM_PYLINALG
241241
Counts: [0, 0, 0, 1000]
242242
Probabilities: [0, 0, 0, 1]
243243
Samples:
244244
State: 11, Index: 3, Count: 1000, Probability: 1.0
245-
Error: None
246-
Result: X CNOT circuit, ATOSDevice, MYQLM_PYLINALG
245+
Error: 0.0
246+
Result: X CNOT circuit, AWSDevice, BRAKET_LOCAL_SIMULATOR
247247
Counts: [0, 0, 0, 1000]
248248
Probabilities: [0, 0, 0, 1]
249249
Samples:
250250
State: 11, Index: 3, Count: 1000, Probability: 1.0
251-
Error: 0.0
251+
Error: None
252252
>>> c2 = QCircuit(
253253
... [X(0), X(1), BasisMeasure([0, 1], shots=1000)],
254254
... label="X circuit",
@@ -275,12 +275,12 @@ def run(
275275

276276
if isinstance(circuit, Iterable):
277277
if isinstance(device, Iterable):
278-
return BatchResult([_run_single(circ, device, values) for circ in circuit for device in set(device)])
278+
return BatchResult([_run_single(circ, dev, values) for circ in circuit for dev in device])
279279
else:
280280
return BatchResult([_run_single(circ, device, values) for circ in circuit])
281281
else:
282282
if isinstance(device, Iterable):
283-
return BatchResult([_run_single(circuit, device, values) for device in set(device)])
283+
return BatchResult([_run_single(circuit, dev, values) for dev in device])
284284
else:
285285
return _run_single(circuit, device, values)
286286

0 commit comments

Comments
 (0)