Closed scemama closed 1 year ago
Note: When I read the value in C, it is correct.
#include <trexio.h>
#include <stdio.h>
int main() {
trexio_exit_code rc;
trexio_t* trexio_file = trexio_open("h2o_dz.h5", 'r', TREXIO_AUTO, &rc);
double rep;
rc = trexio_read_nucleus_repulsion(trexio_file, &rep);
printf("%25.20f\n", rep);
}
$ ./a.out
9.18953375861448762407
@scemama You can try to replace the following line with the following %apply double *OUTPUT { double* const num};
and re-install the Python API
Thanks! It works! :-)
I wrote the nuclear repulsion in a TREXIO file. The nuclear repulsion computed by quantum package is
I store it in a TREXIO file, and when I read it back in Python I get:
The value given by Python is the same with both the text and the HDF5 back-ends.
When I inspect the text files produced by the text backend, I can see that the value of the nuclear repulsion is correct:
So I believe there is a conversion from float64 to float32 in the python interface after reading, but I could not figure out where it comes from...
It seems that I get the problem only for scalars. Arrays seem to be OK.