qiboteam / qibotn

The tensor-network translation module for Qibo.
https://qibo.science
Apache License 2.0
3 stars 1 forks source link

TEBD feature for QuimbBackend #56

Open NithyasriVS opened 3 months ago

NithyasriVS commented 3 months ago

The new TEBD feature under QuimbBackend to calculate entropy, schmidt gap, and z-magnetization values, given a qibo circuit containing hamiltonian, is a Work-in-Progress.

Files changed: quimb.py and eval_qu.py

quimb.py Added support for the new computation setting for TEBD_enabled runcard option

eval_qu.py Implemented 3 functions corresponding to calculation of entropy, schmidt gap, z-magnetization values using quimb

(PR from forked repo is able to merge but feature is WIP)

NithyasriVS commented 2 months ago

It was found that quimb's APIs for TEBD and it's calculations of such above mentioned physical quantities cannot be directly used as there is incompatibility with Qibo. A new design strategy using Trotter decomposition in Qibo is now a WIP which will be updated soon.

alecandido commented 2 months ago

Would you explain what the incompatibility consists of?

Moreover, it would be easier to follow the evolution of the PR, would you open a draft PR? Even from the forked repo, there is no problem with that.

NithyasriVS commented 2 months ago

The incompatibility was due to the physical quantities like entropy not being mappable to a result.state(). Since qibotn's usage is based on execution of circuit using result.state() in qibo to find the final state, a value like entropy could not be directly returned. There is no PR for this as we have now taken a different approach to this feature as discussed with Dr @liweintu, vinitha, and nitin. But the old approach is available in my forked repo.

I'd like to take this opportunity to share the new approach and also share a 2 page feature document I created to better the understanding of the input layer, main layer, and output layer of the feature as well as to highlight a few challenges.

Briefly, Trotter decomposition in qibo lets users write a circuit with a hamiltonian where the hamiltonian gets stored as qibo.gates.Unitary. It works only with symbolic or built-in hamiltonians with dense=False. This means that qibotn’s current structure that is able to only deal with circuits and not directly hamiltonians, can further be extended to do TEBD by using this method for input.

Usage:

ham = hamiltonian.XXZ(nqubits=5)
            circuit = ham.circuit(dt=1e-2)

TEBD Feature document.docx

alecandido commented 2 months ago

Please, share documents in portable formats.

TEBD.Feature.document.pdf

Even better, you can write them directly in GitHub. If too long for a comment, consider opening an issue on its own, using a discussion, or the wiki.

NithyasriVS commented 2 months ago

Sure and thank you!

NithyasriVS commented 1 month ago

PR raised #63