Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse ordering to read out error in sampling measure #2003

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading