From b13fc022d80a8f66ae39008f4fa8624a06f19182 Mon Sep 17 00:00:00 2001 From: Haimeng Zhang Date: Fri, 31 Jan 2025 09:42:50 -0500 Subject: [PATCH 1/3] fix indexing for the right subsystem in bitstring correcting --- qiskit_addon_sqd/configuration_recovery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_addon_sqd/configuration_recovery.py b/qiskit_addon_sqd/configuration_recovery.py index 7b34a82..c102413 100644 --- a/qiskit_addon_sqd/configuration_recovery.py +++ b/qiskit_addon_sqd/configuration_recovery.py @@ -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 From 2056648555d7535b1ba19e4a4873195f5aedda49 Mon Sep 17 00:00:00 2001 From: Haimeng Zhang Date: Fri, 31 Jan 2025 14:02:46 -0500 Subject: [PATCH 2/3] add release note --- releasenotes/notes/fix-indexing-0c49df940710efde.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 releasenotes/notes/fix-indexing-0c49df940710efde.yaml diff --git a/releasenotes/notes/fix-indexing-0c49df940710efde.yaml b/releasenotes/notes/fix-indexing-0c49df940710efde.yaml new file mode 100644 index 0000000..3fbebaa --- /dev/null +++ b/releasenotes/notes/fix-indexing-0c49df940710efde.yaml @@ -0,0 +1,3 @@ +fixes: + - | + Fixed an indexing error in :func:`qiskit_addon_sqd.configuration_recovery._bipartite_bitstring_correcting` where the probability array for the right bitstring subsystem, `probs_right`, was constructed incorrectly as the code trasveres the left subsystem instead. From ec7bc61b79e7425ab3515b7c1fc15f13829c54ce Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Fri, 31 Jan 2025 14:47:28 -0600 Subject: [PATCH 3/3] Update fix-indexing-0c49df940710efde.yaml --- releasenotes/notes/fix-indexing-0c49df940710efde.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releasenotes/notes/fix-indexing-0c49df940710efde.yaml b/releasenotes/notes/fix-indexing-0c49df940710efde.yaml index 3fbebaa..97cf2a4 100644 --- a/releasenotes/notes/fix-indexing-0c49df940710efde.yaml +++ b/releasenotes/notes/fix-indexing-0c49df940710efde.yaml @@ -1,3 +1,3 @@ fixes: - | - Fixed an indexing error in :func:`qiskit_addon_sqd.configuration_recovery._bipartite_bitstring_correcting` where the probability array for the right bitstring subsystem, `probs_right`, was constructed incorrectly as the code trasveres the left subsystem instead. + 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.