-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add extension to convert
ITensorMPS.MPS
to Tenet.MPS
and viceversa
#251
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super cool!
Project.toml
Outdated
@@ -66,6 +68,7 @@ EinExprs = "0.5, 0.6" | |||
FiniteDifferences = "0.12" | |||
GraphMakie = "0.4,0.5" | |||
Graphs = "1.7" | |||
ITensorMPS = "0.2.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm if we set the patch version, will we have problems when v0.2.7 lands?
like, will it force it to use v0.2.6 or will it be compatible (but not included) up to v0.3.0?
in principle we should only mark major and minor versions, not patch version (unless a patch is completely required for it to work)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmm I don't know, I just put the version since we also had that for ITensors
and ITensorNetworks
. Do you really think this is a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should try to just set the major.minor version. If you need a higher patch version, you should just call Pkg.update()
then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicee! It should be easy to make it work for MPO as well, yes?
so we can finally have MPO to MPS application in Tenet:
function evolve!(tenet_mpo, tenet_mps)
itensor_mps = convert(ITensorMPS.MPS, tenet_mps)
itensor_mpo = convert(ITensorMPS.MPS, tenet_mpo)
o_psi = apply(itensor_mpo, itensor_mps)
o_psi_tenet = convert(MPS, o_psi)
println("🙃 ")
end
I want to merge this, do you approve the PR? @mofeing @starsfordummies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks!
The tests failing are my fault. If they pass locally, you can merge. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #251 +/- ##
=========================================
- Coverage 0.05% 0.04% -0.01%
=========================================
Files 30 32 +2
Lines 1708 2036 +328
=========================================
Hits 1 1
- Misses 1707 2035 +328 ☔ View full report in Codecov by Sentry. |
Summary
This PR resolves #247 by adding
TenetITensorMPSExt
extension, which adds twoconvert
functions to convertITensorMPS.MPS
toTenet.MPS
and viceversa. Additionally, we also added some tests to cover for this function. @starsfordummiesTODO
Example