From 435d70923aa2bd3fcde31288eb49230cecf6633b Mon Sep 17 00:00:00 2001 From: andrijapau Date: Tue, 12 Nov 2024 10:24:08 -0500 Subject: [PATCH] update deprecated code --- demonstrations/tutorial_error_mitigation.py | 4 ++-- demonstrations/tutorial_quantum_circuit_cutting.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demonstrations/tutorial_error_mitigation.py b/demonstrations/tutorial_error_mitigation.py index e75f6f452f..133f63a469 100644 --- a/demonstrations/tutorial_error_mitigation.py +++ b/demonstrations/tutorial_error_mitigation.py @@ -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) ############################################################################## @@ -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) diff --git a/demonstrations/tutorial_quantum_circuit_cutting.py b/demonstrations/tutorial_quantum_circuit_cutting.py index 45083d90fe..ea3ed96f5b 100644 --- a/demonstrations/tutorial_quantum_circuit_cutting.py +++ b/demonstrations/tutorial_quantum_circuit_cutting.py @@ -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 ######################################################################