Skip to main contentIBM Quantum Documentation
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

Configuration recovery

qiskit_addon_sqd.configuration_recovery

Functions for performing self-consistent configuration recovery.

post_select_by_hamming_weight

post_select_by_hamming_weight(bitstring_matrix, *, hamming_right, hamming_left)

GitHub

Post-select bitstrings based on the hamming weight of each half.

Parameters

  • bitstring_matrix (ndarray) – A 2D array of bool representations of bit values such that each row represents a single bitstring
  • hamming_right (int) – The target hamming weight of the right half of bitstrings
  • hamming_left (int) – The target hamming weight of the left half of bitstrings

Returns

A mask signifying which samples (rows) were selected from the input matrix.

Return type

ndarray

recover_configurations

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

GitHub

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.

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 (tuple[ndarray, ndarray]) – A length-2 tuple of arrays holding the mean occupancy of the spin-up and spin-down orbitals, respectively. The occupancies should be formatted as: (array([occ_a_0, ..., occ_a_N]), array([occ_b_0, ..., occ_b_N]))
  • 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 (Generator |int | None) – A seed for controlling randomness

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].

Was this page helpful?
Report a bug or request content on GitHub.