qiboteam / qibo

A full-stack framework for quantum computing.
https://qibo.science
Apache License 2.0
293 stars 60 forks source link

Hamiltonian simulation from primitive gates for DBI #1138

Closed marekgluza closed 10 months ago

marekgluza commented 11 months ago

@scarrazza an enhancment issue request that @shangtai agreed to help implement.

Running a DBI step cf #1034 for an input Hamiltonian $H0$ for example $$H{\mathrm{TFIM}} = \sum Zi Z{i+1} + h \sum X_i $$ with a variational operator $D_0$, for example $$D_0 = \sum h_i X_i $$ means to implement $$V_1 = e^{is D_0}e^{is H_0} e^{-isD_0}$$

For this we will need to implement evolutions under symbolically prescribed local operators $H_0=\sum h_i$ and $D_0=\sum d_i$

@scarrazza @stavros11 Can you help me plan this to see a) what needs doing and b) how to do it in a smart way so that more things will benefit from our current interests?

More abstract stage:

If I understood @Edoardo-Pedicillo correctly, qibo currently only has the first order Trotter-Suzuki Hamiltonian simulation? What else is in the making? @scarrazza can you give us your opinion which way to push it?

I think we should open an issue "Product formulas for Hamiltonian simulation" and ask @shangtai build a code structure to put in different product formula strategies? For the DBI project the first order will suffice, if we have 2nd or 3rd order then we could also use that.

@shangtai in general all that needs to be implemented are eqs (1-2) here https://arxiv.org/abs/1901.00564

More applied stage: Longer term we'd like to run DBIs on devices which means we need to decompose $e^{it h_i}$ into smaller gates.

TLDR running DBI is about Hamiltonian simulation so requesting help to understand what still needs to be done, thanks!

marekgluza commented 11 months ago

update: @MatteoRobbiati said he will help me understand it better: it seems if there is a unitary in the qibo workflow then it is possible to decompose that evolution into CZ, RX and RZ

marekgluza commented 10 months ago

The resolution is using a notebook by @MatteoRobbiati

https://github.com/MatteoRobbiati/notebooks/blob/main/adiabatic-evolution/evolution.ipynb

We may use the more general AdiabaticHamiltonian which internally has the circuit functions https://github.com/qiboteam/qibo/blob/ac4e4769117b2f75b446dc3c70a93766070efb65/src/qibo/hamiltonians/adiabatic.py#L145 which uses the terms class https://github.com/qiboteam/qibo/blob/ac4e4769117b2f75b446dc3c70a93766070efb65/src/qibo/hamiltonians/terms.py this then is used in https://github.com/qiboteam/qibo/blob/ac4e4769117b2f75b446dc3c70a93766070efb65/src/qibo/hamiltonians/adiabatic.py#L106

thanks @MatteoRobbiati and @shangtai for the instructive discussion! :)