Skip to content

Commit

Permalink
Fix indexing bug in recover_configurations (#132)
Browse files Browse the repository at this point in the history
* fix indexing for the right subsystem in bitstring correcting

* add release note

* Update fix-indexing-0c49df940710efde.yaml
  • Loading branch information
haimeng-zhang authored Jan 31, 2025
1 parent b2782dc commit d3950ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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.

0 comments on commit d3950ed

Please sign in to comment.