qiskit_addon_sqd.configuration_recovery.recover_configurations

recover_configurations(bitstring_matrix, probabilities, avg_occupancies, num_elec_a, num_elec_b, rand_seed=None)[source]

Refine bitstrings based on average orbital occupancy and a target hamming weight.

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.

Note

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.

Note

The output configurations may not necessarily have correct hamming weight, as each bit is flipped in isolation from the other bits in the bitstring.

Parameters:
  • bitstring_matrix (ndarray) – A 2D array of bool representations of bit values such that each row represents a single bitstring

  • probabilities (Sequence[float]) – A 1D array specifying a probability distribution over the bitstrings

  • avg_occupancies (ndarray) – 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.

  • num_elec_a (int) – The number of spin-up electrons in the system.

  • num_elec_b (int) – The number of spin-down electrons in the system.

  • rand_seed (int | None) – A seed to control random behavior

Returns:

A refined bitstring matrix and an updated probability array.

Return type:

tuple[ndarray, ndarray]

References

[1]: J. Robledo-Moreno, et al., Chemistry Beyond Exact Solutions on a Quantum-Centric Supercomputer,

arXiv:2405.05068 [quant-ph].