Skip to content

Commit

Permalink
Incorporate SQD feedback (#2460)
Browse files Browse the repository at this point in the history
Closes #2360 

Tried to parse the feedback as best I could and would especially
appreciate a review from either @garrison or @mrossinek to double check
my work. Essentially all I did here was give a bit more detail on the
configuration recovery step of SQD both in the intro and getting started
pages.

---------

Co-authored-by: abbycross <[email protected]>
  • Loading branch information
kaelynj and abbycross authored Jan 23, 2025
1 parent bb411b3 commit e306633
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions docs/guides/qiskit-addons-sqd-get-started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1824,9 +1824,11 @@
"source": [
"Now, run the configuration recovery loop. Each loop consists of three steps:\n",
"\n",
"1. Use the `recover_configurations()` method to obtain a refined bitstring matrix and probability array based on the average orbital occupancy.\n",
"1. Use the `recover_configurations()` function to obtain a refined bitstring matrix and probability array based on the average orbital occupancy.\n",
"1. Use the `postselect_and_subsample()` to collect batches of subsamples to diagonalize over.\n",
"1. Then use the batches of subsamples as arguments to the `solve_fermion()` method to obtain an approximation of the ground state."
"1. Then use the batches of subsamples as arguments to the `solve_fermion()` function to obtain an approximation of the ground state.\n",
"\n",
"It is important to note how to address the first iteration of the configuration recovery loop. Since the average orbital occupancy is not yet available, only the `postselect_and_subsample()` function is called. This removes any non-physical samples (samples with incorrect Hamming weight) before running the eigenstate solver, `solve_fermion()`. Afterward, the average orbital occupation is calculated across all batches and used as input to the `recover_configurations()` method, which flips individual bits probabilistically based on this average. See Section **II-A** of the supplementary information in the [SQD paper](https://arxiv.org/abs/2405.05068) for more information."
]
},
{
Expand Down Expand Up @@ -1975,6 +1977,8 @@
"# Data for energies plot\n",
"n2_exact = -109.10288938\n",
"x1 = range(ITERATIONS)\n",
"# Here we plot the smallest energy obtained across all batches for each iteration\n",
"# of the configuration recovery loop.\n",
"e_diff = [abs(np.min(energies) - n2_exact) for energies in energy_hist]\n",
"yt1 = [1.0, 1e-1, 1e-2, 1e-3, 1e-4]\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/qiskit-addons-sqd.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $$ \hat{H}_{S^{(k)}} = \hat{P}_{\mathcal{S}^{(k)}}\hat{H}\hat{P}_{\mathcal{S}^{(

where $\hat{H}_{\mathcal{S}^{(k)}}$ is the Hamiltonian of a given subspace.

The bulk of the SQD workflow lies here wherein each of these subspace Hamiltonians is diagonalized. The ground states obtained from each of these subspaces, $|\psi^{(k)}\rangle$, are used to obtain an estimate of a reference vector of occupancies $\mathbf{n}^{(K)}$ averaged over each of the $K$ subspaces and sent back to the configuration recovery step. A new set of subspaces are then obtained and diagonalized, and this procedure iterates in a loop until a user specified criterion is met.
The bulk of the SQD workflow lies here wherein each of these subspace Hamiltonians is diagonalized. The ground states obtained from each of these subspaces, $|\psi^{(k)}\rangle$, are used to produce an estimate of a reference vector of occupancies $\mathbf{n}^{(K)}$ averaged over each of the $K$ subspaces. A new set of configurations $\mathcal{X}_R$ is then generated by probabilistically flipping individual bits based on this average occupation and the known total number of particles (Hamming weight) in the system. This configuration recovery process is then repeated by preparing a new set of subspaces to diagonalize, obtaining new eigenstates and averaged orbital occupancy, and generating a new set of configurations. This loop is iterated until a user-specified criterion is met, and the overall process is analogous to filtering a noisy signal to improve its fidelity.


## Next steps
Expand Down

0 comments on commit e306633

Please sign in to comment.