+1 vote
asked by (160 points)
edited by


I find the following issues with MPS class, which I assume are hidden bugs(certainly, fault could be mine). Generally, under some circumstances, the memory allocated to the program exceeds severely it's supposed to need and the whole program seems to fail to terminate peoperly. By saying "some circumstances" I refer to:

when a MPS object is modified by functions(for example, readFromFile) to which the MPS object is passed by reference and functions, which involve matrix multiplication such as overlap and exactApplyMPO, are applied to it.

Specifically, the system I'm working on is a toy-like 4*4 lattice with nearest neighbor Heisenberg Model. It's observed via htop that over 10GB memory is allocated for such calculation, while when such calculation is carried out properly it only requires a few hundreds MB and less than a second.

The way I work this around is to define and modify all MPS inside the main function, which will not be a good idea as the project grows larger. I eagerly look for help and present my thank in advance.

commented by (70.1k points)
Just to follow up on what the resolution of the issue was (for readers of this thread). The exactApplyMPO function was allowing the user to pass an MPS and an MPO which had different site indices, causing the bug to happen. The fix is to make sure that the MPS and MPO have the same site indices, but I am also putting a check into exactApplyMPO to give a useful error message in the future.

1 Answer

0 votes
answered by (70.1k points)
selected by
Best answer

Hi, thanks for the report - could you please email me a code that reproduces the issue? (Ideally with the minimal amount of code and running time to still see the issue.) Otherwise I don't know if I'll be able to see where it could be happening since I haven't been observing this behavior.



commented by (160 points)
Hi Miles,

I've sent to your flatiron email a succinct code example that exhibits the bug.

Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.