Skip to content
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

Adding gc sign conventions #1293

Merged
merged 18 commits into from
Apr 9, 2024
Merged

Conversation

marekgluza
Copy link
Contributor

I consolidate DoubleBracketIteration.__call__ to follow the convention that $H' = U^\dagger H U$ where $U=e^{-sW}$ with $W=[D,H]$ (or depending on mode an approximation, see eval_dbr_unitary). If $s>0$ then for $D = \Delta(H)$ the GWW DBR will give a $\sigma$-decrease, see https://arxiv.org/abs/2206.11772.

There is no clash because the dbr unitary is being exposed only now.

In call we will are working in the convention that $H' = U^\dagger H U$ where $U=e^{-sW}$ with $W=[D,H]$ or an approximation of that by a group commutator. That is handy because if we switch from the DBI in the Heisenberg picture for the Hamiltonian, we get that the transformation of the state is $|\psi'\rangle = U |\psi\rangle$ so that $\langle H\rangle_{\psi'} = \langle H' \rangle_\psi$ (i.e. when writing the unitary acting on the state dagger notation is avoided).
The group commutator must approximate $U=e^{-s[D,H]}$. This is achieved by setting $r = \sqrt{s}$ so that
$$V = e^{-irH}e^{irD}e^{irH}e^{-irD}$$
because
$$e^{-irH}De^{irH} = D+ir[D,H]+O(r^2)$$
so
$$V\approx e^{irD +i^2 r^2[D,H] + O(r^2) -irD} \approx U\ .$$
See the app in https://arxiv.org/abs/2206.11772 for a derivation.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

tests/test_models_dbi.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Edoardo-Pedicillo Edoardo-Pedicillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @marekgluza looks good to me, please fix the tests and ask me the review again.

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (dbi_fix@52c4868). Click here to learn what that means.

Additional details and impacted files
@@            Coverage Diff             @@
##             dbi_fix    #1293   +/-   ##
==========================================
  Coverage           ?   99.41%           
==========================================
  Files              ?       68           
  Lines              ?     9650           
  Branches           ?        0           
==========================================
  Hits               ?     9594           
  Misses             ?       56           
  Partials           ?        0           
Flag Coverage Δ
unittests 99.41% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@andrea-pasquale andrea-pasquale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marekgluza.
I only have a few minor comments.

tests/test_models_dbi.py Outdated Show resolved Hide resolved
tests/test_models_dbi.py Outdated Show resolved Hide resolved
marekgluza and others added 2 commits April 8, 2024 12:17
Co-authored-by: Andrea Pasquale <[email protected]>
Co-authored-by: Andrea Pasquale <[email protected]>
@Sam-XiaoyueLi Sam-XiaoyueLi merged commit 76c7799 into dbi_fix Apr 9, 2024
21 checks passed
@marekgluza marekgluza deleted the dbi_fix_gc_sign_conventions branch April 9, 2024 10:32
@scarrazza scarrazza added this to the Qibo 0.2.8 milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants