Gate Optimization in DiagCoulombEvolutionJW#671
Open
jamie-k-kim wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the gate decomposition in the number operator representation (
_diag_coulomb_evo_num_rep_jw). Right now it yields PhaseGates and CPhaseGates for every diagonal Coulomb term. This new approach accumulates all single-qubit Z-rotations into a coefficient array (z_coeffs), applies them all at the start using a single PhaseGate per qubit, and then uses RZZGates for the two-qubit interaction terms.By the Jordan-Wigner mapping for number operators,$n_p = \frac{I-Z_p}{2}$ and the interaction term $n_p n_q$ expands to $\frac{I - Z_p - Z_q + Z_p Z_q}{4}$ . So for single-qubit Z terms, each term $Z_{pq} n_p n_q$ contributes a factor of $\frac{t Z_{pq}}{4}$ to the $Z_p$ and $Z_q$ phases. These are accumulated via $\exp\left(-i \frac{t Z_{pq}}{4} Z_p Z_q\right)$ , which is equivalent to
coef = time * this_mat[i, j] / 4.0. And for two-qubit ZZ terms, each term contributesRZZGate(0.5 * time * Z_pq).For a 50-orbital system with 100 trials:
Transpilation speedup: 24.9% (MacBook Pro M1)