I test the example "02_BoseHubbardStatics.py" by both OpenSourceMPS_v2.1 and v3.0 on my laptop. However, the efficiencies are quite different. The time taken by v2.1 is about300s, while it is about 900s for v3.0. Why does the new version take more time?
Best regards,
Liwei
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your post and some extra motivation to tackle this issue, which we are aware of. I'll add some explanation and my personal thoughts. They will increase in technicality, so feel free to skip the remainder once it is getting to technical.
The focus of v3 was on implementing methods for open systems. To achieve a modular programming where we can reuse many subroutines/functions, we had to generalize some methods already presents. Some of them were optimized for MPS; you described the results above. But once we get to optimize these methods again, both closed and open systems will profit, although making bugs less likely and maintenance more feasible.
Let's take a specific example which is one of the problems, i.e., the contractions. v2 had several methods, which were implicitely using information about the quantum numbers from the last steps. This implicit information was ok, since the method could only be used in this spot. This implicit information is now missing. But if you want to parallelize the algorithms with openMP, you have to parallelize all implementation of the contraction in v2 versus one or two subroutines in v3. In fact, v3 has loops basically ready to be used with openMP.
In conclusion, these changes were in my opinion necessary to keep more options open in future releases with a reasonable time effort. We are working hard to get the speed back for our users.
Let me know if you want more details on one or more aspects.
Kind regards,
Daniel
P.S. Another example are the tensors ... in v2 there are vectors (rank 1), matrices (rank 2), rank-3 tensors, and rank-4 tensors, which are a perfectly valid choice for closed systems. Open systems need up to rank-6 tensors. Thus, v3 changed to a generic rank-n tensor in the fortran libraries. We try to keep the python syntax independent of these changes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I test the example "02_BoseHubbardStatics.py" by both OpenSourceMPS_v2.1 and v3.0 on my laptop. However, the efficiencies are quite different. The time taken by v2.1 is about300s, while it is about 900s for v3.0. Why does the new version take more time?
Best regards,
Liwei
Hello Liwei,
Thank you for your post and some extra motivation to tackle this issue, which we are aware of. I'll add some explanation and my personal thoughts. They will increase in technicality, so feel free to skip the remainder once it is getting to technical.
The focus of v3 was on implementing methods for open systems. To achieve a modular programming where we can reuse many subroutines/functions, we had to generalize some methods already presents. Some of them were optimized for MPS; you described the results above. But once we get to optimize these methods again, both closed and open systems will profit, although making bugs less likely and maintenance more feasible.
Let's take a specific example which is one of the problems, i.e., the contractions. v2 had several methods, which were implicitely using information about the quantum numbers from the last steps. This implicit information was ok, since the method could only be used in this spot. This implicit information is now missing. But if you want to parallelize the algorithms with openMP, you have to parallelize all implementation of the contraction in v2 versus one or two subroutines in v3. In fact, v3 has loops basically ready to be used with openMP.
In conclusion, these changes were in my opinion necessary to keep more options open in future releases with a reasonable time effort. We are working hard to get the speed back for our users.
Let me know if you want more details on one or more aspects.
Kind regards,
Daniel
P.S. Another example are the tensors ... in v2 there are vectors (rank 1), matrices (rank 2), rank-3 tensors, and rank-4 tensors, which are a perfectly valid choice for closed systems. Open systems need up to rank-6 tensors. Thus, v3 changed to a generic rank-n tensor in the fortran libraries. We try to keep the python syntax independent of these changes.
Hello Daniel,
Thanks for your patient explanations. OSMPS really helps me a lot.
Best regards,
Liwei