Comments (5)
Does it throw an error if you run in debug mode?
from itensor.
I had the same question – more information on compiling and running in debug mode here:
http://itensor.org/docs.cgi?vers=cppv3&page=formulas/debug_mode
from itensor.
Hi, so I gave a try in debug mode, and looks like it's still working fine?? 🤔
Here is one simple example, a 2 by 2 random tensor, and I ask for T(10, 10), which obviously is nonsense
auto i = Index(2);
auto j = Index(2);
auto T = randomITensor(i, j);
std::cout << "Here is the output: " << elt(T, 10, 10) << std::endl;
and still, I got a zero with no error messages.
Here is what gbd returned to me
root@2d7b272ef1f7:/home/tests# gdb -ex 'run' ./build/test.exe
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/test.exe...
Starting program: /home/tests/build/test.exe
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
warning: File "/usr/local/lib64/libstdc++.so.6.0.30-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/local/lib64/libstdc++.so.6.0.30-gdb.py
--Type <RET> for more, q to quit, c to continue without paging--c
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
[New Thread 0x7fd605e56700 (LWP 135)]
[New Thread 0x7fd605655700 (LWP 136)]
[New Thread 0x7fd5fce54700 (LWP 137)]
Here is the output: 0
===============================================================================
test cases: 1 | 1 passed
assertions: - none -
[Thread 0x7fd605655700 (LWP 136) exited]
[Thread 0x7fd5fce54700 (LWP 137) exited]
[Thread 0x7fd605e56700 (LWP 135) exited]
[Inferior 1 (process 131) exited normally]
p.s. I ran this in Catch2
test case, but that shouldn’t be a problem I think.
from itensor.
Hi there,
I did a more detailed check, and I think this is actually kind of overflow issue?
It seems like elt(T)
can return either zero or infinity to me (yes, not just zero).
#include <catch2/catch_all.hpp>
#include <catch2/catch_test_macros.hpp>
#include "itensor/all.h"
using namespace itensor;
TEST_CASE("Test behaviour of elt(T) func", "[TestFuncElt]") {
auto i = Index(2);
auto j = Index(2);
auto T = randomITensor(i, j);
for (int k = 3; k < 20; ++k) {
// always gives zero or infinity for out-of-range index?
CHECK(((elt(T, k, k) < std::numeric_limits<float>::min()) ||
(elt(T, k, k) > std::numeric_limits<float>::max())));
}
}
outputs:
root@2d7b272ef1f7:/home/tests# ./build/test.exe [TestFuncElt]
Filters: [TestFuncElt]
===============================================================================
All tests passed (17 assertions in 1 test case)
Outputs are about the same in the debug mode, with just some information about the threads. No errors.
from itensor.
Hi, I guess this is forgotten after the new year 😆
from itensor.
Related Issues (20)
- range1 not working like python HOT 2
- (no)prime not working appropriately with <keyword arguments> HOT 1
- Add stracktraces to error messages
- configure/cmake HOT 3
- Introduce `apply` and `contract` MPS/MPO functions
- extract dense ITensor storage HOT 4
- .position() of MPS does not preserve the link index of the MPS HOT 1
- Typo in sample/Makefile
- subscript out of range in itensor/util/autovector.h HOT 2
- Reading input from a .tns file HOT 2
- Should QDense constructor error if zero blocks? HOT 6
- Two issues in installing ITensor c++ on Windows HOT 10
- fatal error: itensor/config.h: No such file or directory HOT 3
- Performing multiple HDF5 operations "captures" cout,cerr HOT 9
- compile error when using OpenBLAS in Ubuntu 22.04 HOT 1
- Losing QN information when reading from HDF5 HOT 1
- Bug: unexpected returning order of indexes HOT 3
- Failure to compile with gcc-13: call of overloaded 'format(..)' is ambiguous HOT 2
- Fixing a bug in Unitttest SECTION("arnoldi (multiple eigenvectors)") HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itensor.