-
Notifications
You must be signed in to change notification settings - Fork 57
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
Double bracket iterations #1047
Conversation
A small working example is provided in the documentation, now the algorithm does not converge because the step is not optimized. @scarrazza now the @andrea-pasquale @MatteoRobbiati feel free to open PRs on top of this branch to contribute :) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1047 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 63 64 +1
Lines 8865 8936 +71
=========================================
+ Hits 8865 8936 +71
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks a lot @Edoardo-Pedicillo for this.
I think it should be better to have it as a model in Qibo. |
Thanks @Edoardo-Pedicillo, I agree with @MatteoRobbiati , better to move in models. Could you please proceed and include some basic tests? |
I've moved the class to from qibo.models.double_bracket import DoubleBracketFlow, DoubleBracketFlowMode
from qibo import set_backend
import numpy as np
from qibo.hamiltonians.hamiltonians import Hamiltonian
from qibo.quantum_info import random_hermitian
import matplotlib.pyplot as plt
set_backend("numpy")
NSTEPS=100
nqubits = 4
h0 = random_hermitian(2**nqubits)
# define DBF
dbf = DoubleBracketFlow(Hamiltonian(nqubits=nqubits, matrix=h0))
for i in range(NSTEPS):
# evolution under canonical commutator
dbf(0.01, DoubleBracketFlowMode.canonical)
# plot matrix
plt.imshow(np.absolute(dbf.h.matrix), cmap='hot', interpolation='nearest') I will proceed with the TODOs. |
Thanks @marekgluza for the feedback. |
Thanks @marekgluza for the feedback, it is a good idea. And thanks @andrea-pasquale for the fast fix. |
for more information, see https://pre-commit.ci
…ook 1 for testing canonical flow on TFIM
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@Sam-XiaoyueLi could you move your commit in a new branch and open a PR pointing to I suggest installing |
For currently the first checkbox the point number 3 which is Hamiltonian simulation from primitive gates in #1034 can now be linked with #1138 for a more detailed discussion. @Edoardo-Pedicillo, can you split the box first checkbox and for the 3rd point link the issue #1138 and tag @shangtai? I will write a more detailed description of point number 2 in #1034 which is about transpiling DBIs. This will be in two stages DBI - > Hamiltonian simulation and Hamiltonian simulation -> primitive gates |
This PR implements a DoubleBracket class and solves #1034.
TODO
examples
@MatteoRobbiatiChecklist: