google / TensorNetwork

A library for easy and efficient manipulation of tensor networks.
Apache License 2.0
1.81k stars 356 forks source link

TensorNetwork backend for QuTiP. #950

Open AGaliciaMartinez opened 2 years ago

AGaliciaMartinez commented 2 years ago

I'm currently implementing a TensorNetwork backend for QuTiP [1, 2]. I'd like to use the QuOperator included in TensorNetwork [3], but I see it is not included in the main documentation page and it is not importable because its package folder is lacking an __init__ file.

What is the status of QuOperator?

If the intention is to support it, I can offer some help maintaining it if there is a core developer who can review pull requests and answer questions.

If the intention is to remove it, would you mind if I vendored it into qutip-tensornetwork and evolved it myself from there?

I am also pinging @hodgestar and @nwlambert as the are helping me with the package.

[1] https://qutip.org [2] https://github.com/qutip/qutip-tensornetwork [3] https://github.com/google/TensorNetwork/tree/master/tensornetwork/quantum


Some background on the project:

Currently QuTiP is in its 4-th version but the new, actively developed QuTiP 5, brings some interesting changes. In particular, QuTiP will now able to support different backends. Examples of these backeds are the native Dense and CSR classes that are similar to the ndarray of NumPy and csr of SciPy. Recently, during the Google Summer of Code of 2021, the development of two new backends, qutip-tensorflow and qutip-cupy, was started which brought the possibility to work with GPU's in QuTiP, among other things.

Our goal is to create a qutip-tensornetwork plug-in for QuTiP using TensorNetwork as backend. I was interested in your approach to build tensor networks and I was very excited to see that you support different backends. We expect that a tensor network representation of some operations will be very useful when simulating quantum circuits with qutip-qip as with tensor networks we can describe local operations efficiently, both memory and computation wise. We also hope that this new package, qutip-tensornetwork, proves itself useful describing the operations one encounters in open quantum systems and we further aim to eventually use tensor networks to solve large dynamical open quantum systems more efficiently.

mganahl commented 2 years ago

Hi @AGaliciaMartinez thanks for the message. We added QuOperator a while ago and it hasn't evolved since then. We are not planning to remove it, but at this point there are no plans to develop it further either. Using tensor networks for simulating quantum systems is certainly very interesting, and it would be great if our package can help you with that.

Regarding PR reviews I can certainly do that, but before going down this road it would be useful go gain more clarity about what functionalities you are requiring from us. Based in that we can decide if it makes sense to support this within our package, or if an independent line of development lead by you is the better approach.

AGaliciaMartinez commented 2 years ago

Regarding PR reviews I can certainly do that, but before going down this road it would be useful go gain more clarity about what functionalities you are requiring from us. Based in that we can decide if it makes sense to support this within our package, or if an independent line of development lead by you is the better approach.

What extra functionalities we will require is not clear yet as we are on the early stages of the project and we are figuring out which changes we need to in our side to accommodate a tensor network backed. But example of those could be the conjugation or the addition of two QuOperator's. These are by no means critical to be on your side as our dispatching does not necessarily rely on the native functions of QuOperator, but I thought that I could be nice to add them here should you be interested.

For the moment I opened a PR (#951) to include the __init__.py file so that the quatum module can be imported.