You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Post-select bitstrings based on the hamming weight of each half.
23
23
24
24
**Parameters**
25
25
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
27
27
***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
28
28
***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
29
29
@@ -33,12 +33,12 @@ Functions for performing self-consistent configuration recovery.
Refine bitstrings based on average orbital occupancy and a target hamming weight.
43
43
44
44
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.
47
47
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`.
48
48
</Admonition>
49
49
50
-
<Admonitiontitle="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
-
54
50
**Parameters**
55
51
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
57
53
***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`.
59
55
***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.
60
56
***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
62
58
63
59
**Returns**
64
60
65
61
A refined bitstring matrix and an updated probability array.
Generate a bitstring counts dictionary with specified bipartite hamming weight.
66
66
67
67
**Parameters**
@@ -70,7 +70,7 @@ Functions for transforming counts dictionaries.
70
70
***num\_bits** ([*int*](https://docs.python.org/3/library/functions.html#int"(in Python v3.13)")) – The number of bits in the bitstrings
71
71
***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
72
72
***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
74
74
75
75
**Returns**
76
76
@@ -89,7 +89,7 @@ Functions for transforming counts dictionaries.
0 commit comments