diagTensor() template argument deduction/substitution failed #96

Closed
xyu40 opened this Issue Apr 11, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@xyu40

xyu40 commented Apr 11, 2016

My original goal was to see how the LocalOp::diag() function works (defined in itensor/mps/localop.h). Before ITensor 2, it depended on a function called tieIndices(). In ITensor 2, it involves noprime() and diagTensor() functions to tie the indices, and I want to see if it works the same way.

So, in the itensor/eigensolver.h file, to the davidson() function I added a line of
Tensor ddd = A.diag();
which would call the diag() of a LocalMPO (or LocalMPOSet) object and then wrap the function call to the diag() of a LocalOp object. And then I started a usual DMRG run. However, this resulted in
error: no matching function for call to 'diagTensor'
at line 326:31 of itensor/mps/localop.h
auto Diag = nonprime(Op1 * diagTensor(1,toTie,prime(toTie)),toTie);
The complete error message is attached. I think the template argument deduction/substitution failed for the diagTensor() function.

As for my configuration, I used g++ and framework Accelerate to compile ITensor 2 (the default setting of options.mk). And 'g++ --version' shows
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Does anybody know how to fix this? Thank you!
error.txt

@emstoudenmire

This comment has been minimized.

Show comment
Hide comment
@emstoudenmire

emstoudenmire Apr 11, 2016

Contributor

Hi Xiongjie,
Good idea to convert this to a bug report instead of a discussion board question, as this is the more appropriate place for it.

The method diagTensor I was calling in the buggy code actually doesn't exist anymore! So that's why you were seeing the compilation error. I replaced it with the function delta which makes a diagonal tensor with all entries 1.0 on the diagonal. A delta tensor can be used to do the "tie index" operation.

But at the moment, we aren't even calling the LocalOp::diag method in the Davidson algorithm within DMRG. The reason is kind of complicated, but there was a subtle issue with how we were doing the Davidson preconditioner step in the previous version of ITensor - it was working but doing something slightly incorrect. The fix for it needs more testing to make sure it doesn't slow down the DMRG code too much, but once it's tested LocalOp::diag will again be called from the DMRG code.

Best,
Miles

Contributor

emstoudenmire commented Apr 11, 2016

Hi Xiongjie,
Good idea to convert this to a bug report instead of a discussion board question, as this is the more appropriate place for it.

The method diagTensor I was calling in the buggy code actually doesn't exist anymore! So that's why you were seeing the compilation error. I replaced it with the function delta which makes a diagonal tensor with all entries 1.0 on the diagonal. A delta tensor can be used to do the "tie index" operation.

But at the moment, we aren't even calling the LocalOp::diag method in the Davidson algorithm within DMRG. The reason is kind of complicated, but there was a subtle issue with how we were doing the Davidson preconditioner step in the previous version of ITensor - it was working but doing something slightly incorrect. The fix for it needs more testing to make sure it doesn't slow down the DMRG code too much, but once it's tested LocalOp::diag will again be called from the DMRG code.

Best,
Miles

@xyu40

This comment has been minimized.

Show comment
Hide comment
@xyu40

xyu40 Apr 11, 2016

Hi Miles,
Got it. Thanks for the quick reply!

Best regards,
Xiongjie

xyu40 commented Apr 11, 2016

Hi Miles,
Got it. Thanks for the quick reply!

Best regards,
Xiongjie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment