-
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 # spin electrons and t…
…arget hamming weights (#11) * 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]> * Fix docstring * Beef up release note to cover the patch release * Adjust bipartite hamming counts generation interface * Fix tests * Clarify config recovery docstring --------- Co-authored-by: Kevin J. Sung <[email protected]>
- Loading branch information
1 parent
1e1bc86
commit 0748ad2
Showing
7 changed files
with
96 additions
and
35 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
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
56 changes: 56 additions & 0 deletions
56
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,56 @@ | ||
--- | ||
prelude: > | ||
This is a patch release which introduces a couple of small, but important, breaking changes to to the API. These changes allow for a more consistent pattern in specifying the number of alpha and beta electrons throughout both the chemistry and non-chemistry functions in the API. | ||
upgrade: | ||
- | | ||
The :func:`qiskit_addon_sqd.counts.generate_counts_bipartite_hamming`, :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 | ||
from qiskit_addon_sqd.counts import generate_counts_bipartite_hamming | ||
counts = generate_counts_bipartite_hamming(num_samples, num_bits, num_elec_b, num_elec_a) | ||
... | ||
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 | ||
from qiskit_addon_sqd.counts import generate_counts_bipartite_hamming | ||
counts = generate_counts_bipartite_hamming(num_samples, num_bits, num_elec_a, num_elec_b) | ||
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, | ||
) |
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