mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
Added AO struct
This commit is contained in:
parent
7642d336d1
commit
aa8a1fd3b1
1531
src/qmckl_ao.org
Normal file
1531
src/qmckl_ao.org
Normal file
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,7 @@ MunitResult test_<<filename()>>() {
|
||||
#include "qmckl_error_private_type.h"
|
||||
#include "qmckl_memory_private_type.h"
|
||||
#include "qmckl_numprec_private_type.h"
|
||||
#include "qmckl_ao_private_type.h"
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :tangle (eval c)
|
||||
@ -39,6 +40,7 @@ MunitResult test_<<filename()>>() {
|
||||
#include "qmckl_error_type.h"
|
||||
#include "qmckl_context_private_type.h"
|
||||
#include "qmckl_context_type.h"
|
||||
#include "qmckl_numprec_type.h"
|
||||
|
||||
#include "qmckl_memory_private_func.h"
|
||||
#include "qmckl_context_func.h"
|
||||
@ -97,9 +99,9 @@ typedef struct qmckl_context_struct {
|
||||
qmckl_memory_struct memory;
|
||||
|
||||
/* -- Molecular system -- */
|
||||
/* To be implemented:
|
||||
qmckl_ao_basis_struct ao_basis;
|
||||
|
||||
/* To be implemented:
|
||||
qmckl_nucleus_struct nucleus;
|
||||
qmckl_electron_struct electron;
|
||||
qmckl_mo_struct mo;
|
||||
@ -198,6 +200,11 @@ qmckl_context qmckl_context_create() {
|
||||
const qmckl_context context = (const qmckl_context) ctx;
|
||||
assert ( qmckl_context_check(context) != QMCKL_NULL_CONTEXT );
|
||||
|
||||
ctx->numprec.precision = QMCKL_DEFAULT_PRECISION;
|
||||
ctx->numprec.range = QMCKL_DEFAULT_RANGE;
|
||||
|
||||
ctx->ao_basis.uninitialized = (1 << 10) - 1;
|
||||
|
||||
/* Allocate qmckl_memory_struct */
|
||||
{
|
||||
const size_t size = 128L;
|
||||
|
@ -92,7 +92,7 @@ MunitResult test_<<filename()>>() {
|
||||
integer function qmckl_distance_sq_f(context, transa, transb, m, n, A, LDA, B, LDB, C, LDC) result(info)
|
||||
use qmckl
|
||||
implicit none
|
||||
integer*8 , intent(in) :: context
|
||||
integer(qmckl_context) , intent(in) :: context
|
||||
character , intent(in) :: transa, transb
|
||||
integer*8 , intent(in) :: m, n
|
||||
integer*8 , intent(in) :: lda
|
||||
@ -227,15 +227,13 @@ end function qmckl_distance_sq_f
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_src f90 :tangle (eval f) :comments org :exports none
|
||||
integer (qmckl_exit_code) function qmckl_distance_sq &
|
||||
integer (c_int32_t) function qmckl_distance_sq &
|
||||
(context, transa, transb, m, n, A, lda, B, ldb, C, ldc) &
|
||||
bind(C) result(info)
|
||||
|
||||
use, intrinsic :: iso_c_binding
|
||||
import
|
||||
implicit none
|
||||
|
||||
integer (qmckl_context), intent(in) :: context
|
||||
integer (c_int64_t) , intent(in) :: context
|
||||
character , intent(in) :: transa
|
||||
character , intent(in) :: transb
|
||||
integer (c_int64_t) , intent(in) :: m
|
||||
@ -247,7 +245,7 @@ end function qmckl_distance_sq_f
|
||||
real (c_double ) , intent(out) :: C(ldc,n)
|
||||
integer (c_int64_t) , intent(in) :: ldc
|
||||
|
||||
integer (qmckl_exit_code), external :: qmckl_distance_sq_f
|
||||
integer (c_int32_t), external :: qmckl_distance_sq_f
|
||||
info = qmckl_distance_sq_f &
|
||||
(context, transa, transb, m, n, A, lda, B, ldb, C, ldc)
|
||||
|
||||
@ -257,7 +255,7 @@ end function qmckl_distance_sq_f
|
||||
#+CALL: generate_f_interface(table=qmckl_distance_sq_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_src f90 :tangle (eval fh) :comments org :exports none
|
||||
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none
|
||||
interface
|
||||
integer (qmckl_exit_code) function qmckl_distance_sq &
|
||||
(context, transa, transb, m, n, A, lda, B, ldb, C, ldc) &
|
||||
|
@ -289,7 +289,8 @@ int qmckl_get_numprec_range(const qmckl_context context) {
|
||||
|
||||
* Helper functions
|
||||
|
||||
~qmckl_context_get_epsilon~ returns $\epsilon = 2^{1-n}$ where ~n~ is the precision.
|
||||
~qmckl_get_numprec_epsilon~ returns $\epsilon = 2^{1-n}$ where ~n~ is the precision.
|
||||
We need to remove the sign bit from the precision.
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :exports none
|
||||
double qmckl_get_numprec_epsilon(const qmckl_context context);
|
||||
@ -299,7 +300,7 @@ double qmckl_get_numprec_epsilon(const qmckl_context context);
|
||||
#+begin_src c :tangle (eval c)
|
||||
double qmckl_get_numprec_epsilon(const qmckl_context context) {
|
||||
const int precision = qmckl_get_numprec_precision(context);
|
||||
return 1. / (double) (1L << (precision-1));
|
||||
return 1. / (double) (1L << (precision-2));
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
@ -2,4 +2,6 @@ qmckl.org
|
||||
qmckl_error.org
|
||||
qmckl_context.org
|
||||
qmckl_memory.org
|
||||
qmckl_ao.org
|
||||
qmckl_distance.org
|
||||
test_qmckl.org
|
||||
|
Loading…
Reference in New Issue
Block a user