-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force hamming_left and hamming_right to be kwargs throughout API (#16)
* Force hamming_left and hamming_right to be kwargs throughout API * Don't change order of args in postselect_and_subsample * typo
- Loading branch information
1 parent
10a7332
commit 147405a
Showing
13 changed files
with
130 additions
and
74 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,55 @@ | ||
--- | ||
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 require the ``hamming_right`` and ``hamming_left`` arguments to be specified as keyword arguments. Additionally, the ``samples_per_batch`` and ``n_batches`` arguments to :func:`qiskit_addon_sqd.subsampling.post_select_by_hamming_weight` should now be passed as keyword arguments. | ||
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_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, | ||
) | ||
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, hamming_right=num_elec_a, hamming_left=num_elec_b) | ||
... | ||
bs_mat = post_select_by_hamming_weight(bs_mat_full, hamming_right=num_elec_a, hamming_left=num_elec_b) | ||
... | ||
batches = postselect_and_subsample( | ||
bs_mat, | ||
probs_arr, | ||
hamming_right=num_elec_a, | ||
hamming_left=num_elec_b, | ||
samples_per_batch=samples_per_batch, | ||
n_batches=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