mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-22 20:36:01 +01:00
Reordering of powers in polynomials
This commit is contained in:
parent
abbc12e160
commit
3852dad53d
@ -12,6 +12,7 @@
|
||||
#define QMCKL_H
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
*** Test :noexport:
|
||||
#+BEGIN_SRC C :tangle test_qmckl_ao.c
|
||||
#include <math.h>
|
||||
#include "qmckl.h"
|
||||
#include "munit.h"
|
||||
MunitResult test_qmckl_ao() {
|
||||
@ -308,10 +307,10 @@ integer function qmckl_ao_polynomial_vgl_f(context, X, R, lmax, n, L, ldl, VGL,
|
||||
n=1
|
||||
dd = 1.d0
|
||||
do d=1,lmax
|
||||
da = 0.d0
|
||||
do a=0,d
|
||||
db = 0.d0
|
||||
do b=0,d-a
|
||||
da = dd
|
||||
do a=d,0,-1
|
||||
db = dd-da
|
||||
do b=d-a,0,-1
|
||||
c = d - a - b
|
||||
dc = dd - da - db
|
||||
n = n+1
|
||||
@ -338,9 +337,9 @@ integer function qmckl_ao_polynomial_vgl_f(context, X, R, lmax, n, L, ldl, VGL,
|
||||
(db-1.d0) * pows(b-2,2) * xz + &
|
||||
(dc-1.d0) * pows(c-2,3) * xy
|
||||
|
||||
db = db + 1.d0
|
||||
db = db - 1.d0
|
||||
end do
|
||||
da = da + 1.d0
|
||||
da = da - 1.d0
|
||||
end do
|
||||
dd = dd + 1.d0
|
||||
end do
|
||||
|
@ -461,7 +461,7 @@ int qmckl_context_get_range(const qmckl_context context) {
|
||||
***** TODO Tests :noexport:
|
||||
|
||||
**** =qmckl_context_get_epsilon=
|
||||
Returns $\epsilon = 2 / \log_{10} 2^{n-1}$ where =n= is the precision
|
||||
Returns $\epsilon = 2^{1-n}$ where =n= is the precision
|
||||
#+BEGIN_SRC C :comments org :tangle qmckl.h
|
||||
double qmckl_context_get_epsilon(const qmckl_context context);
|
||||
#+END_SRC
|
||||
@ -470,7 +470,7 @@ double qmckl_context_get_epsilon(const qmckl_context context);
|
||||
#+BEGIN_SRC C :tangle qmckl_context.c
|
||||
double qmckl_context_get_epsilon(const qmckl_context context) {
|
||||
const qmckl_context_struct* ctx = (qmckl_context_struct*) context;
|
||||
return 1.0 / ((double) ((int64_t) 1 << (ctx->precision-1)));
|
||||
return pow(2.0,(double) 1-ctx->precision);
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
**** Headers :noexport:
|
||||
#+BEGIN_SRC C :comments link :tangle test_qmckl_distance.c
|
||||
#include <math.h>
|
||||
#include "qmckl.h"
|
||||
#include "munit.h"
|
||||
MunitResult test_qmckl_distance() {
|
||||
|
Loading…
Reference in New Issue
Block a user