-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust API to be more consistent in specifying the numbers of spin
electrons and target hamming weights. Co-authored-by: Kevin J. Sung <[email protected]>
- Loading branch information
1 parent
58f6b12
commit cbcfd5f
Showing
4 changed files
with
64 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
releasenotes/notes/subsample-hamming-76674dbaf6f411c2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
upgrade: | ||
- | | ||
The :func:`qiskit_addon_sqd.subsampling.postselect_and_subsample` and :func:`qiskit_addon_sqd.configuration_recovery.post_select_by_hamming_weight` now take the ``hamming_right`` positional argument before the ``hamming_left`` argument to better match the rest of the workflow. | ||
To upgrade | ||
.. code-block:: python | ||
from qiskit_addon_sqd.configuration_recovery import post_select_by_hamming_weight | ||
from qiskit_addon_sqd.subsampling import postselect_and_subsample | ||
bs_mat = post_select_by_hamming_weight(bs_mat_full, num_elec_b, num_elec_a) | ||
... | ||
batches = postselect_and_subsample( | ||
bs_mat, | ||
probs_arr, | ||
num_elec_b, | ||
num_elec_a, | ||
samples_per_batch, | ||
n_batches, | ||
) | ||
should be changed to | ||
.. code-block:: python | ||
from qiskit_addon_sqd.configuration_recovery import post_select_by_hamming_weight | ||
from qiskit_addon_sqd.subsampling import postselect_and_subsample | ||
bs_mat = post_select_by_hamming_weight(bs_mat_full, num_elec_a, num_elec_b) | ||
... | ||
batches = postselect_and_subsample( | ||
bs_mat, | ||
probs_arr, | ||
num_elec_a, | ||
num_elec_b, | ||
samples_per_batch, | ||
n_batches, | ||
) |