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

Fix for https://github.com/Qiskit/qiskit-aer/issues/2258 #2297

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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,10 @@
---
prelude: >
Fixed a crash that occurred when using the stabilizer simulator, but possibly
in other simulators as well.
issues:
- |
The crash was generated by having op.qubits empty when calling AerState::probability
Refer to
`#2258 <https://github.com/Qiskit/qiskit-aer/issues/2258>` for more
information. Also related `#2234 <https://github.com/Qiskit/qiskit-aer/issues/2234>`.
3 changes: 3 additions & 0 deletions src/controllers/state_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,9 @@ double AerState::probability(const uint_t outcome) {
op.int_params.push_back(outcome);
op.save_type = Operations::DataSubType::list;

for (uint_t i = 0; i < num_of_qubits_; ++i)
op.qubits.push_back(i);

last_result_ = ExperimentResult();
state_->apply_op(op, last_result_, rng_);

Expand Down
Loading