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 indexing bug in recover_configurations #132

Merged
merged 3 commits into from
Jan 31, 2025
Merged
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
4 changes: 2 additions & 2 deletions qiskit_addon_sqd/configuration_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,11 @@ def _bipartite_bitstring_correcting(

if bit_array[i + partition_size]:
probs_right[i] = _p_flip_1_to_0(
hamming_right / partition_size, avg_occupancies[i], 0.01
hamming_right / partition_size, avg_occupancies[i + partition_size], 0.01
)
else:
probs_right[i] = _p_flip_0_to_1(
hamming_right / partition_size, avg_occupancies[i], 0.01
hamming_right / partition_size, avg_occupancies[i + partition_size], 0.01
)

# Normalize
Expand Down
3 changes: 3 additions & 0 deletions releasenotes/notes/fix-indexing-0c49df940710efde.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixes:
- |
Fixed an indexing error in :func:`qiskit_addon_sqd.configuration_recovery` which caused bits in the right half of the bitstring to be flipped with respect to the occupancies of the oritals associated with the left half of the bitstring.