-
Notifications
You must be signed in to change notification settings - Fork 100
Incorporate SQD feedback #2460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate SQD feedback #2460
Changes from 3 commits
a7a70ab
648278c
3b9d026
072a775
f74b1a5
66664b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1826,12 +1826,14 @@ | |
"\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 `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()` method 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()` method 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. The probability of flipping an individual bit is based on the distance between the value of the bit and the average orbital occupancy obtained. (See Section **II-A** of the supplementary information in the [SQD paper](https://arxiv.org/abs/2405.05068) for more information.)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The probability to flip each bit is a bit more complicated than the description here suggests. P(flip_0_to_1) and P(flip_1_to_0) are functions of both:
I think you could just remove the last sentence and point folks to the literature here and it'd be perfect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the source code for determing P(flip) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah got it, that makes sense thanks. I ended up just following your suggestion and removed that last sentence and pointed the reader toward the literature. |
||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"execution_count": null, | ||
"id": "a6d492b5-d86b-43cd-9171-4add0903fe84", | ||
"metadata": {}, | ||
"outputs": [ | ||
|
@@ -1928,7 +1930,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"execution_count": null, | ||
"id": "dcd4ed70-89a0-44f4-b4b0-6270bbeb0c13", | ||
"metadata": {}, | ||
"outputs": [ | ||
|
@@ -1949,6 +1951,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", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 obtain 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just noticed the two "obtain"s in the second sentence 😆 but I don't know that it's worth wordsmithing since it makes sense, so I'll leave it for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! Just changed the wording around a bit |
||
|
||
|
||
## Next steps | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little pedantic, but I guess we could say "function" instead of "method" to distinguish it from a class method.