+1 vote
asked by (1.2k points)

Hi Miles,

I'm new to ITensor. I have a problem when I use "readFromFile" to read MPS or MPO (written on my macbook using "writeToFile") on Linux. The error is:

From line 902, file /users/home/XXXX/itensor/itensor/itensor_interface.ih

Unrecognized type when reading tensor from istream

Unrecognized type when reading tensor from istream
Aborted (core dumped)

The files created on linux cannot be read on macbook, either. Could you please tell me how to solve this problem? Thanks.


1 Answer

0 votes
answered by (70.1k points)

Hi Jin,
Good question. Unfortunately ITensor uses a very simple method to save objects to disk (just a raw binary write/read) which is not guaranteed to work across different platforms.

This is something we would like to improve but has not been a high priority for us yet. Is it a high priority for your use case? If so I can try to make this improvement sooner rather than later.


commented by (1.2k points)
Hi Miles,

Thank you for your reply. It's not a high priority for me. But it would be  more convenient because my account on our server has very limited storage. Sometimes I'd like to download those files and deal with them on my mac. Don't worry if you are busy with other things.

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.