From 52a271f0a795c0af744ed74859e6dc3558e6e96a Mon Sep 17 00:00:00 2001 From: Jun Doi Date: Wed, 13 Dec 2023 17:05:41 +0900 Subject: [PATCH 1/2] Fix GPU batched execution --- releasenotes/notes/fix_batch_shots-837c066d8b993a2d.yaml | 5 +++++ src/simulators/batch_shots_executor.hpp | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix_batch_shots-837c066d8b993a2d.yaml diff --git a/releasenotes/notes/fix_batch_shots-837c066d8b993a2d.yaml b/releasenotes/notes/fix_batch_shots-837c066d8b993a2d.yaml new file mode 100644 index 0000000000..3e3ef26134 --- /dev/null +++ b/releasenotes/notes/fix_batch_shots-837c066d8b993a2d.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixed GPU batched shots optimization and GPU runtime parameter binding + failures caused by wrong checking of return condition diff --git a/src/simulators/batch_shots_executor.hpp b/src/simulators/batch_shots_executor.hpp index 6776bb26de..ade26f8118 100644 --- a/src/simulators/batch_shots_executor.hpp +++ b/src/simulators/batch_shots_executor.hpp @@ -154,7 +154,6 @@ void BatchShotsExecutor::run_circuit_with_sampling( return Executor::run_circuit_with_sampling(circ, config, init_rng, result_it); } - Noise::NoiseModel dummy_noise; state_t dummy_state; int_t i; @@ -580,7 +579,7 @@ void BatchShotsExecutor::apply_ops_batched_shots_for_group( apply_batched_noise_ops(i_group, noise_ops, result_it, rng); } } else { - if (!op->expr && !apply_batched_op(istate, *op, result_it, rng, + if (!op->expr && apply_batched_op(istate, *op, result_it, rng, final_ops && (op + 1 == last))) { continue; } From ceb9613648926090dedaca79d6426d7097951546 Mon Sep 17 00:00:00 2001 From: Jun Doi Date: Wed, 13 Dec 2023 17:15:34 +0900 Subject: [PATCH 2/2] format --- src/simulators/batch_shots_executor.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulators/batch_shots_executor.hpp b/src/simulators/batch_shots_executor.hpp index ade26f8118..8f218d049b 100644 --- a/src/simulators/batch_shots_executor.hpp +++ b/src/simulators/batch_shots_executor.hpp @@ -580,7 +580,7 @@ void BatchShotsExecutor::apply_ops_batched_shots_for_group( } } else { if (!op->expr && apply_batched_op(istate, *op, result_it, rng, - final_ops && (op + 1 == last))) { + final_ops && (op + 1 == last))) { continue; } // call apply_op for each state