Skip to content

Commit

Permalink
update deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
andrijapau committed Nov 12, 2024
1 parent 120e1f1 commit 435d709
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demonstrations/tutorial_error_mitigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def executor(circuits, dev=dev_noisy):
)
circuits_with_meas.append(circuit_with_meas)

return qml.execute(circuits_with_meas, dev, gradient_fn=None)
return qml.execute(circuits_with_meas, dev, diff_method=None)


##############################################################################
Expand Down Expand Up @@ -540,7 +540,7 @@ def executor(circuit):
circuits, postproc = qml.transforms.split_non_commuting(
circuit_with_meas, grouping_strategy=None
)
circuits_executed = qml.execute(circuits, dev_noisy, gradient_fn=None)
circuits_executed = qml.execute(circuits, dev_noisy, diff_method=None)
return postproc(circuits_executed)

mitig_energy = execute_with_zne(circuit, executor, scale_noise=fold_global)
Expand Down
4 changes: 2 additions & 2 deletions demonstrations/tutorial_quantum_circuit_cutting.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,10 @@ def make_kraus_ops(num_wires: int):
tape0 = QuantumTape(ops=ops_0, measurements=tape.measurements, shots=channel_shots[0].item())
tape1 = QuantumTape(ops=ops_1, measurements=tape.measurements, shots=channel_shots[1].item())

(shots0,) = qml.execute([tape0], device=device, cache=False, gradient_fn=None)
(shots0,) = qml.execute([tape0], device=device, cache=False, diff_method=None)
samples[choices == 0] = shots0

(shots1,) = qml.execute([tape1], device=device, cache=False, gradient_fn=None)
(shots1,) = qml.execute([tape1], device=device, cache=False, diff_method=None)
samples[choices == 1] = shots1

######################################################################
Expand Down

0 comments on commit 435d709

Please sign in to comment.