Skip to content

Commit d011122

Browse files
chore: todo for future self
1 parent 84bef81 commit d011122

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

mpqp/execution/providers/azure.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def run_azure(job: Job) -> Result:
3939

4040
qiskit_circuit = (
4141
(
42-
job.circuit.without_measurements() + job.circuit.pre_measure()
42+
# 3M-TODO: careful, if we ever support several measurements, the
43+
# line bellow will have to changer
44+
job.circuit.without_measurements()
45+
+ job.circuit.pre_measure()
4346
).to_other_language(Language.QISKIT)
4447
if (job.job_type == JobType.STATE_VECTOR)
4548
else job.circuit.to_other_language(Language.QISKIT)
@@ -87,8 +90,8 @@ def extract_result(
8790
Raises:
8891
ValueError: If the result type is unsupported.
8992
"""
90-
from qiskit.result import Result as QiskitResult
9193
from azure.quantum.target.microsoft.result import MicrosoftEstimatorResult
94+
from qiskit.result import Result as QiskitResult
9295

9396
if isinstance(result, QiskitResult):
9497
from mpqp.execution.providers.ibm import extract_result as extract_result_ibm

mpqp/execution/providers/google.py

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def run_local(job: Job) -> Result:
136136
return run_local_processor(job)
137137

138138
if job.job_type == JobType.STATE_VECTOR:
139+
# 3M-TODO: careful, if we ever support several measurements, the
140+
# line bellow will have to changer
139141
circuit = job.circuit.without_measurements() + job.circuit.pre_measure()
140142
cirq_circuit = circuit.to_other_language(Language.CIRQ)
141143
job.circuit.gphase = circuit.gphase

mpqp/execution/providers/ibm.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from qiskit_aer import AerSimulator
3838
from qiskit_aer.noise import NoiseModel as Qiskit_NoiseModel
3939
from qiskit_ibm_runtime import RuntimeJobV2
40+
4041
from mpqp.execution.simulated_devices import IBMSimulatedDevice
4142

4243

@@ -84,6 +85,7 @@ def compute_expectation_value(
8485
:func:`~mpqp.execution.runner.run` instead.
8586
"""
8687
from qiskit.quantum_info import SparsePauliOp
88+
8789
from mpqp.execution.simulated_devices import IBMSimulatedDevice
8890

8991
if not isinstance(job.measure, ExpectationMeasure):
@@ -416,6 +418,7 @@ def run_aer(job: Job):
416418

417419
from qiskit import QuantumCircuit, transpile
418420
from qiskit_aer import AerSimulator
421+
419422
from mpqp.execution.simulated_devices import IBMSimulatedDevice
420423

421424
job_circuit = job.circuit
@@ -439,7 +442,10 @@ def run_aer(job: Job):
439442

440443
qiskit_circuit = (
441444
(
442-
job_circuit.without_measurements() + job_circuit.pre_measure()
445+
# 3M-TODO: careful, if we ever support several measurements, the
446+
# line bellow will have to changer
447+
job_circuit.without_measurements()
448+
+ job_circuit.pre_measure()
443449
).to_other_language(Language.QISKIT)
444450
if (job.job_type == JobType.STATE_VECTOR)
445451
else job_circuit.to_other_language(Language.QISKIT)

0 commit comments

Comments
 (0)