Optimization for fermion system#1709
Conversation
|
It is too bad that this technically breaks ITensorNetworks.jl, since that means we should mark it as a breaking release, otherwise users of ITensorNetworks.jl won't know what version of NDTensors.jl/ITensors.jl they should use to be compatible with ITensorNetworks.jl. To be specific about what can go wrong, once this is released, if we don't mark it as breaking, if a user updates their packages it could break their code using ITensorNetworks.jl through no fault of their own. It is also unfortunate that ITensorNetworks.jl is using internals of NDTensors.jl/ITensors.jl since that makes these breakages more likely as we develop NDTensors.jl/ITensors.jl. For now, can we keep around the previous interface of If we do keep both interfaces, my preference would be that we keep the current interface of I have to say I'm also a bit confused about the switch to using Bumper here, is that also related to the fact that the input may be a Vector or a Tuple and that's an approach that works better for Vector inputs? For Tuple inputs the current implementation makes sense to me. Note that a strategy in ITensorNetworks.jl to avoid calling internals of NDTensors.jl/ITensors.jl, which may be a good strategy to take here, is code duplication, i.e. write a duplicate version of |
|
It looks like the ITensorMPS.jl downstream tests are failing to run properly, I think it is related to some recent changes to the CI infrastructure. I'll look into it. |
|
Yes, good point about the breaking change. I believe there should be a way to make it non-breaking without losing any performance. Let me look into it. The two performance related changes here are:
|
|
Gotcha, I definitely believe you that the changes in this PR make the examples you are running faster, I just don't understand why. |
|
I.e. for Tuple inputs the current code looks fine to me (though maybe I'm missing something) so the only explanation I could think of for why the new code is better is if Vectors are being input. |
|
Ah, I see. Yes I think there are vector inputs sometime - I can check. Happy to discuss a bit more because I don’t fully understand why the previous code was slower. |
|
Ok, I've fixed downstream testing of ITensorMPS.jl and added downstream testing of ITensorNetworks.jl, and it properly picked up that this PR breaks functionality in ITensorNetworks.jl. |
|
Ok to close this, as it is superseded by #1712 |
This PR modifies the code for
compute_permfactorandparity_signin src/fermions/fermions.jl. The resulting changes speed up DMRG calculations using the auto fermion system by about 3x.The main changes are:
oddparray incompute_permfactor. This was the main bottleneck.compute_permfactoras an array or tuple, instead of splatting it.parity_signto use boolean logic (less clear how much this helped but code is not more complicated afterward)Note that this PR breaks the OpSum to TTN system in ITensorNetworks because of one line there which calls
permfactorstill using the "splatting" interface. I'll make a PR to ITensorNetworks updating that.