qiskit_addon_sqd.fermion.bitstring_matrix_to_sorted_addresses¶
- bitstring_matrix_to_sorted_addresses(bitstring_matrix, open_shell=False)¶
Convert a bitstring matrix into a sorted array of unique, unsigned integers.
This function separates each bitstring in
bitstring_matrix
in half, flips the bits and translates them into integer representations, and finally appends them to their respective (spin-up or spin-down) lists. Those lists are sorted and output from this function.Deprecated since version 0.6.0: The function
qiskit_addon_sqd.fermion.bitstring_matrix_to_sorted_addresses()
is deprecated as of qiskit-addon-sqd 0.6.0. It will be removed no sooner than qiskit-addon-sqd 0.8.0. Use the bitstring_matrix_to_ci_strs function.- Parameters:
bitstring_matrix (ndarray) – A 2D array of
bool
representations of bit values such that each row represents a single bitstringopen_shell (bool) – A flag specifying whether unique addresses from the left and right halves of the bitstrings should be kept separate. If
False
, addresses from the left and right halves of the bitstrings are combined into a single set of unique addresses. That combined set will be returned for both the left and right bitstrings.
- Returns:
A length-2 tuple of sorted, unique determinants representing the left (spin-down) and right (spin-up) halves of the bitstrings, respectively.
- Return type: