Skip to content

Commit 04abf8a

Browse files
committed
gen sqd 0.9.0
1 parent cee63d6 commit 04abf8a

File tree

8 files changed

+103
-97
lines changed

8 files changed

+103
-97
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "qiskit-addon-sqd",
3-
"version": "0.8.1"
3+
"version": "0.9.0"
44
}

docs/api/qiskit-addon-sqd/configuration-recovery.mdx

+8-12
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ Functions for performing self-consistent configuration recovery.
1818

1919
### post\_select\_by\_hamming\_weight
2020

21-
<Function id="qiskit_addon_sqd.configuration_recovery.post_select_by_hamming_weight" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.8/qiskit_addon_sqd/configuration_recovery.py#L24-L48" signature="post_select_by_hamming_weight(bitstring_matrix, *, hamming_right, hamming_left)">
21+
<Function id="qiskit_addon_sqd.configuration_recovery.post_select_by_hamming_weight" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.9/qiskit_addon_sqd/configuration_recovery.py#L24-L48" signature="post_select_by_hamming_weight(bitstring_matrix, *, hamming_right, hamming_left)">
2222
Post-select bitstrings based on the hamming weight of each half.
2323

2424
**Parameters**
2525

26-
* **bitstring\_matrix** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)")) – A 2D array of `bool` representations of bit values such that each row represents a single bitstring
26+
* **bitstring\_matrix** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)")) – A 2D array of `bool` representations of bit values such that each row represents a single bitstring
2727
* **hamming\_right** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The target hamming weight of the right half of bitstrings
2828
* **hamming\_left** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The target hamming weight of the left half of bitstrings
2929

@@ -33,12 +33,12 @@ Functions for performing self-consistent configuration recovery.
3333

3434
**Return type**
3535

36-
[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)")
36+
[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)")
3737
</Function>
3838

3939
### recover\_configurations
4040

41-
<Function id="qiskit_addon_sqd.configuration_recovery.recover_configurations" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.8/qiskit_addon_sqd/configuration_recovery.py#L51-L117" signature="recover_configurations(bitstring_matrix, probabilities, avg_occupancies, num_elec_a, num_elec_b, rand_seed=None)">
41+
<Function id="qiskit_addon_sqd.configuration_recovery.recover_configurations" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.9/qiskit_addon_sqd/configuration_recovery.py#L51-L112" signature="recover_configurations(bitstring_matrix, probabilities, avg_occupancies, num_elec_a, num_elec_b, rand_seed=None)">
4242
Refine bitstrings based on average orbital occupancy and a target hamming weight.
4343

4444
This function refines each bit in isolation in an attempt to transform the Hilbert space represented by the input `bitstring_matrix` into a space closer to that which supports the ground state.
@@ -47,26 +47,22 @@ Functions for performing self-consistent configuration recovery.
4747
This function makes the assumption that bit `i` represents the spin-down orbital corresponding to the spin-up orbital in bit `i + N` where `N` is the number of spatial orbitals and `i < N`.
4848
</Admonition>
4949

50-
<Admonition title="Note" type="note">
51-
The output configurations may not necessarily have correct hamming weight, as each bit is flipped in isolation from the other bits in the bitstring.
52-
</Admonition>
53-
5450
**Parameters**
5551

56-
* **bitstring\_matrix** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)")) – A 2D array of `bool` representations of bit values such that each row represents a single bitstring
52+
* **bitstring\_matrix** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)")) – A 2D array of `bool` representations of bit values such that each row represents a single bitstring
5753
* **probabilities** ([*Sequence*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence "(in Python v3.13)")*\[*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")*]*) – A 1D array specifying a probability distribution over the bitstrings
58-
* **avg\_occupancies** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)")) – A 1D array containing the mean occupancy of each orbital. It is assumed that `avg_occupancies[i]` corresponds to the orbital represented by column `i` in `bitstring_matrix`.
54+
* **avg\_occupancies** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)")) – A 1D array containing the mean occupancy of each orbital. It is assumed that `avg_occupancies[i]` corresponds to the orbital represented by column `i` in `bitstring_matrix`.
5955
* **num\_elec\_a** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The number of spin-up electrons in the system.
6056
* **num\_elec\_b** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The number of spin-down electrons in the system.
61-
* **rand\_seed** ([*Generator*](https://numpy.org/doc/stable/reference/random/generator.html#numpy.random.Generator "(in NumPy v2.1)") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – A seed for controlling randomness
57+
* **rand\_seed** ([*Generator*](https://numpy.org/doc/stable/reference/random/generator.html#numpy.random.Generator "(in NumPy v2.2)") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – A seed for controlling randomness
6258

6359
**Returns**
6460

6561
A refined bitstring matrix and an updated probability array.
6662

6763
**Return type**
6864

69-
[tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")\[[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)"), [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)")]
65+
[tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")\[[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)"), [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)")]
7066

7167
**References**
7268

docs/api/qiskit-addon-sqd/counts.mdx

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Functions for transforming counts dictionaries.
1818

1919
### counts\_to\_arrays
2020

21-
<Function id="qiskit_addon_sqd.counts.counts_to_arrays" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.8/qiskit_addon_sqd/counts.py#L21-L40" signature="counts_to_arrays(counts)">
21+
<Function id="qiskit_addon_sqd.counts.counts_to_arrays" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.9/qiskit_addon_sqd/counts.py#L21-L40" signature="counts_to_arrays(counts)">
2222
Convert a counts dictionary into a bitstring matrix and a probability array.
2323

2424
**Parameters**
@@ -32,19 +32,19 @@ Functions for transforming counts dictionaries.
3232

3333
**Return type**
3434

35-
[tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")\[[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)"), [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.1)")]
35+
[tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")\[[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)"), [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)")]
3636
</Function>
3737

3838
### generate\_counts\_uniform
3939

40-
<Function id="qiskit_addon_sqd.counts.generate_counts_uniform" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.8/qiskit_addon_sqd/counts.py#L43-L77" signature="generate_counts_uniform(num_samples, num_bits, rand_seed=None)">
40+
<Function id="qiskit_addon_sqd.counts.generate_counts_uniform" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.9/qiskit_addon_sqd/counts.py#L43-L77" signature="generate_counts_uniform(num_samples, num_bits, rand_seed=None)">
4141
Generate a bitstring counts dictionary of samples drawn from the uniform distribution.
4242

4343
**Parameters**
4444

4545
* **num\_samples** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The number of samples to draw
4646
* **num\_bits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The number of bits in the bitstrings
47-
* **rand\_seed** ([*Generator*](https://numpy.org/doc/stable/reference/random/generator.html#numpy.random.Generator "(in NumPy v2.1)") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – A seed for controlling randomness
47+
* **rand\_seed** ([*Generator*](https://numpy.org/doc/stable/reference/random/generator.html#numpy.random.Generator "(in NumPy v2.2)") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – A seed for controlling randomness
4848

4949
**Returns**
5050

@@ -61,7 +61,7 @@ Functions for transforming counts dictionaries.
6161

6262
### generate\_counts\_bipartite\_hamming
6363

64-
<Function id="qiskit_addon_sqd.counts.generate_counts_bipartite_hamming" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.8/qiskit_addon_sqd/counts.py#L80-L135" signature="generate_counts_bipartite_hamming(num_samples, num_bits, *, hamming_right, hamming_left, rand_seed=None)">
64+
<Function id="qiskit_addon_sqd.counts.generate_counts_bipartite_hamming" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.9/qiskit_addon_sqd/counts.py#L80-L134" signature="generate_counts_bipartite_hamming(num_samples, num_bits, *, hamming_right, hamming_left, rand_seed=None)">
6565
Generate a bitstring counts dictionary with specified bipartite hamming weight.
6666

6767
**Parameters**
@@ -70,7 +70,7 @@ Functions for transforming counts dictionaries.
7070
* **num\_bits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The number of bits in the bitstrings
7171
* **hamming\_right** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The hamming weight on the right half of each bitstring
7272
* **hamming\_left** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The hamming weight on the left half of each bitstring
73-
* **rand\_seed** ([*Generator*](https://numpy.org/doc/stable/reference/random/generator.html#numpy.random.Generator "(in NumPy v2.1)") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – A seed for controlling randomness
73+
* **rand\_seed** ([*Generator*](https://numpy.org/doc/stable/reference/random/generator.html#numpy.random.Generator "(in NumPy v2.2)") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – A seed for controlling randomness
7474

7575
**Returns**
7676

@@ -89,7 +89,7 @@ Functions for transforming counts dictionaries.
8989

9090
### normalize\_counts\_dict
9191

92-
<Function id="qiskit_addon_sqd.counts.normalize_counts_dict" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.8/qiskit_addon_sqd/counts.py#L138-L145" signature="normalize_counts_dict(counts)">
92+
<Function id="qiskit_addon_sqd.counts.normalize_counts_dict" github="https://github.com/Qiskit/qiskit-addon-sqd/tree/stable/0.9/qiskit_addon_sqd/counts.py#L137-L144" signature="normalize_counts_dict(counts)">
9393
Convert a counts dictionary into a probability dictionary.
9494

9595
**Parameters**

0 commit comments

Comments
 (0)