Skip to content

Commit

Permalink
reverse ordering of read out error in sampling measure
Browse files Browse the repository at this point in the history
  • Loading branch information
doichanj committed Nov 21, 2023
1 parent 6f0b94f commit bb00e69
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
Fixes order of applying read out error in sampling measure
in circuit executors. Ordering is reversed to fit to the older verison
of Aer.
Also fixed check of bacth execution.
2 changes: 1 addition & 1 deletion src/simulators/batch_shots_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ template <class state_t>
void BatchShotsExecutor<state_t>::run_circuit_with_sampling(
Circuit &circ, const Config &config, RngEngine &init_rng,
ResultItr result_it) {
if (circ.num_bind_params == 1 || !enable_batch_multi_shots_) {
if (enable_batch_multi_shots_) {
return Executor<state_t>::run_circuit_with_sampling(circ, config, init_rng,
result_it);
}
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/circuit_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ void Executor<state_t>::measure_sampler(InputIterator first_meas,
uint_t num_registers =
(register_map.empty()) ? 0ULL : 1 + register_map.rbegin()->first;
ClassicalRegister creg;
for (int_t i = 0; i < all_samples.size(); i++) {
for (int_t i = all_samples.size() - 1; i >= 0; i--) {
creg.initialize(num_memory, num_registers);

// process memory bit measurements
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/multi_state_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ void MultiStateExecutor<state_t>::measure_sampler(InputIterator first_meas,
(memory_map.empty()) ? 0ULL : 1 + memory_map.rbegin()->first;
uint_t num_registers =
(register_map.empty()) ? 0ULL : 1 + register_map.rbegin()->first;
for (int_t i = 0; i < all_samples.size(); i++) {
for (int_t i = all_samples.size() - 1; i >= 0; i--) {
ClassicalRegister creg = state.creg();

// process memory bit measurements
Expand Down

0 comments on commit bb00e69

Please sign in to comment.