From d95c0b02bf2d5572414573ffd797193ada921e93 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 28 Feb 2026 13:08:17 +0100 Subject: [PATCH 01/48] Test wrapper --- src/v/ac3_print.c | 70 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/src/v/ac3_print.c b/src/v/ac3_print.c index 4cf277b..047c76b 100644 --- a/src/v/ac3_print.c +++ b/src/v/ac3_print.c @@ -1,9 +1,53 @@ #include "v.h" +#include + + +#if 0 + +#define PRINTOUT printf + +#else + +extern char * out_str; + +//#define PRINTOUT(...) printf(__VA_ARGS__); +#define PRINTOUT my_print + + +static void my_print(char * format, ...){ + + static size_t n = 0; + static size_t N = 1024 * 128; // 128 KiB + + if(!out_str){ + out_str = calloc(N, 1); + } + + va_list args; + va_start(args, format); + size_t size = N-n; + size_t m = vsnprintf(out_str+n, size, format, args); + va_end(args); + + if(m >= size){ + N = m < N ? N * 2 : N + 2*m; + out_str = realloc(out_str, N); + va_start(args, format); + vsnprintf(out_str+n, N-n, format, args); + va_end(args); + } + + n += m; +} + +#endif + + void ac3_print(atcoord * ac, double xy0[2], int b){ - printf("$molecule\ncart\n"); + PRINTOUT("$molecule\ncart\n"); for(int k=0; kn; k++){ - printf("%3d % lf % lf % lf", + PRINTOUT("%3d % lf % lf % lf", ac->q[k], xy0[0] + ac->r[k*3 ], xy0[1] + ac->r[k*3+1], @@ -14,27 +58,27 @@ void ac3_print(atcoord * ac, double xy0[2], int b){ if(k1 == -1 ){ break; } - printf("%s%d", j?",":" k=", k1+1); + PRINTOUT("%s%d", j?",":" k=", k1+1); } } - printf("\n"); + PRINTOUT("\n"); } - printf("$end\n"); + PRINTOUT("$end\n"); return; } void ac3_print_xyz(atcoord * ac, double xy0[2]){ - printf("%d\n\n", ac->n); + PRINTOUT("%d\n\n", ac->n); for(int k=0; kn; k++){ const char * s = getname(ac->q[k]); int ok = s && s[0]; if(ok){ - printf(" %-3s", s); + PRINTOUT(" %-3s", s); } else{ - printf(" %3d", ac->q[k]); + PRINTOUT(" %3d", ac->q[k]); } - printf(" % lf % lf % lf\n", + PRINTOUT(" % lf % lf % lf\n", xy0[0] + ac->r[k*3 ], xy0[1] + ac->r[k*3+1], ac->r[k*3+2]); @@ -46,7 +90,7 @@ void ac3_print2fig(atcoord * ac, double xy0[2], int b, double * v){ int n = ac->n; for(int i=0; iq[i], + PRINTOUT("atom %3d% 13.7lf% 13.7lf% 13.7lf\n", ac->q[i], xy0[0] + ac->r[i*3 ], xy0[1] + ac->r[i*3+1], ac->r[i*3+2]); @@ -54,7 +98,7 @@ void ac3_print2fig(atcoord * ac, double xy0[2], int b, double * v){ if(v){ for(int i=0; i<8; i++){ - printf("atom %3d% 13.7lf% 13.7lf% 13.7lf\n", 0, + PRINTOUT("atom %3d% 13.7lf% 13.7lf% 13.7lf\n", 0, xy0[0] + v[i*3 ], xy0[1] + v[i*3+1], v[i*3+2]); @@ -69,14 +113,14 @@ void ac3_print2fig(atcoord * ac, double xy0[2], int b, double * v){ break; } if(k1 < k){ - printf("bond %3d %3d\n", k1+1, k+1); + PRINTOUT("bond %3d %3d\n", k1+1, k+1); } } } } if(v){ -#define LINE(I,J) printf("bond %3d %3d % 3d\n", (J)+n+1, (I)+n+1, -1) +#define LINE(I,J) PRINTOUT("bond %3d %3d % 3d\n", (J)+n+1, (I)+n+1, -1) LINE(0,1); LINE(0,2); LINE(0,3); From 7b19854748515b020ad8ddc9bab27bf0e746f449 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 28 Feb 2026 13:19:43 +0100 Subject: [PATCH 02/48] Runtime dest choice instead of compile-time --- src/v.c | 17 ++++++++++++++++- src/v/ac3_print.c | 44 +++++++++++++++++++------------------------- src/v/v.h | 1 + 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/v.c b/src/v.c index f6da10c..1df419d 100644 --- a/src/v.c +++ b/src/v.c @@ -12,6 +12,9 @@ XFontStruct * fontInfo; int W,H; int (*myDrawString)(); +char * out_str; + + static void init_keys(ptf kp[NKP]){ memset(kp, 0, sizeof(ptf)*NKP); kp[ XKeysymToKeycode(dis, XK_Escape ) ] = kp_exit ; @@ -102,7 +105,7 @@ static drawpars dp_init(void){ return dp; } -int main (int argc, char * argv[]) { +int main_internal (int argc, char * argv[]) { if(argc == 1){ printman(argv[0]); @@ -189,3 +192,15 @@ int main (int argc, char * argv[]) { return 0; } + +int main (int argc, char * argv[]) { + + + out_str = calloc(PRINTBUFLEN, 1); + main_internal(argc, argv); + + printf(out_str); + + free(out_str); + +} diff --git a/src/v/ac3_print.c b/src/v/ac3_print.c index 047c76b..045014c 100644 --- a/src/v/ac3_print.c +++ b/src/v/ac3_print.c @@ -2,45 +2,39 @@ #include -#if 0 - -#define PRINTOUT printf - -#else - extern char * out_str; -//#define PRINTOUT(...) printf(__VA_ARGS__); -#define PRINTOUT my_print +static void PRINTOUT(char * format, ...){ -static void my_print(char * format, ...){ - + va_list args; static size_t n = 0; - static size_t N = 1024 * 128; // 128 KiB + static size_t N = PRINTBUFLEN; if(!out_str){ - out_str = calloc(N, 1); + va_start(args, format); + vfprintf(stdout, format, args); + va_end(args); } + else{ - va_list args; - va_start(args, format); - size_t size = N-n; - size_t m = vsnprintf(out_str+n, size, format, args); - va_end(args); - - if(m >= size){ - N = m < N ? N * 2 : N + 2*m; - out_str = realloc(out_str, N); va_start(args, format); - vsnprintf(out_str+n, N-n, format, args); + size_t size = N-n; + size_t m = vsnprintf(out_str+n, size, format, args); va_end(args); - } - n += m; + if(m >= size){ + N = m < N ? N * 2 : N + 2*m; + out_str = realloc(out_str, N); + va_start(args, format); + vsnprintf(out_str+n, N-n, format, args); + va_end(args); + } + + n += m; + } } -#endif diff --git a/src/v/v.h b/src/v/v.h index 520ca69..3958bc5 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -7,6 +7,7 @@ #define POINTER_SPEED 2.0 #define STRLEN 256 #define BIGSTRLEN 4096 +#define PRINTBUFLEN (1024*128) typedef void (* ptf )(); From 21cb33c0a148c06531aedcb0e7a9fd8b9a458e13 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 28 Feb 2026 14:02:24 +0100 Subject: [PATCH 03/48] Add API fns --- makefile | 2 +- obj/api.d | 2 ++ python/vmol/main.py | 23 +++++++++++++++++++++++ src/api.c | 21 +++++++++++++++++++++ src/v.c | 17 +---------------- 5 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 obj/api.d create mode 100644 src/api.c diff --git a/makefile b/makefile index c047c33..17c0ec7 100644 --- a/makefile +++ b/makefile @@ -49,7 +49,7 @@ INCL=$(SRCDIRS:%=-I./%) allsrc=$(shell find $(SRCDIR) -type f -name '*.c') allobj=$(allsrc:$(SRCDIR)/%.c=$(OBJDIR)/%.o) allpic=$(allsrc:$(SRCDIR)/%.c=$(PICDIR)/%.o) -allmmd=$(allsrc:$(SRCDIR)/%.c=$(OBJDIR)/%.d) +allmmd=$(shell find $(OBJDIR) -type f -name '*.d') OBJDIRS=$(SRCDIRS:$(SRCDIR)%=$(OBJDIR)%) PICDIRS=$(SRCDIRS:$(SRCDIR)%=$(PICDIR)%) diff --git a/obj/api.d b/obj/api.d new file mode 100644 index 0000000..87cc184 --- /dev/null +++ b/obj/api.d @@ -0,0 +1,2 @@ +obj/api.o obj-pic/api.o: src/api.c src/v/v.h src/mol/mol.h \ + src/mol/common.h diff --git a/python/vmol/main.py b/python/vmol/main.py index 00eb3b2..617fc9f 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -14,3 +14,26 @@ def run(args): ret, output = vmol.stdout.capture(main, argc, argv) return ret, output + + +def run1(args): + + lib = ctypes.cdll.LoadLibrary(vmol.SO) + main = lib.main_wrapper2 + + main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] + main.restype = ctypes.c_char_p + + argv = [vmol.SO] + args + argc = len(argv) + argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) + + ret = main(argc, argv) + ret = ret.decode('utf-8') if ret else '' + + free = lib.free_out_str + free.argtypes = None + free.restype = None + free() + + return ret diff --git a/src/api.c b/src/api.c new file mode 100644 index 0000000..aae60b7 --- /dev/null +++ b/src/api.c @@ -0,0 +1,21 @@ +#include "v.h" + +char * out_str; +int main (int argc, char * argv[]); + +int main_wrapper1 (int argc, char * argv[]) { + out_str = calloc(PRINTBUFLEN, 1); + main(argc, argv); + free(out_str); +} + +char * main_wrapper2 (int argc, char * argv[]) { + out_str = calloc(PRINTBUFLEN, 1); + main(argc, argv); + return out_str; +} + +void free_out_str(void){ + free(out_str); + out_str = NULL; +} diff --git a/src/v.c b/src/v.c index 1df419d..d4e5a88 100644 --- a/src/v.c +++ b/src/v.c @@ -12,8 +12,6 @@ XFontStruct * fontInfo; int W,H; int (*myDrawString)(); -char * out_str; - static void init_keys(ptf kp[NKP]){ memset(kp, 0, sizeof(ptf)*NKP); @@ -105,7 +103,7 @@ static drawpars dp_init(void){ return dp; } -int main_internal (int argc, char * argv[]) { +int main (int argc, char * argv[]) { if(argc == 1){ printman(argv[0]); @@ -191,16 +189,3 @@ int main_internal (int argc, char * argv[]) { return 0; } - - -int main (int argc, char * argv[]) { - - - out_str = calloc(PRINTBUFLEN, 1); - main_internal(argc, argv); - - printf(out_str); - - free(out_str); - -} From a61685d86a6957c58b789ccea9623df49669764a Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 28 Feb 2026 19:17:31 +0100 Subject: [PATCH 04/48] Fix api --- src/api.c | 34 ++++++++++++++++++++++++- src/v.c | 12 ++++----- src/v/ac3_print.c | 64 ++++++++++------------------------------------- src/v/evr.c | 4 +-- src/v/man.c | 2 +- src/v/v.h | 6 ++++- 6 files changed, 60 insertions(+), 62 deletions(-) diff --git a/src/api.c b/src/api.c index aae60b7..e19a036 100644 --- a/src/api.c +++ b/src/api.c @@ -1,7 +1,9 @@ +#include #include "v.h" +#define PRINTBUFLEN (1024*128) + char * out_str; -int main (int argc, char * argv[]); int main_wrapper1 (int argc, char * argv[]) { out_str = calloc(PRINTBUFLEN, 1); @@ -19,3 +21,33 @@ void free_out_str(void){ free(out_str); out_str = NULL; } + +void PRINTOUT(FILE * f, char * format, ...){ + + va_list args; + static size_t n = 0; + static size_t N = PRINTBUFLEN; + + if(!out_str){ + va_start(args, format); + vfprintf(f, format, args); + va_end(args); + } + else{ + + va_start(args, format); + size_t size = N-n; + size_t m = vsnprintf(out_str+n, size, format, args); + va_end(args); + + if(m >= size){ + N = m < N ? N * 2 : N + 2*m; + out_str = realloc(out_str, N); + va_start(args, format); + vsnprintf(out_str+n, N-n, format, args); + va_end(args); + } + + n += m; + } +} diff --git a/src/v.c b/src/v.c index d4e5a88..6beca9f 100644 --- a/src/v.c +++ b/src/v.c @@ -61,11 +61,11 @@ static void init_keys(ptf kp[NKP]){ } static void version(FILE * f){ - fprintf(f, "built on "__TIMESTAMP__"\n" - "user: "BUILD_USER"\n" - "directory: "BUILD_DIRECTORY"\n" - "commit: "GIT_HASH" ("GIT_BRANCH")\n" - "\n"); + PRINTOUT(f, "built on "__TIMESTAMP__"\n" + "user: "BUILD_USER"\n" + "directory: "BUILD_DIRECTORY"\n" + "commit: "GIT_HASH" ("GIT_BRANCH")\n" + "\n"); } static drawpars dp_init(void){ @@ -160,7 +160,7 @@ int main (int argc, char * argv[]) { { styp sym; pg(ac, sym, dp.symtol); - printf("%s\n", sym); + PRINTOUT(stdout, "%s\n", sym); }; break; } } diff --git a/src/v/ac3_print.c b/src/v/ac3_print.c index 045014c..16d875e 100644 --- a/src/v/ac3_print.c +++ b/src/v/ac3_print.c @@ -1,47 +1,9 @@ #include "v.h" -#include - - -extern char * out_str; - - -static void PRINTOUT(char * format, ...){ - - va_list args; - static size_t n = 0; - static size_t N = PRINTBUFLEN; - - if(!out_str){ - va_start(args, format); - vfprintf(stdout, format, args); - va_end(args); - } - else{ - - va_start(args, format); - size_t size = N-n; - size_t m = vsnprintf(out_str+n, size, format, args); - va_end(args); - - if(m >= size){ - N = m < N ? N * 2 : N + 2*m; - out_str = realloc(out_str, N); - va_start(args, format); - vsnprintf(out_str+n, N-n, format, args); - va_end(args); - } - - n += m; - } -} - - - void ac3_print(atcoord * ac, double xy0[2], int b){ - PRINTOUT("$molecule\ncart\n"); + PRINTOUT(stdout, "$molecule\ncart\n"); for(int k=0; kn; k++){ - PRINTOUT("%3d % lf % lf % lf", + PRINTOUT(stdout, "%3d % lf % lf % lf", ac->q[k], xy0[0] + ac->r[k*3 ], xy0[1] + ac->r[k*3+1], @@ -52,27 +14,27 @@ void ac3_print(atcoord * ac, double xy0[2], int b){ if(k1 == -1 ){ break; } - PRINTOUT("%s%d", j?",":" k=", k1+1); + PRINTOUT(stdout, "%s%d", j?",":" k=", k1+1); } } - PRINTOUT("\n"); + PRINTOUT(stdout, "\n"); } - PRINTOUT("$end\n"); + PRINTOUT(stdout, "$end\n"); return; } void ac3_print_xyz(atcoord * ac, double xy0[2]){ - PRINTOUT("%d\n\n", ac->n); + PRINTOUT(stdout, "%d\n\n", ac->n); for(int k=0; kn; k++){ const char * s = getname(ac->q[k]); int ok = s && s[0]; if(ok){ - PRINTOUT(" %-3s", s); + PRINTOUT(stdout, " %-3s", s); } else{ - PRINTOUT(" %3d", ac->q[k]); + PRINTOUT(stdout, " %3d", ac->q[k]); } - PRINTOUT(" % lf % lf % lf\n", + PRINTOUT(stdout, " % lf % lf % lf\n", xy0[0] + ac->r[k*3 ], xy0[1] + ac->r[k*3+1], ac->r[k*3+2]); @@ -84,7 +46,7 @@ void ac3_print2fig(atcoord * ac, double xy0[2], int b, double * v){ int n = ac->n; for(int i=0; iq[i], + PRINTOUT(stdout, "atom %3d% 13.7lf% 13.7lf% 13.7lf\n", ac->q[i], xy0[0] + ac->r[i*3 ], xy0[1] + ac->r[i*3+1], ac->r[i*3+2]); @@ -92,7 +54,7 @@ void ac3_print2fig(atcoord * ac, double xy0[2], int b, double * v){ if(v){ for(int i=0; i<8; i++){ - PRINTOUT("atom %3d% 13.7lf% 13.7lf% 13.7lf\n", 0, + PRINTOUT(stdout, "atom %3d% 13.7lf% 13.7lf% 13.7lf\n", 0, xy0[0] + v[i*3 ], xy0[1] + v[i*3+1], v[i*3+2]); @@ -107,14 +69,14 @@ void ac3_print2fig(atcoord * ac, double xy0[2], int b, double * v){ break; } if(k1 < k){ - PRINTOUT("bond %3d %3d\n", k1+1, k+1); + PRINTOUT(stdout, "bond %3d %3d\n", k1+1, k+1); } } } } if(v){ -#define LINE(I,J) PRINTOUT("bond %3d %3d % 3d\n", (J)+n+1, (I)+n+1, -1) +#define LINE(I,J) PRINTOUT(stdout, "bond %3d %3d % 3d\n", (J)+n+1, (I)+n+1, -1) LINE(0,1); LINE(0,2); LINE(0,3); diff --git a/src/v/evr.c b/src/v/evr.c index 0f07fd3..b279590 100644 --- a/src/v/evr.c +++ b/src/v/evr.c @@ -112,9 +112,9 @@ void kp_print_xyz(void * ent, drawpars * dp){ void kp_printrot(void * ent __attribute__ ((unused)), drawpars * dp){ double * U = dp->ac3rmx; for(int i=0; i<3; i++){ - printf("rotation> % 20.15lf % 20.15lf % 20.15lf\n", U[i*3], U[i*3+1], U[i*3+2]); + PRINTOUT(stdout, "rotation> % 20.15lf % 20.15lf % 20.15lf\n", U[i*3], U[i*3+1], U[i*3+2]); } - printf("rot:%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf\n\n", + PRINTOUT(stdout, "rot:%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf\n\n", U[0], U[1], U[2], U[3], U[4], U[5], U[6], U[7], U[8]); return; } diff --git a/src/v/man.c b/src/v/man.c index 0f756b6..aca5a38 100644 --- a/src/v/man.c +++ b/src/v/man.c @@ -1,7 +1,7 @@ #include "v.h" void printman(char * exename){ -printf("\ +fprintf(stderr, "\ \n\ USAGE:\n\ \n\ diff --git a/src/v/v.h b/src/v/v.h index 3958bc5..17841c9 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -7,7 +7,6 @@ #define POINTER_SPEED 2.0 #define STRLEN 256 #define BIGSTRLEN 4096 -#define PRINTBUFLEN (1024*128) typedef void (* ptf )(); @@ -160,3 +159,8 @@ void ac3_text(atcoord * ac, drawpars * dp); void vibro_text(modestr * ms, drawpars * dp); void pg(atcoord * a, styp s, double symtol); +// main.c +int main (int argc, char * argv[]); + +// api.c +void PRINTOUT(FILE * f, char * format, ...); From c21408fd99608b548c7283d5a332e00f8b32fc74 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 1 Mar 2026 14:04:13 +0100 Subject: [PATCH 05/48] Change warning format --- src/mol/common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mol/common.h b/src/mol/common.h index 8152ac4..e7c81d1 100644 --- a/src/mol/common.h +++ b/src/mol/common.h @@ -16,8 +16,14 @@ #define printalive printf("alive @ %s:%d\n", __FILE__, __LINE__); -#define PRINT_ERR(...) fprintf(stderr, "\e[1;31merror:\e[0m " __VA_ARGS__ ); -#define PRINT_WARN(...) fprintf(stderr, "\e[1;35mwarning:\e[0m " __VA_ARGS__ ); +#define PRINT_ERR(...) {\ + fprintf(stderr, "\e[1;31m" "error: " "\e[0m" "\e[1;30m" "[%s:%d]" "\e[0m ", __FILE__, __LINE__);\ + fprintf(stderr, __VA_ARGS__ );\ +} +#define PRINT_WARN(...) {\ + fprintf(stderr, "\e[1;35m" "warning: " "\e[0m" "\e[1;30m" "[%s:%d]" "\e[0m ", __FILE__, __LINE__);\ + fprintf(stderr, __VA_ARGS__ );\ +} typedef char styp[8]; From 257f0aa32eeb0643d6b22680687b2aadc014945f Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 1 Mar 2026 14:09:34 +0100 Subject: [PATCH 06/48] Read mols from stdin --- src/v/load.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/v/load.c b/src/v/load.c index edc0d3f..4914f9e 100644 --- a/src/v/load.c +++ b/src/v/load.c @@ -57,9 +57,15 @@ static vibrstr * mode_read_try(FILE * f, atcoord * ac){ } static FILE * acs_read_newfile(atcoords * acs, char * fname, drawpars * dp){ - FILE * f = fopen(fname, "r"); - if(!f){ - return NULL; + FILE * f; + if(!strcmp(fname, "-")){ + f = stdin; + } + else{ + f = fopen(fname, "r"); + if(!f){ + return NULL; + } } acs_readmore(f, dp->b, dp->center, dp->inertia, dp->bohr, acs, fname); return f; From 35cf94982cb7b8ec2ff12a1f7b5b4d7742bbfe5f Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 1 Mar 2026 14:12:36 +0100 Subject: [PATCH 07/48] Fix one of the readagain bugs --- src/v/evr.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/v/evr.c b/src/v/evr.c index b279590..e25840f 100644 --- a/src/v/evr.c +++ b/src/v/evr.c @@ -75,17 +75,18 @@ void kp_readmore(void * ent, drawpars * dp){ void kp_readagain(void * ent, drawpars * dp){ if(dp->task == AT3COORDS){ + + if(!dp->f || !(fclose(dp->f), dp->f = fopen(dp->fname, "r"))){ + PRINT_WARN("cannot reload the file '%s'\n", dp->fname); + return; + } + atcoords * acs = ent; for(int i=0; in; i++){ free(acs->m[i]); } acs->n = dp->N = dp->n = 0; - if(!dp->f || !(fclose(dp->f), dp->f = fopen(dp->fname, "r"))){ - PRINT_ERR("cannot reload the file '%s'\n", dp->fname); - return; - } - acs_readmore(dp->f, dp->b, dp->center, dp->inertia, dp->bohr, acs, dp->fname); newmol_prep(acs, dp); redraw_ac3 (acs, dp); From bf83b7250a7f0abd3029a51bce6e99f3d24d7933 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 1 Mar 2026 14:22:55 +0100 Subject: [PATCH 08/48] Fix jump bug 728d943 --- src/v/loop.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/v/loop.c b/src/v/loop.c index f177513..b8409f0 100644 --- a/src/v/loop.c +++ b/src/v/loop.c @@ -55,9 +55,8 @@ void main_loop(void * ent, drawpars * dp, ptf kp[NKP]){ case(1): { int frame = atoi(dp->input_text); - if(frame>0 && frameN-1){ - dp->n = frame-1; - } + frame = MAX(1, MIN(frame, dp->N)); + dp->n = frame-1; }; break; } } From 29440af1baa0fbdd352a2b0126e47c66216cafba Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 1 Mar 2026 15:15:24 +0100 Subject: [PATCH 09/48] Add `com` CLI option for gui:0 commands --- README.md | 17 +++++++++++++--- obj/v/headless.d | 3 +++ src/v.c | 27 ++------------------------ src/v/cli.c | 3 ++- src/v/headless.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ src/v/man.c | 7 ++++--- src/v/v.h | 4 ++++ 7 files changed, 79 insertions(+), 32 deletions(-) create mode 100644 obj/v/headless.d create mode 100644 src/v/headless.c diff --git a/README.md b/README.md index ec840f5..498bd04 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ make v ``` ./v file [file2 ... fileN] [options] ``` +A filename `-` stands for the standard input. + Show the reference: ``` ./v @@ -66,8 +68,9 @@ Show the reference: | `shell:b%lf,%lf` | spheres radii in a.u. | | `shell:%lf,%lf` | spheres radii in Å | | `center:%d` | origin is geometric center (`1`, default) / center of mass (`2`) / as is (`0`) | -| `inertia:1` | rotate molecules wrt axis of inertia | +| `inertia:%d` | if rotate molecules wrt axis of inertia (`1`) or not (`0`, default) | | `gui:%d` | normal (default `1`) / headless (`0`) mode | +| `com:%d` | command sequence for `gui:0` | @@ -116,12 +119,20 @@ One can also use the mouse to rotate the molecule and zoom in/out.
Headless mode (in development) -If run in the headless mode with `gui:0`, the symbols from stdio are processed +If run in the headless mode with `gui:0`, the symbols from the standard input are processed as if the corresponding keys were pressed in the normal mode. -Right now, only `p`, `x`, `z`, and `.` are available. For example, +Right now, only `p`, `x`, `z`, and `.` are available. +Command-line option `com:%s` overrides the standard input. +These examples are equivalent: ``` > echo . | ./v mol/mol0001.xyz gui:0 D*h + +> ./v mol/mol0001.xyz gui:0 com:. +D*h + +> cat mol/mol0001.xyz | ./v - gui:0 com:. +D*h ```
diff --git a/obj/v/headless.d b/obj/v/headless.d new file mode 100644 index 0000000..f635684 --- /dev/null +++ b/obj/v/headless.d @@ -0,0 +1,3 @@ +obj/v/headless.o obj-pic/v/headless.o: src/v/headless.c src/v/v.h \ + src/mol/mol.h src/mol/common.h src/v/evr.h src/math/3d.h \ + src/math/matrix.h src/math/vecn.h diff --git a/src/v.c b/src/v.c index 6beca9f..38da664 100644 --- a/src/v.c +++ b/src/v.c @@ -76,6 +76,7 @@ static drawpars dp_init(void){ memset(dp.input_text, 0, STRLEN); dp.dt = DEFAULT_TIMEOUT; memset(dp.fontname, 0, STRLEN); + memset(dp.com, 0, STRLEN); dp.n = 0; dp.fbw = 0; dp.num = 0; @@ -141,31 +142,7 @@ int main (int argc, char * argv[]) { } if(!dp.gui){ - - atcoord * ac = ((atcoords *)ent)->m[dp.n]; - if(dp.b>0 && !ac->bond_flag){ - bonds_fill(dp.rl, dp.bmax, ac); - } - - int c; - while((c = getc(stdin))!=EOF){ - switch(c){ - case('p'): - kp_print2fig(ent, &dp); break; - case('z'): - kp_print_xyz(ent, &dp); break; - case('x'): - kp_print(ent, &dp); break; - case('.'): - { - styp sym; - pg(ac, sym, dp.symtol); - PRINTOUT(stdout, "%s\n", sym); - }; break; - } - } - ent_free(ent, &dp); - return 0; + return headless(&dp, ent); } /*= X11 init ===============================================================*/ diff --git a/src/v/cli.c b/src/v/cli.c index c48cb9c..067d82b 100644 --- a/src/v/cli.c +++ b/src/v/cli.c @@ -92,11 +92,12 @@ int cli_parse(char * arg, drawpars * dp){ int a9 = sscanf (arg, "frame:%d", &frame); int a10 = sscanf (arg, "center:%d", &(dp->center)); int a11 = sscanf (arg, "inertia:%d", &(dp->inertia)); + int a12 = sscanf (arg, "com:%255s", dp->com); int rot_count = sscan_rot (arg, rot); int cell_count = sscan_cell (arg, cell); int shell_count = sscan_shell(arg, shell); - int cli = a0||a1||a2||a3||a4||a5||a6||a7||a8||a9||a10||a11 || rot_count||cell_count||shell_count; + int cli = a0||a1||a2||a3||a4||a5||a6||a7||a8||a9||a10||a11||a12 || rot_count||cell_count||shell_count; if(vib==0){ dp->task = AT3COORDS; diff --git a/src/v/headless.c b/src/v/headless.c new file mode 100644 index 0000000..7867e55 --- /dev/null +++ b/src/v/headless.c @@ -0,0 +1,50 @@ +#include "v.h" +#include "evr.h" + +int headless(drawpars * dp, void * ent){ + atcoord * ac = ((atcoords *)ent)->m[dp->n]; + if(dp->b>0 && !ac->bond_flag){ + bonds_fill(dp->rl, dp->bmax, ac); + } + + char * com = dp->com; + char c; + + while(1){ + if (dp->com[0]!='\0'){ + c = *(com++); + } + else{ + c = getc(stdin); + } + if ((c == '\0') || (c == EOF)){ + break; + } + + switch(c){ + case('p'): + kp_print2fig(ent, dp); break; + case('z'): + kp_print_xyz(ent, dp); break; + case('x'): + kp_print(ent, dp); break; + case('.'): + { + styp sym; + pg(ac, sym, dp->symtol); + PRINTOUT(stdout, "%s\n", sym); + }; break; + + case(' '): + case('\n'): + break; + + default: + { + PRINT_WARN("Unknown command: %c\n", c); break; + } + } + } + ent_free(ent, dp); + return 0; +} diff --git a/src/v/man.c b/src/v/man.c index aca5a38..c7a2e24 100644 --- a/src/v/man.c +++ b/src/v/man.c @@ -5,7 +5,7 @@ fprintf(stderr, "\ \n\ USAGE:\n\ \n\ - %s file [options] \n\ + %s file[s] [options] \n\ \n\ OPTIONS:\n\ \n\ @@ -29,8 +29,9 @@ fprintf(stderr, "\ shell:b%%lf,%%lf spheres radii in a.u. \n\ shell:%%lf,%%lf spheres radii in Å \n\ center:%%d origin is geometric center (1, default) / center of mass (2) / as is (0) \n\ - inertia:1 rotate molecules wrt axis of inertia \n\ - gui:%%d` normal (1) / headless (0) mode \n\ + inertia:%%d if rotate molecules wrt axis of inertia (1) or not (0, default) \n\ + gui:%%d normal (1) / headless (0) mode \n\ + com:%%s command sequence for gui:0 \n\ \n\ KEYBOARD REFERENCE:\n\ \n\ diff --git a/src/v/v.h b/src/v/v.h index 17841c9..39ff759 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -94,6 +94,7 @@ typedef struct { int bohr; // 0: Å 1: Bohr // int closed; // 1: time to go + char com[STRLEN]; // command string for gui:0 } drawpars; typedef struct { @@ -159,6 +160,9 @@ void ac3_text(atcoord * ac, drawpars * dp); void vibro_text(modestr * ms, drawpars * dp); void pg(atcoord * a, styp s, double symtol); +// headless.c +int headless(drawpars * dp, void * ent); + // main.c int main (int argc, char * argv[]); From 95cad022d678231450ace6b5e1f5e810277edc8f Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 1 Mar 2026 20:58:22 +0100 Subject: [PATCH 10/48] Refactor CLI --- src/v.c | 52 ++------------------------------------------------- src/v/cli.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/v/load.c | 16 +++++++++++----- src/v/v.h | 8 ++++++-- 4 files changed, 71 insertions(+), 58 deletions(-) diff --git a/src/v.c b/src/v.c index 38da664..7a44a12 100644 --- a/src/v.c +++ b/src/v.c @@ -68,42 +68,6 @@ static void version(FILE * f){ "\n"); } -static drawpars dp_init(void){ - drawpars dp; - dp.task = UNKNOWN; - dp.gui = 1; - dp.input = 0; - memset(dp.input_text, 0, STRLEN); - dp.dt = DEFAULT_TIMEOUT; - memset(dp.fontname, 0, STRLEN); - memset(dp.com, 0, STRLEN); - dp.n = 0; - dp.fbw = 0; - dp.num = 0; - dp.t = 0; - dp.rl = 1.0; - dp.r = 1.0; - dp.xy0[0] = dp.xy0[1] = 0.0; - mx_id(3, dp.ac3rmx); - // from command-line - dp.inertia = 0; - dp.center = 1; - dp.b = 1; - dp.bmax = 0.0; - dp.symtol = DEFAULT_SYMTOL; - dp.vert = -1; - dp.z[0] = dp.z[1] = dp.z[2] = dp.z[3] = dp.z[4] = 0; - vecset(3*8, dp.vertices, 0.0); - // from data read - dp.scale = 1.0; - dp.N = 0.0; - dp.f = NULL; - dp.fname = NULL; - dp.bohr = 0; - dp.closed = 0; - return dp; -} - int main (int argc, char * argv[]) { if(argc == 1){ @@ -114,21 +78,9 @@ int main (int argc, char * argv[]) { /*= Input ==================================================================*/ - drawpars dp = dp_init(); - int fn = 0; - char ** flist = malloc(argc*sizeof(char*)); - for(int i=1; in = frame-1; + if(!cli){ + dp->input_files[dp->input_files_n++] = arg; + } return cli; } + +static drawpars dp_init(void){ + drawpars dp; + dp.task = UNKNOWN; + dp.gui = 1; + dp.input = 0; + memset(dp.input_text, 0, STRLEN); + dp.dt = DEFAULT_TIMEOUT; + memset(dp.fontname, 0, STRLEN); + dp.n = 0; + dp.fbw = 0; + dp.num = 0; + dp.t = 0; + dp.rl = 1.0; + dp.r = 1.0; + dp.xy0[0] = dp.xy0[1] = 0.0; + mx_id(3, dp.ac3rmx); + // from command-line + dp.inertia = 0; + dp.center = 1; + dp.b = 1; + dp.bmax = 0.0; + dp.symtol = DEFAULT_SYMTOL; + dp.vert = -1; + dp.z[0] = dp.z[1] = dp.z[2] = dp.z[3] = dp.z[4] = 0; + vecset(3*8, dp.vertices, 0.0); + memset(dp.com, 0, STRLEN); + dp.input_files_n = 0; + dp.input_files = NULL; + // from data read + dp.scale = 1.0; + dp.N = 0; + dp.f = NULL; + dp.fname = NULL; + dp.bohr = 0; + // runtime + dp.closed = 0; + return dp; +} + +drawpars cli_parse(int argc, char ** argv){ + drawpars dp = dp_init(); + dp.input_files = malloc(argc*sizeof(char*)); + for(int i=1; iinput_files_n; + char ** flist = dp->input_files; + void * ent = NULL; int i=0; + + // read the first available file while(itask == AT3COORDS){ atcoords * acs = ent; int n0 = fill_nf(acs, 0); @@ -147,5 +149,9 @@ void * read_files(int fn, char ** flist, drawpars * dp){ else{ dp->z[0] = 0; } + + free(dp->input_files); + dp->input_files = NULL; + return ent; } diff --git a/src/v/v.h b/src/v/v.h index 39ff759..9a6f623 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -95,6 +95,10 @@ typedef struct { // int closed; // 1: time to go char com[STRLEN]; // command string for gui:0 + + int input_files_n; // number of input files + char ** input_files; // input files + } drawpars; typedef struct { @@ -104,7 +108,7 @@ typedef struct { // load.c void acs_readmore (FILE * f, int b, int center, int inertia, int bohr, atcoords * acs, const char * fname); -void * read_files(int fn, char ** flist, drawpars * dp); +void * read_files(drawpars * dp); // scale.c double ac3_scale(atcoord * ac); double acs_scale(atcoords * acs); @@ -119,7 +123,7 @@ txyz * ac3_read_xyz(int * n_p, FILE * f); // man.c void printman(char * exename); // cli.c -int cli_parse(char * arg, drawpars * dp); +drawpars cli_parse(int argc, char ** argv); // loop.c void main_loop(void * ent, drawpars * dp, ptf kp[NKP]); From 936cd8ddf61aae86cad0ce50287d0f3857500273 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 1 Mar 2026 22:47:07 +0100 Subject: [PATCH 11/48] Add reader to read from variable TODO: add API wrapper --- src/api.c | 32 ++++++++++++++++- src/v.c | 3 +- src/v/ac3_read.c | 92 +++++++++++++++++++++++++++--------------------- src/v/load.c | 32 +++++++++++++++-- src/v/v.h | 11 ++++++ 5 files changed, 125 insertions(+), 45 deletions(-) diff --git a/src/api.c b/src/api.c index e19a036..ae32f88 100644 --- a/src/api.c +++ b/src/api.c @@ -4,11 +4,13 @@ #define PRINTBUFLEN (1024*128) char * out_str; +in_str_t in_str; int main_wrapper1 (int argc, char * argv[]) { out_str = calloc(PRINTBUFLEN, 1); - main(argc, argv); + int ret = main(argc, argv); free(out_str); + return ret; } char * main_wrapper2 (int argc, char * argv[]) { @@ -51,3 +53,31 @@ void PRINTOUT(FILE * f, char * format, ...){ n += m; } } + + +void * READ_FILES(drawpars * dp){ + + //////////////////////////////////////////// + // this should be set up by a wrapper that calls main + //in_str.n = 2; + //int q[] = {1, 1}; + //double r[] = {0, 0, 0, 1, 0, 0}; + //char * const name = "molname"; + //in_str.q = q; + //in_str.r = r; + //in_str.name = name; + //////////////////////////////////////////// + + void * ret; + if(!in_str.n){ + ret = read_files(dp); + } + else{ + ret = get_in_str(in_str, dp); + } + + free(dp->input_files); + dp->input_files = NULL; + return ret; + +} diff --git a/src/v.c b/src/v.c index 7a44a12..a852320 100644 --- a/src/v.c +++ b/src/v.c @@ -80,7 +80,8 @@ int main (int argc, char * argv[]) { drawpars dp = cli_parse(argc, argv); - void * ent = read_files(&dp); + void * ent = READ_FILES(&dp); + if(!ent){ PRINT_ERR("no files to read\n"); return 1; diff --git a/src/v/ac3_read.c b/src/v/ac3_read.c index 42ae683..57cf11f 100644 --- a/src/v/ac3_read.c +++ b/src/v/ac3_read.c @@ -4,47 +4,8 @@ #define END(S,X) ( (S)->X + (X##_size)/sizeof(*((S)->X)) ) -atcoord * ac3_read(FILE * f, int b, int center, int inertia, int bohr, const char * fname, format_t * format){ - int n; - int zmat=0; - txyz * a; - - switch(*format){ - case XYZ: - if((a=ac3_read_xyz(&n, f))){ - *format = XYZ; - } - break; - case IN: - if((a=ac3_read_in(&n, &zmat, f))){ - *format = IN; - } - break; - case OUT: - if((a=ac3_read_out(&n, f))){ - *format = OUT; - } - break; - default: - if((a=ac3_read_xyz(&n, f))){ - *format = XYZ; - } - if(!a){ - if((a=ac3_read_in(&n, &zmat, f))){ - *format = IN; - } - } - if(!a){ - if((a=ac3_read_out(&n, f))){ - *format = OUT; - } - } - break; - } - if(!a){ - return NULL; - } +atcoord * atcoord_fill(int n, txyz * a, const char * fname, int b, int center, int inertia, int bohr){ size_t q_size = sizeof(int ) * n; size_t r_size = sizeof(double) * n*3; @@ -75,6 +36,8 @@ atcoord * ac3_read(FILE * f, int b, int center, int inertia, int bohr, const cha } memset(m->sym, 0, sizeof(m->sym)); + m->fname = fname; + for(int i=0; iq[i] = a[i].t; if(bohr){ @@ -89,7 +52,54 @@ atcoord * ac3_read(FILE * f, int b, int center, int inertia, int bohr, const cha if(center){ center_mol(n, m->r, center==2 ? m->q : NULL); } - m->fname = fname; + + return m; +} + + +atcoord * ac3_read(FILE * f, int b, int center, int inertia, int bohr, const char * fname, format_t * format){ + + int n; + int zmat=0; + txyz * a; + + switch(*format){ + case XYZ: + if((a=ac3_read_xyz(&n, f))){ + *format = XYZ; + } + break; + case IN: + if((a=ac3_read_in(&n, &zmat, f))){ + *format = IN; + } + break; + case OUT: + if((a=ac3_read_out(&n, f))){ + *format = OUT; + } + break; + default: + if((a=ac3_read_xyz(&n, f))){ + *format = XYZ; + } + if(!a){ + if((a=ac3_read_in(&n, &zmat, f))){ + *format = IN; + } + } + if(!a){ + if((a=ac3_read_out(&n, f))){ + *format = OUT; + } + } + break; + } + if(!a){ + return NULL; + } + + atcoord * m = atcoord_fill(n, a, fname, b, center, inertia, bohr); #if 0 printf("%d\n\n", n); diff --git a/src/v/load.c b/src/v/load.c index 59cad73..c02b881 100644 --- a/src/v/load.c +++ b/src/v/load.c @@ -141,9 +141,7 @@ void * read_files(drawpars * dp){ } } dp->scale = acs_scale(acs); - dp->N = 0; newmol_prep(acs, dp); - dp->N = acs->n; intcoord_check(INT_MAX, dp->z); } else{ @@ -155,3 +153,33 @@ void * read_files(drawpars * dp){ return ent; } + +atcoords * get_in_str(in_str_t in_str, drawpars * dp){ + + if(dp->task==VIBRO){ + PRINT_WARN("cannot read vibrations from input variable\n"); + } + dp->task = AT3COORDS; + dp->fname = in_str.name; + + int n = in_str.n; + txyz * xyz = malloc(sizeof(txyz)*n); + for(int i=0; iNmem = 1; + acs->n = 0; + acs->m = malloc(acs->Nmem*sizeof(atcoord *)); + acs->m[acs->n++] = atcoord_fill(n, xyz, in_str.name, dp->b, dp->center, dp->inertia, dp->bohr); + + fill_nf(acs, 0); + dp->scale = acs_scale(acs); + newmol_prep(acs, dp); + intcoord_check(INT_MAX, dp->z); + + return acs; +} diff --git a/src/v/v.h b/src/v/v.h index 9a6f623..c7f6eb7 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -106,7 +106,16 @@ typedef struct { double r[3]; } txyz; +typedef struct { + int n; + int * q; + double * r; + char * name; +} in_str_t; + + // load.c +atcoords * get_in_str(in_str_t in_str, drawpars * dp); void acs_readmore (FILE * f, int b, int center, int inertia, int bohr, atcoords * acs, const char * fname); void * read_files(drawpars * dp); // scale.c @@ -115,6 +124,7 @@ double acs_scale(atcoords * acs); // mode_read.c modestr * mode_read(FILE * f, int na); // ac3_read*.c +atcoord * atcoord_fill(int n, txyz * a, const char * fname, int b, int center, int inertia, int bohr); atcoord * ac3_read(FILE * f, int b, int center, int inertia, int bohr, const char * fname, format_t * format); txyz * ac3_read_in (int * n_p, int * zmat, FILE * f); txyz * ac3_read_out(int * n_p, FILE * f); @@ -172,3 +182,4 @@ int main (int argc, char * argv[]); // api.c void PRINTOUT(FILE * f, char * format, ...); +void * READ_FILES(drawpars * dp); From 037fdfa7e4f4be8e6f23149174f1d06c85026219 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Mon, 2 Mar 2026 14:04:50 +0100 Subject: [PATCH 12/48] API to pass a molecule --- python/examples/ex4.py | 23 ++++++++++++++++++ python/pyproject.toml | 3 +++ python/vmol/main.py | 55 ++++++++++++++++++++++++++++++++++++++++++ src/api.c | 44 ++++++++++++++++++--------------- src/mol/inertia.c | 2 +- src/v.c | 2 +- src/v/load.c | 6 ++--- src/v/v.h | 1 + 8 files changed, 112 insertions(+), 24 deletions(-) create mode 100755 python/examples/ex4.py diff --git a/python/examples/ex4.py b/python/examples/ex4.py new file mode 100755 index 0000000..6fb7c03 --- /dev/null +++ b/python/examples/ex4.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import vmol +import numpy as np + +# mol/mol0001.xyz +name = 'acetylene' +q = [6, 6, 1, 1] +r = [ + [0.99495, 0.00000, 0.00000], + [2.19521, 0.00000, 0.00000], + [-0.07071, 0.00000, 0.00000], + [3.26087, 0.00000, 0.00000] + ] + +point_group = vmol.main.run2(q, r, name=name, args=['gui:0', 'com:.']) +print(point_group) + +# rotation matrix +rot = 'rot:0.587785,0.000000,0.809017,0.670705,0.559193,-0.487296,-0.452397,0.829038,0.328685' +xyz = vmol.main.run2(q, r, name=name, args=[rot]) +print('captured output:') +print(xyz) diff --git a/python/pyproject.toml b/python/pyproject.toml index 87c108b..4ece3ba 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -27,6 +27,9 @@ classifiers = [ ] requires-python = ">=3.10" +dependencies = [ + 'numpy >= 1.24', +] [project.urls] Repository = "https://github.com/briling/v.git" diff --git a/python/vmol/main.py b/python/vmol/main.py index 617fc9f..0c9fd0b 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -1,6 +1,17 @@ import ctypes +import numpy as np import vmol + +class in_str_t(ctypes.Structure): + _fields_ = [ + ("n", ctypes.c_int), + ("q", ctypes.POINTER(ctypes.c_int)), + ("r", ctypes.POINTER(ctypes.c_double)), + ("name", ctypes.c_char_p), + ] + + def run(args): lib = ctypes.cdll.LoadLibrary(vmol.SO) main = lib.main @@ -37,3 +48,47 @@ def run1(args): free() return ret + + +def run2(q, r, name=None, args=None): + + lib = ctypes.cdll.LoadLibrary(vmol.SO) + main = lib.main_wrapper3 + + main.argtypes = [in_str_t, ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] + main.restype = ctypes.c_char_p + + if args is None: + args = [] + + if not isinstance(name, bytes): + name = str(name).encode('utf-8') + r = np.ascontiguousarray(r, dtype=ctypes.c_double) + q = np.ascontiguousarray(q, dtype=ctypes.c_int) + n = len(q) + + if q.ndim != 1: + raise ValueError("q must be a 1D array") + if r.shape != (n, 3): + raise ValueError(f"r must be a 2D array with shape ({n}, 3)") + + in_str = in_str_t( + n=n, + q=q.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), + r=r.flatten().ctypes.data_as(ctypes.POINTER(ctypes.c_double)), + name=name, + ) + + argv = [vmol.SO] + args + argc = len(argv) + argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) + + ret = main(in_str, argc, argv) + ret = ret.decode('utf-8') if ret else '' + + free = lib.free_out_str + free.argtypes = None + free.restype = None + free() + + return ret diff --git a/src/api.c b/src/api.c index ae32f88..11d41e3 100644 --- a/src/api.c +++ b/src/api.c @@ -2,6 +2,7 @@ #include "v.h" #define PRINTBUFLEN (1024*128) +#define FREE0(PTR) { free(PTR); PTR = NULL; } char * out_str; in_str_t in_str; @@ -9,7 +10,7 @@ in_str_t in_str; int main_wrapper1 (int argc, char * argv[]) { out_str = calloc(PRINTBUFLEN, 1); int ret = main(argc, argv); - free(out_str); + FREE0(out_str); return ret; } @@ -19,9 +20,16 @@ char * main_wrapper2 (int argc, char * argv[]) { return out_str; } +char * main_wrapper3 (in_str_t in_str_, int argc, char * argv[]) { + in_str = in_str_; + out_str = calloc(PRINTBUFLEN, 1); + main(argc, argv); + return out_str; +} + void free_out_str(void){ - free(out_str); - out_str = NULL; + FREE0(out_str); + PRINTOUT(NULL, NULL); } void PRINTOUT(FILE * f, char * format, ...){ @@ -30,6 +38,13 @@ void PRINTOUT(FILE * f, char * format, ...){ static size_t n = 0; static size_t N = PRINTBUFLEN; + // call to reset n and N + if(!format){ + n = 0; + N = PRINTBUFLEN; + return; + } + if(!out_str){ va_start(args, format); vfprintf(f, format, args); @@ -54,20 +69,7 @@ void PRINTOUT(FILE * f, char * format, ...){ } } - void * READ_FILES(drawpars * dp){ - - //////////////////////////////////////////// - // this should be set up by a wrapper that calls main - //in_str.n = 2; - //int q[] = {1, 1}; - //double r[] = {0, 0, 0, 1, 0, 0}; - //char * const name = "molname"; - //in_str.q = q; - //in_str.r = r; - //in_str.name = name; - //////////////////////////////////////////// - void * ret; if(!in_str.n){ ret = read_files(dp); @@ -75,9 +77,13 @@ void * READ_FILES(drawpars * dp){ else{ ret = get_in_str(in_str, dp); } - - free(dp->input_files); - dp->input_files = NULL; + FREE0(dp->input_files); return ret; +} +int SHOULD_PRINT_MAN(int argc){ + if((argc==1) && (!in_str.n)){ + return 1; + } + return 0; } diff --git a/src/mol/inertia.c b/src/mol/inertia.c index 06b1409..5330345 100644 --- a/src/mol/inertia.c +++ b/src/mol/inertia.c @@ -39,7 +39,7 @@ void center_mol(int n, double * r, int * q){ } void position(mol * m, double d[3], int preserve_chirality){ - if(d==NULL){ + if(!d){ double d1[3]; d = d1; } diff --git a/src/v.c b/src/v.c index a852320..b0f7c7b 100644 --- a/src/v.c +++ b/src/v.c @@ -70,7 +70,7 @@ static void version(FILE * f){ int main (int argc, char * argv[]) { - if(argc == 1){ + if(SHOULD_PRINT_MAN(argc)){ printman(argv[0]); version(stdout); return 0; diff --git a/src/v/load.c b/src/v/load.c index c02b881..cb81914 100644 --- a/src/v/load.c +++ b/src/v/load.c @@ -148,14 +148,14 @@ void * read_files(drawpars * dp){ dp->z[0] = 0; } - free(dp->input_files); - dp->input_files = NULL; - return ent; } atcoords * get_in_str(in_str_t in_str, drawpars * dp){ + for(int i=0; iinput_files_n; i++){ + PRINT_WARN("ignoring file '%s'\n", dp->input_files[i]); + } if(dp->task==VIBRO){ PRINT_WARN("cannot read vibrations from input variable\n"); } diff --git a/src/v/v.h b/src/v/v.h index c7f6eb7..83e456b 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -183,3 +183,4 @@ int main (int argc, char * argv[]); // api.c void PRINTOUT(FILE * f, char * format, ...); void * READ_FILES(drawpars * dp); +int SHOULD_PRINT_MAN(int argc); From 3134d25f32d034ee658f3714d5fd59b4b74d67d9 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Mon, 2 Mar 2026 14:22:27 +0100 Subject: [PATCH 13/48] Lint python --- .github/workflows/lint.yml | 26 ++++++++++++++++++++++++++ python/README.md | 3 +-- python/examples/ex4.py | 3 +-- python/ruff.toml | 33 +++++++++++++++++++++++++++++++++ python/vmol/__init__.py | 3 +++ python/vmol/main.py | 6 +++--- python/vmol/stdout.py | 3 +++ 7 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 python/ruff.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7a879df --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint Python with Ruff + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + lint: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + - name: Install Ruff + run: pip install ruff + - name: Run Ruff + run: ruff check vmol/ examples/ + working-directory: ./python diff --git a/python/README.md b/python/README.md index 5f71c6f..0da3cb6 100644 --- a/python/README.md +++ b/python/README.md @@ -85,8 +85,7 @@ To subsitute the `.so`, put in in the same directory or change manually: >>> # and a stdout parsing module `stdout` >>> dir(vmol) ['SO', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', - '__package__', '__path__', '__spec__', '_exists', '_paths', '_suffix', '_v', - 'get_config_var', 'get_path', 'main', 'os', 'stdout'] +'__package__', '__path__', '__spec__', '_exists', '_paths', 'main', 'stdout'] >>> # the arguments are the same as the CLI ones: >>> args = ['v/mol/MOL_3525.xyz'] diff --git a/python/examples/ex4.py b/python/examples/ex4.py index 6fb7c03..491069c 100755 --- a/python/examples/ex4.py +++ b/python/examples/ex4.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import vmol -import numpy as np # mol/mol0001.xyz name = 'acetylene' @@ -10,7 +9,7 @@ [0.99495, 0.00000, 0.00000], [2.19521, 0.00000, 0.00000], [-0.07071, 0.00000, 0.00000], - [3.26087, 0.00000, 0.00000] + [3.26087, 0.00000, 0.00000], ] point_group = vmol.main.run2(q, r, name=name, args=['gui:0', 'com:.']) diff --git a/python/ruff.toml b/python/ruff.toml new file mode 100644 index 0000000..624b1c7 --- /dev/null +++ b/python/ruff.toml @@ -0,0 +1,33 @@ +exclude = [ + "__init__.py", +] + +indent-width = 4 +target-version = "py313" + +[format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" + +[lint] + +select = [ + "A", "E", "F", "B", + "S", "COM", "C4", "EXE", "ICN", "PIE", "PLR1714", "ARG", + "PERF", "FURB", "PLE", "TRY002", "W", "UP", "RUF", "SIM", "NPY", + "FIX", "TD", +] +ignore = [ + "E501", # line length +] + +preview = true + +extend-ignore = [ + # whitespaces + "E201", "E202", "E203", "E211", + "E221", "E222", "E225", "E226", "E228", + "E231", "E241", "E271", "E272", +] diff --git a/python/vmol/__init__.py b/python/vmol/__init__.py index 850a5d8..aa1a54a 100644 --- a/python/vmol/__init__.py +++ b/python/vmol/__init__.py @@ -16,3 +16,6 @@ _exists = [os.path.isfile(p) for p in _paths] SO = _paths[_exists.index(True)] if sum(_exists) else None + +del _v, _suffix +del get_config_var, get_path, os diff --git a/python/vmol/main.py b/python/vmol/main.py index 0c9fd0b..f3e7a50 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -19,7 +19,7 @@ def run(args): main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] main.restype = ctypes.c_int - argv = [vmol.SO] + args + argv = [vmol.SO, *args] argc = len(argv) argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) @@ -35,7 +35,7 @@ def run1(args): main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] main.restype = ctypes.c_char_p - argv = [vmol.SO] + args + argv = [vmol.SO, *args] argc = len(argv) argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) @@ -79,7 +79,7 @@ def run2(q, r, name=None, args=None): name=name, ) - argv = [vmol.SO] + args + argv = [vmol.SO, *args] argc = len(argv) argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) diff --git a/python/vmol/stdout.py b/python/vmol/stdout.py index a42cd33..e9e6327 100644 --- a/python/vmol/stdout.py +++ b/python/vmol/stdout.py @@ -7,9 +7,11 @@ import ctypes import ctypes.util + class FILE(ctypes.Structure): pass + FILE_p = ctypes.POINTER(FILE) libc = ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True) @@ -23,6 +25,7 @@ class FILE(ctypes.Structure): cstdout = FILE_p.in_dll(libc, 'stdout') + def capture(func, *args, **kwargs): sys.stdout.flush() From 1134951ca2c049d89bc8b28a46924b4239d5866c Mon Sep 17 00:00:00 2001 From: Ksenia Date: Mon, 2 Mar 2026 18:15:24 +0100 Subject: [PATCH 14/48] Add main script --- python/pyproject.toml | 3 +++ python/vmol/__main__.py | 12 ++++++++++++ python/vmol/main.py | 13 ++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 python/vmol/__main__.py diff --git a/python/pyproject.toml b/python/pyproject.toml index 4ece3ba..4d77871 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -31,6 +31,9 @@ dependencies = [ 'numpy >= 1.24', ] +[project.scripts] +vmol = "vmol.__main__:main" + [project.urls] Repository = "https://github.com/briling/v.git" "Bug Tracker" = "https://github.com/briling/v/issues" diff --git a/python/vmol/__main__.py b/python/vmol/__main__.py new file mode 100755 index 0000000..43c323c --- /dev/null +++ b/python/vmol/__main__.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import sys +import vmol + + +def main(): + vmol.main.run0(sys.argv) + + +if __name__ == "__main__": + main() diff --git a/python/vmol/main.py b/python/vmol/main.py index f3e7a50..a51d336 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -1,5 +1,4 @@ import ctypes -import numpy as np import vmol @@ -12,6 +11,16 @@ class in_str_t(ctypes.Structure): ] +def run0(argv): + lib = ctypes.cdll.LoadLibrary(vmol.SO) + main = lib.main + main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] + main.restype = ctypes.c_int + argc = len(argv) + argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) + return main(argc, argv) + + def run(args): lib = ctypes.cdll.LoadLibrary(vmol.SO) main = lib.main @@ -52,6 +61,8 @@ def run1(args): def run2(q, r, name=None, args=None): + import numpy as np + lib = ctypes.cdll.LoadLibrary(vmol.SO) main = lib.main_wrapper3 From 3563e500524ca2720ef62089e5e2bcaf31f5edb1 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Mon, 2 Mar 2026 21:34:43 +0100 Subject: [PATCH 15/48] Refactor python wrappers --- python/vmol/__main__.py | 3 +- python/vmol/main.py | 135 ++++++++++++++++++---------------------- src/api.c | 9 +-- 3 files changed, 62 insertions(+), 85 deletions(-) diff --git a/python/vmol/__main__.py b/python/vmol/__main__.py index 43c323c..d3b7656 100755 --- a/python/vmol/__main__.py +++ b/python/vmol/__main__.py @@ -1,11 +1,10 @@ #!/usr/bin/env python -import sys import vmol def main(): - vmol.main.run0(sys.argv) + vmol.main.run0() if __name__ == "__main__": diff --git a/python/vmol/main.py b/python/vmol/main.py index a51d336..5703408 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -1,105 +1,90 @@ +import sys import ctypes +from ctypes import c_int, c_double, c_char_p +import functools import vmol +c_double_p = ctypes.POINTER(c_double) +c_int_p = ctypes.POINTER(c_int) +ARGS_T = [c_int, ctypes.POINTER(ctypes.c_char_p)] + + class in_str_t(ctypes.Structure): _fields_ = [ - ("n", ctypes.c_int), - ("q", ctypes.POINTER(ctypes.c_int)), - ("r", ctypes.POINTER(ctypes.c_double)), - ("name", ctypes.c_char_p), + ("n", c_int), + ("q", c_int_p), + ("r", c_double_p), + ("name", c_char_p), ] -def run0(argv): - lib = ctypes.cdll.LoadLibrary(vmol.SO) - main = lib.main - main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] - main.restype = ctypes.c_int - argc = len(argv) - argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) - return main(argc, argv) +def convert_in_mol(q, r, name): + import numpy as np + if not isinstance(name, bytes): + name = str(name).encode('utf-8') + r = np.ascontiguousarray(r, dtype=c_double) + q = np.ascontiguousarray(q, dtype=c_int) + n = len(q) + if q.ndim != 1: + raise ValueError("q must be a 1D array") + if r.shape != (n, 3): + raise ValueError(f"r must be a 2D array with shape ({n}, 3)") + return in_str_t(n=n, + q=q.ctypes.data_as(c_int_p), + r=r.flatten().ctypes.data_as(c_double_p), + name=name) -def run(args): - lib = ctypes.cdll.LoadLibrary(vmol.SO) - main = lib.main +def convert_in(func): + @functools.wraps(func) + def myinner(argv, /, *args, **kwargs): + argc = len(argv) + argv = (c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) + return func(argc, argv, *args, **kwargs) + return myinner - main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] - main.restype = ctypes.c_int - argv = [vmol.SO, *args] - argc = len(argv) - argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) +def convert_out(func): + @functools.wraps(func) + def myinner(*args, **kwargs): + out = func(*args, **kwargs) + return out.decode('utf-8').rstrip('\n') if out else None + return myinner - ret, output = vmol.stdout.capture(main, argc, argv) - return ret, output +def declare(fn, argtypes, restype): + fn.argtypes = argtypes + fn.restype = restype + return fn -def run1(args): +def run0(): lib = ctypes.cdll.LoadLibrary(vmol.SO) - main = lib.main_wrapper2 + main = convert_in(declare(lib.main, argtypes=ARGS_T, restype=c_int)) + return main(sys.argv) - main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] - main.restype = ctypes.c_char_p - argv = [vmol.SO, *args] - argc = len(argv) - argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) +def run(args): + lib = ctypes.cdll.LoadLibrary(vmol.SO) + main = convert_in(declare(lib.main, argtypes=ARGS_T, restype=c_int)) + ret, output = vmol.stdout.capture(main, [vmol.SO, *args]) + return ret, output - ret = main(argc, argv) - ret = ret.decode('utf-8') if ret else '' - free = lib.free_out_str - free.argtypes = None - free.restype = None +def run1(args): + lib = ctypes.cdll.LoadLibrary(vmol.SO) + main = convert_out(convert_in(declare(lib.main_wrapper2, argtypes=ARGS_T, restype=c_char_p))) + free = declare(lib.free_out_str, argtypes=None, restype=None) + ret = main([vmol.SO, *args]) free() - return ret def run2(q, r, name=None, args=None): - - import numpy as np - lib = ctypes.cdll.LoadLibrary(vmol.SO) - main = lib.main_wrapper3 - - main.argtypes = [in_str_t, ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)] - main.restype = ctypes.c_char_p - - if args is None: - args = [] - - if not isinstance(name, bytes): - name = str(name).encode('utf-8') - r = np.ascontiguousarray(r, dtype=ctypes.c_double) - q = np.ascontiguousarray(q, dtype=ctypes.c_int) - n = len(q) - - if q.ndim != 1: - raise ValueError("q must be a 1D array") - if r.shape != (n, 3): - raise ValueError(f"r must be a 2D array with shape ({n}, 3)") - - in_str = in_str_t( - n=n, - q=q.ctypes.data_as(ctypes.POINTER(ctypes.c_int)), - r=r.flatten().ctypes.data_as(ctypes.POINTER(ctypes.c_double)), - name=name, - ) - - argv = [vmol.SO, *args] - argc = len(argv) - argv = (ctypes.c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) - - ret = main(in_str, argc, argv) - ret = ret.decode('utf-8') if ret else '' - - free = lib.free_out_str - free.argtypes = None - free.restype = None + main = convert_out(convert_in(declare(lib.main_wrapper3, argtypes=[*ARGS_T, in_str_t], restype=c_char_p))) + free = declare(lib.free_out_str, argtypes=None, restype=None) + ret = main([vmol.SO, *args], convert_in_mol(q, r, name)) free() - return ret diff --git a/src/api.c b/src/api.c index 11d41e3..1abb183 100644 --- a/src/api.c +++ b/src/api.c @@ -7,20 +7,13 @@ char * out_str; in_str_t in_str; -int main_wrapper1 (int argc, char * argv[]) { - out_str = calloc(PRINTBUFLEN, 1); - int ret = main(argc, argv); - FREE0(out_str); - return ret; -} - char * main_wrapper2 (int argc, char * argv[]) { out_str = calloc(PRINTBUFLEN, 1); main(argc, argv); return out_str; } -char * main_wrapper3 (in_str_t in_str_, int argc, char * argv[]) { +char * main_wrapper3 (int argc, char * argv[], in_str_t in_str_) { in_str = in_str_; out_str = calloc(PRINTBUFLEN, 1); main(argc, argv); From aee7080c36fac9dcfaaa3be2d05f51de705cc6d6 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Mon, 2 Mar 2026 21:50:46 +0100 Subject: [PATCH 16/48] fixup 936cd8d --- src/mol/common.h | 2 +- src/v/load.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mol/common.h b/src/mol/common.h index e7c81d1..8436896 100644 --- a/src/mol/common.h +++ b/src/mol/common.h @@ -14,7 +14,7 @@ __FILE__, __LINE__, __FUNCTION__); \ abort(); } -#define printalive printf("alive @ %s:%d\n", __FILE__, __LINE__); +#define printalive {printf("alive @ %s:%d\n", __FILE__, __LINE__); fflush(stdout);} #define PRINT_ERR(...) {\ fprintf(stderr, "\e[1;31m" "error: " "\e[0m" "\e[1;30m" "[%s:%d]" "\e[0m ", __FILE__, __LINE__);\ diff --git a/src/v/load.c b/src/v/load.c index cb81914..a1331a5 100644 --- a/src/v/load.c +++ b/src/v/load.c @@ -180,6 +180,7 @@ atcoords * get_in_str(in_str_t in_str, drawpars * dp){ dp->scale = acs_scale(acs); newmol_prep(acs, dp); intcoord_check(INT_MAX, dp->z); + free(xyz); return acs; } From bdc05bff3ad946267f9f41d168f03e2f0cf9efea Mon Sep 17 00:00:00 2001 From: Ksenia Date: Tue, 3 Mar 2026 08:06:47 +0100 Subject: [PATCH 17/48] Simplify API --- python/examples/ex1.py | 15 ++++++---- python/examples/ex2.py | 27 +++++++++++++++--- python/examples/ex3.bash | 4 --- python/examples/ex4.py | 22 --------------- python/vmol/__init__.py | 4 +-- python/vmol/__main__.py | 3 +- python/vmol/main.py | 59 ++++++++++++++++++++-------------------- python/vmol/stdout.py | 54 ------------------------------------ src/api.c | 9 +++--- src/v.c | 4 +-- src/v/man.c | 4 +-- src/v/v.h | 2 +- 12 files changed, 77 insertions(+), 130 deletions(-) delete mode 100755 python/examples/ex3.bash delete mode 100755 python/examples/ex4.py delete mode 100644 python/vmol/stdout.py diff --git a/python/examples/ex1.py b/python/examples/ex1.py index 4f5dcc6..429a00c 100755 --- a/python/examples/ex1.py +++ b/python/examples/ex1.py @@ -1,12 +1,17 @@ #!/usr/bin/env python3 -import os +from os.path import dirname, normpath import vmol -# vmol.SO = 'v.cpython-313-x86_64-linux-gnu.so' # set if want to specify the .so path -mols = f'{os.path.dirname(__file__)}/../../mol/' -args = [f'{mols}/MOL_3525.xyz'] -r, o = vmol.main.run(args) +mol_dir = normpath(f'{dirname(__file__)}/../../mol/') +args = [ + f'{mol_dir}/MOL_3525.xyz', + 'cell:8.929542,0.0,0.0,4.197206,8.892922,0.0,0.480945,2.324788,10.016044', + ] + +# vmol.so = 'v.cpython-313-x86_64-linux-gnu.so' # set if want to specify the .so path + +r, o = vmol.main.capture(args=args, return_code=True) print("Return value:", r) print("Captured output:") diff --git a/python/examples/ex2.py b/python/examples/ex2.py index 0a46d12..28ec687 100755 --- a/python/examples/ex2.py +++ b/python/examples/ex2.py @@ -1,8 +1,27 @@ #!/usr/bin/env python3 -import sys import vmol -args = sys.argv[1:] -_, o = vmol.main.run(args) -print(o) +# mol/mol0001.xyz +name = 'acetylene' +q = [6, 6, 1, 1] +r = [ + [0.99495, 0.00000, 0.00000], + [2.19521, 0.00000, 0.00000], + [-0.07071, 0.00000, 0.00000], + [3.26087, 0.00000, 0.00000], + ] + +input('press enter to view a molecule...') +# rotation matrix +rot = 'rot:0.587785,0.000000,0.809017,0.670705,0.559193,-0.487296,-0.452397,0.829038,0.328685' +ret, xyz = vmol.main.capture(q=q, r=r, name=name, args=[rot], return_code=True) +print('return code:', ret) +print('captured output:') +print(xyz) +print() + +input('press enter to get its point group in headless mode...') +point_group = vmol.main.capture(q=q, r=r, name=name, args=['gui:0', 'com:.']) +print(f'{point_group=}') +print() diff --git a/python/examples/ex3.bash b/python/examples/ex3.bash deleted file mode 100755 index df64f5a..0000000 --- a/python/examples/ex3.bash +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -MOLS="$(dirname $(realpath "$0"))/../../mol" -echo '.' | python -c "import os; import vmol; print(vmol.main.run(['${MOLS}/neopentane.xyz', 'symtol:1e-2', 'gui:0'])[1], end='')" diff --git a/python/examples/ex4.py b/python/examples/ex4.py deleted file mode 100755 index 491069c..0000000 --- a/python/examples/ex4.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 - -import vmol - -# mol/mol0001.xyz -name = 'acetylene' -q = [6, 6, 1, 1] -r = [ - [0.99495, 0.00000, 0.00000], - [2.19521, 0.00000, 0.00000], - [-0.07071, 0.00000, 0.00000], - [3.26087, 0.00000, 0.00000], - ] - -point_group = vmol.main.run2(q, r, name=name, args=['gui:0', 'com:.']) -print(point_group) - -# rotation matrix -rot = 'rot:0.587785,0.000000,0.809017,0.670705,0.559193,-0.487296,-0.452397,0.829038,0.328685' -xyz = vmol.main.run2(q, r, name=name, args=[rot]) -print('captured output:') -print(xyz) diff --git a/python/vmol/__init__.py b/python/vmol/__init__.py index aa1a54a..a3b8b4b 100644 --- a/python/vmol/__init__.py +++ b/python/vmol/__init__.py @@ -1,6 +1,6 @@ import os from sysconfig import get_path, get_config_var -from vmol import stdout, main +from vmol import main _v = 'v' _suffix = get_config_var('EXT_SUFFIX') @@ -15,7 +15,7 @@ _exists = [os.path.isfile(p) for p in _paths] -SO = _paths[_exists.index(True)] if sum(_exists) else None +so = _paths[_exists.index(True)] if sum(_exists) else None del _v, _suffix del get_config_var, get_path, os diff --git a/python/vmol/__main__.py b/python/vmol/__main__.py index d3b7656..9185e74 100755 --- a/python/vmol/__main__.py +++ b/python/vmol/__main__.py @@ -1,10 +1,11 @@ #!/usr/bin/env python +import sys import vmol def main(): - vmol.main.run0() + vmol.main.run(sys.argv) if __name__ == "__main__": diff --git a/python/vmol/main.py b/python/vmol/main.py index 5703408..580d1a2 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -20,7 +20,11 @@ class in_str_t(ctypes.Structure): def convert_in_mol(q, r, name): + import numpy as np + + if q is None or r is None: + raise ValueError("q and r must both be provided or both be None") if not isinstance(name, bytes): name = str(name).encode('utf-8') r = np.ascontiguousarray(r, dtype=c_double) @@ -30,7 +34,7 @@ def convert_in_mol(q, r, name): raise ValueError("q must be a 1D array") if r.shape != (n, 3): raise ValueError(f"r must be a 2D array with shape ({n}, 3)") - return in_str_t(n=n, + return in_str_t(n=c_int(n), q=q.ctypes.data_as(c_int_p), r=r.flatten().ctypes.data_as(c_double_p), name=name) @@ -38,18 +42,20 @@ def convert_in_mol(q, r, name): def convert_in(func): @functools.wraps(func) - def myinner(argv, /, *args, **kwargs): + def myinner(argv, *args, **kwargs): argc = len(argv) argv = (c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) - return func(argc, argv, *args, **kwargs) + return func(c_int(argc), argv, *args, **kwargs) return myinner def convert_out(func): @functools.wraps(func) - def myinner(*args, **kwargs): - out = func(*args, **kwargs) - return out.decode('utf-8').rstrip('\n') if out else None + def myinner(argv, *args, **kwargs): + ret = c_int(0) + out = func(argv, ctypes.byref(ret), *args, **kwargs) + out = out.decode('utf-8').rstrip('\n') if out else None + return ret.value, out return myinner @@ -59,32 +65,27 @@ def declare(fn, argtypes, restype): return fn -def run0(): - lib = ctypes.cdll.LoadLibrary(vmol.SO) - main = convert_in(declare(lib.main, argtypes=ARGS_T, restype=c_int)) - return main(sys.argv) - - -def run(args): - lib = ctypes.cdll.LoadLibrary(vmol.SO) +def run(argv): + lib = ctypes.cdll.LoadLibrary(vmol.so) main = convert_in(declare(lib.main, argtypes=ARGS_T, restype=c_int)) - ret, output = vmol.stdout.capture(main, [vmol.SO, *args]) - return ret, output + return main(argv) -def run1(args): - lib = ctypes.cdll.LoadLibrary(vmol.SO) - main = convert_out(convert_in(declare(lib.main_wrapper2, argtypes=ARGS_T, restype=c_char_p))) +def capture(*, q=None, r=None, name=None, args=None, return_code=False): + args = [vmol.so, *args] if args else [vmol.so] + lib = ctypes.cdll.LoadLibrary(vmol.so) free = declare(lib.free_out_str, argtypes=None, restype=None) - ret = main([vmol.SO, *args]) - free() - return ret - -def run2(q, r, name=None, args=None): - lib = ctypes.cdll.LoadLibrary(vmol.SO) - main = convert_out(convert_in(declare(lib.main_wrapper3, argtypes=[*ARGS_T, in_str_t], restype=c_char_p))) - free = declare(lib.free_out_str, argtypes=None, restype=None) - ret = main([vmol.SO, *args], convert_in_mol(q, r, name)) + if q or r: + main = lib.main_wrap_in_out + argtypes = [*ARGS_T, c_int_p, in_str_t] + arguments = (args, convert_in_mol(q, r, name)) + else: + main = lib.main_wrap_out + argtypes = [*ARGS_T, c_int_p] + arguments = (args,) + + main = convert_out(convert_in(declare(main, argtypes=argtypes, restype=c_char_p))) + ret, out = main(*arguments) free() - return ret + return (ret, out) if return_code else out diff --git a/python/vmol/stdout.py b/python/vmol/stdout.py deleted file mode 100644 index e9e6327..0000000 --- a/python/vmol/stdout.py +++ /dev/null @@ -1,54 +0,0 @@ -# taken from https://gist.github.com/denilsonsa/9c8f5c44bf2038fd000f - -import sys -import os -import tempfile -import io -import ctypes -import ctypes.util - - -class FILE(ctypes.Structure): - pass - - -FILE_p = ctypes.POINTER(FILE) - -libc = ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True) -cfflush = libc.fflush -cfflush.argtypes = (FILE_p,) -cfflush.restype = ctypes.c_int - -csetbuf = libc.setbuf -csetbuf.argtypes = (FILE_p, ctypes.c_char_p) -csetbuf.restype = None - -cstdout = FILE_p.in_dll(libc, 'stdout') - - -def capture(func, *args, **kwargs): - - sys.stdout.flush() - cfflush(cstdout) - - with tempfile.TemporaryFile(buffering=0) as temp: - - fd = sys.stdout.fileno() - prev_sys_stdout = sys.stdout - prev_stdout_fd = os.dup(fd) - os.close(fd) - os.dup2(temp.fileno(), fd) - - temp_wrapper = io.TextIOWrapper(temp, encoding='utf8', line_buffering=True, write_through=True) - sys.stdout = temp_wrapper - csetbuf(cstdout, None) - - ret = func(*args, **kwargs) - - cfflush(cstdout) - os.dup2(prev_stdout_fd, fd) - os.close(prev_stdout_fd) - sys.stdout = prev_sys_stdout - - temp_wrapper.seek(0) - return ret, temp_wrapper.read() diff --git a/src/api.c b/src/api.c index 1abb183..4a0ab1e 100644 --- a/src/api.c +++ b/src/api.c @@ -7,16 +7,17 @@ char * out_str; in_str_t in_str; -char * main_wrapper2 (int argc, char * argv[]) { +char * main_wrap_out(int argc, char * argv[], int * ret) { out_str = calloc(PRINTBUFLEN, 1); - main(argc, argv); + *ret = main(argc, argv); return out_str; } -char * main_wrapper3 (int argc, char * argv[], in_str_t in_str_) { +char * main_wrap_in_out(int argc, char * argv[], int * ret, in_str_t in_str_) { in_str = in_str_; out_str = calloc(PRINTBUFLEN, 1); - main(argc, argv); + *ret = main(argc, argv); + memset(&in_str, 0, sizeof(in_str)); return out_str; } diff --git a/src/v.c b/src/v.c index b0f7c7b..f946a78 100644 --- a/src/v.c +++ b/src/v.c @@ -71,8 +71,8 @@ static void version(FILE * f){ int main (int argc, char * argv[]) { if(SHOULD_PRINT_MAN(argc)){ - printman(argv[0]); - version(stdout); + printman(stderr, argv[0]); + version(stderr); return 0; } diff --git a/src/v/man.c b/src/v/man.c index c7a2e24..b255e9b 100644 --- a/src/v/man.c +++ b/src/v/man.c @@ -1,7 +1,7 @@ #include "v.h" -void printman(char * exename){ -fprintf(stderr, "\ +void printman(FILE * f, char * exename){ + PRINTOUT(f, "\ \n\ USAGE:\n\ \n\ diff --git a/src/v/v.h b/src/v/v.h index 83e456b..a8ea5b3 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -131,7 +131,7 @@ txyz * ac3_read_out(int * n_p, FILE * f); txyz * ac3_read_xyz(int * n_p, FILE * f); // man.c -void printman(char * exename); +void printman(FILE * f, char * exename); // cli.c drawpars cli_parse(int argc, char ** argv); From 649aff2c3b1b6425ca6f550785bf8fcb02b95b71 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Tue, 3 Mar 2026 11:33:32 +0100 Subject: [PATCH 18/48] Add checks and docs --- python/examples/ex2.py | 4 +- python/vmol/main.py | 189 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 175 insertions(+), 18 deletions(-) diff --git a/python/examples/ex2.py b/python/examples/ex2.py index 28ec687..adc7092 100755 --- a/python/examples/ex2.py +++ b/python/examples/ex2.py @@ -15,13 +15,13 @@ input('press enter to view a molecule...') # rotation matrix rot = 'rot:0.587785,0.000000,0.809017,0.670705,0.559193,-0.487296,-0.452397,0.829038,0.328685' -ret, xyz = vmol.main.capture(q=q, r=r, name=name, args=[rot], return_code=True) +ret, xyz = vmol.main.capture(mol={'q': q, 'r': r, 'name': name}, args=[rot], return_code=True) print('return code:', ret) print('captured output:') print(xyz) print() input('press enter to get its point group in headless mode...') -point_group = vmol.main.capture(q=q, r=r, name=name, args=['gui:0', 'com:.']) +point_group = vmol.main.capture(mol={'q': q, 'r': r}, args=['gui:0', 'com:.']) print(f'{point_group=}') print() diff --git a/python/vmol/main.py b/python/vmol/main.py index 580d1a2..cd9942e 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -1,4 +1,5 @@ -import sys +"""Run the viewer with specified command-line arguments and/or molecule data and capture the output.""" + import ctypes from ctypes import c_int, c_double, c_char_p import functools @@ -11,6 +12,7 @@ class in_str_t(ctypes.Structure): + """C structure for the input molecule data, containing the number of atoms, charge array, coordinate array, and name.""" _fields_ = [ ("n", c_int), ("q", c_int_p), @@ -19,67 +21,222 @@ class in_str_t(ctypes.Structure): ] -def convert_in_mol(q, r, name): +def convert_in_mol(mol): + """Convert a molecule represented as a dictionary to the expected C structure for input. + + The input molecule should be a dictionary with the following keys + - 'q': a 1D array-like of integers representing the charges of the atoms + - 'r': a 2D array-like of floats with shape (n, 3) representing the coordinates of the atoms + - 'name' (optional): a string representing the name of the molecule + The function converts the 'q' and 'r' arrays to contiguous C arrays of the appropriate types, + and the 'name' to a C string, and returns an instance of `in_str_t` with the corresponding fields set. + Args: + mol (dict): A dictionary representing the molecule, with keys 'q', 'r', and optionally 'name'. + + Returns: + in_str_t: An instance of `in_str_t` with the fields set according to the input molecule. + """ import numpy as np + if not isinstance(mol, dict): + msg = f"mol must be a dictionary, but got {type(mol)}" + raise ValueError(msg) + q = mol.get('q') + r = mol.get('r') + name = mol.get('name') if q is None or r is None: - raise ValueError("q and r must both be provided or both be None") + msg = "mol must contain 'q' and 'r' for charge and coordinate arrays, respectively" + raise ValueError(msg) + if not isinstance(name, bytes): name = str(name).encode('utf-8') r = np.ascontiguousarray(r, dtype=c_double) q = np.ascontiguousarray(q, dtype=c_int) n = len(q) if q.ndim != 1: - raise ValueError("q must be a 1D array") + msg = f"q must be a 1D array, but has shape {q.shape}" + raise ValueError(msg) if r.shape != (n, 3): - raise ValueError(f"r must be a 2D array with shape ({n}, 3)") + msg = f"r must be a 2D array with shape ({n}, 3), but has shape {r.shape}" + raise ValueError(msg) return in_str_t(n=c_int(n), q=q.ctypes.data_as(c_int_p), r=r.flatten().ctypes.data_as(c_double_p), name=name) +def _check_attrs(name, x, attrs): + for attr in attrs: + if not hasattr(x, attr): + msg = f"{name} must have {attr} defined" + raise ValueError(msg) + + def convert_in(func): + """Decorate a function to convert a list of Python strings to the expected C types. + + The function is expected to take an integer and a pointer to an array of C strings as its first two arguments, + which represent the argument count and argument values, respectively, i.e., + ``` + void func(int argc, char ** argv, ...) + ``` + The decorator will convert a list of Python strings passed as the first argument + to the wrapped function into the appropriate C types before calling the original function, i.e., + ``` + def wrapped_func(argv: list[str], ...) + ``` + The function has to have the `argtypes` and `restype` attributes defined and match the above signature. + + Args: + func (callable): The function to wrap, which should take an integer and a pointer to an array of C strings + as its first two arguments. + + Returns: + callable: A wrapped function that takes a list of Python strings as its first argument and converts + it to the expected C types before calling the original function. + """ + _check_attrs("function", func, ['restype', 'argtypes']) + + if func.argtypes is None or len(func.argtypes) < 2 or func.argtypes[:2] != ARGS_T: + msg = f"function must have a signature that starts with {ARGS_T} for the first arguments to convert the input list of strings" + raise ValueError(msg) + @functools.wraps(func) - def myinner(argv, *args, **kwargs): + def myinner(argv, *args): argc = len(argv) argv = (c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) - return func(c_int(argc), argv, *args, **kwargs) + return func(c_int(argc), argv, *args) + myinner = declare(myinner, argtypes=[list, *func.argtypes[2:]], restype=func.restype) return myinner def convert_out(func): + """Decorate a function to convert its output to a Python string and return it along with the return code. + + The function is expected to return a pointer to a null-terminated C string, which will be decoded as UTF-8 + and stripped of trailing newlines. + It is also expected to take a pointer to an integer as the third or second argument, where it will write the return code. + + We assume that in the former case the function is a _FuncPtr loaded from the shared library + and has a signature + ``` + char * func(int argc, char ** argv, int * ret_code, ...) + ``` + and in the latter case it is already decorated with `convert_in()` and has a 'signature' + ``` + char * func(argv: list[str], int * ret_code, ...) + ``` + The function has to have the `argtypes` and `restype` attributes defined and match one of the above signatures. + + In the future, we could also support the case where the return code argument index is passed + as an argument to the decorator. + + Args: + func (callable): The function to wrap, which has the `argtypes` attribute defined + and should return a pointer to a null-terminated string + and take a pointer to an integer for the return code. + + Returns: + callable: A wrapped function that returns a tuple of (return code (int), output (str)) + and takes the same arguments as the original function, + except that the argument for the return code is handled internally. + """ + _check_attrs("function", func, ['restype', 'argtypes']) + + argtypes2 = [list, c_int_p] + argtypes3 = [*ARGS_T, c_int_p] + for argtypes in (argtypes3, argtypes2): + if func.argtypes is None or len(func.argtypes) < len(argtypes): + continue + if func.argtypes[:len(argtypes)] == argtypes: + n = len(argtypes)-1 + break + else: + msg = f"function has to have a signature that matches\n{12*' '}either {argtypes3}\n{12*' '}or {argtypes2}\n{12*' '}for the first arguments to retrieve the return code via pointer" + raise ValueError(msg) + + if func.restype != c_char_p: + msg = f"function must return a pointer to a C string (restype={c_char_p})" + raise ValueError(msg) + @functools.wraps(func) - def myinner(argv, *args, **kwargs): + def myinner(*args): ret = c_int(0) - out = func(argv, ctypes.byref(ret), *args, **kwargs) + out = func(*(args[:n]), ctypes.byref(ret), *(args[n:])) out = out.decode('utf-8').rstrip('\n') if out else None return ret.value, out + + myinner = declare(myinner, argtypes=func.argtypes[:n]+func.argtypes[n+1:], restype=[int, str]) return myinner -def declare(fn, argtypes, restype): - fn.argtypes = argtypes - fn.restype = restype - return fn +def declare(func, argtypes, restype): + """Declare a function from the shared library with the given argument and return types. + + Args: + func (callable): The function to declare, typically obtained from the shared library. + argtypes (list of ctypes types): The argument types of the function. + restype (ctypes type): The return type of the function. + + Returns: + callable: The function with the specified argument and return types. + """ + func.argtypes = argtypes + func.restype = restype + return func def run(argv): + """Run the viewer with the given command-line arguments. + + Args: + argv (list of str): The command-line arguments to pass to the main function. + Unlike `capture()`, the first argument is a string that represents the program name, + such as `sys.argv[0]` or the name of the shared library (`vmol.so`), + + Returns: + int: The return code from the main function. + """ lib = ctypes.cdll.LoadLibrary(vmol.so) main = convert_in(declare(lib.main, argtypes=ARGS_T, restype=c_int)) return main(argv) -def capture(*, q=None, r=None, name=None, args=None, return_code=False): +def capture(*, mol=None, args=None, return_code=False): + """Run the viewer with the given structure and/or command-line arguments and capture the output. + + If `args` is provided, it will be passed as command-line arguments to the main function. + It can contain any arguments that the main function accepts, except for the program name, + includiing the paths to the molecule files to read. + + If `mol` is provided, it will be converted to the appropriate input structure and passed to the main function, + and the paths to the molecule files in `args` will be ignored. + The `mol` dictionary must contain 'q' and 'r' keys for the charge and coordinate arrays, respectively, + and can optionally contain a 'name' key for the molecule name. + + Args: + mol (dict, optional): A dictionary representing the molecule. + Must contain 'q' (int 1D array-like) and 'r' (float 2D array-like of shape (n, 3) + for charge and coordinate arrays, respectively. + Optionally can contain a 'name' (str-like) for the molecule name. + args (list of str, optional): Command-line arguments to pass to the main function (without the program name). + return_code (bool, optional): Whether to return the return code along with the output. Defaults to False. + + Returns: + If `return_code` is False: + str: The output from the main function, decoded as UTF-8 and stripped of trailing newlines. + If `return_code` is True: + tuple of (int, str): the function return code and the output string. + """ args = [vmol.so, *args] if args else [vmol.so] lib = ctypes.cdll.LoadLibrary(vmol.so) free = declare(lib.free_out_str, argtypes=None, restype=None) - if q or r: + if mol: main = lib.main_wrap_in_out argtypes = [*ARGS_T, c_int_p, in_str_t] - arguments = (args, convert_in_mol(q, r, name)) + arguments = (args, convert_in_mol(mol)) else: main = lib.main_wrap_out argtypes = [*ARGS_T, c_int_p] From 7f009df13dd9b8b5df929a2c0e677e51bc465d9d Mon Sep 17 00:00:00 2001 From: Ksenia Date: Tue, 3 Mar 2026 22:42:31 +0100 Subject: [PATCH 19/48] Simplify wrappers --- python/ruff.toml | 14 ++++- python/vmol/main.py | 143 ++++++++++++++++++-------------------------- 2 files changed, 71 insertions(+), 86 deletions(-) diff --git a/python/ruff.toml b/python/ruff.toml index 624b1c7..78e8195 100644 --- a/python/ruff.toml +++ b/python/ruff.toml @@ -16,18 +16,30 @@ line-ending = "auto" select = [ "A", "E", "F", "B", "S", "COM", "C4", "EXE", "ICN", "PIE", "PLR1714", "ARG", - "PERF", "FURB", "PLE", "TRY002", "W", "UP", "RUF", "SIM", "NPY", + "PERF", "FURB", "PLE", "TRY", "W", "UP", "RUF", "SIM", "NPY", + "EM", "RET", "PLR", "FIX", "TD", + "D", ] ignore = [ "E501", # line length + "D203", # incorrect-blank-line-before-class + "D213", # multi-line-summary-second-line ] preview = true +extend-select = ["DOC"] + extend-ignore = [ # whitespaces "E201", "E202", "E203", "E211", "E221", "E222", "E225", "E226", "E228", "E231", "E241", "E271", "E272", + # doc whitespaces + "D413", "D204", ] + +[lint.per-file-ignores] +"vmol/__main__.py" = ["D"] +"examples/ex?.py" = ["D"] diff --git a/python/vmol/main.py b/python/vmol/main.py index cd9942e..ef5ae7d 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -8,7 +8,7 @@ c_double_p = ctypes.POINTER(c_double) c_int_p = ctypes.POINTER(c_int) -ARGS_T = [c_int, ctypes.POINTER(ctypes.c_char_p)] +ARGS_T = (c_int, ctypes.POINTER(ctypes.c_char_p)) class in_str_t(ctypes.Structure): @@ -36,12 +36,16 @@ def convert_in_mol(mol): Returns: in_str_t: An instance of `in_str_t` with the fields set according to the input molecule. + + Raises: + TypeError: If mol is not a dictionary. + ValueError: If the required keys are missing or their values have wrong shapes. """ import numpy as np if not isinstance(mol, dict): msg = f"mol must be a dictionary, but got {type(mol)}" - raise ValueError(msg) + raise TypeError(msg) q = mol.get('q') r = mol.get('r') name = mol.get('name') @@ -66,15 +70,8 @@ def convert_in_mol(mol): name=name) -def _check_attrs(name, x, attrs): - for attr in attrs: - if not hasattr(x, attr): - msg = f"{name} must have {attr} defined" - raise ValueError(msg) - - def convert_in(func): - """Decorate a function to convert a list of Python strings to the expected C types. + """Decorate a function to convert Python arguments to the expected C types. The function is expected to take an integer and a pointer to an array of C strings as its first two arguments, which represent the argument count and argument values, respectively, i.e., @@ -86,104 +83,75 @@ def convert_in(func): ``` def wrapped_func(argv: list[str], ...) ``` - The function has to have the `argtypes` and `restype` attributes defined and match the above signature. + + If `func.ret_code_ptr_idx` is defined and equals to N>=2, the decorator also passes a pointer to an integer + as the Nth argument: + ``` + void func(int argc, char ** argv, ..., int * ret, ...) -> def wrapped_func(argv: list[str], ..., ...) + ^0th ^Nth + ``` + The `func.errcheck` function is supposed to take care of the return value. Args: - func (callable): The function to wrap, which should take an integer and a pointer to an array of C strings - as its first two arguments. + func (callable): The function to wrap. Returns: - callable: A wrapped function that takes a list of Python strings as its first argument and converts - it to the expected C types before calling the original function. + callable: A wrapped function. + + Raises: + TypeError: If func is not a ctypes function. + ValueError: If its attributes are wrong. """ - _check_attrs("function", func, ['restype', 'argtypes']) + if not isinstance(func, ctypes._CFuncPtr): + msg = "function should be a ctypes function" + raise TypeError(msg) - if func.argtypes is None or len(func.argtypes) < 2 or func.argtypes[:2] != ARGS_T: + if func.argtypes is None or len(func.argtypes) < len(ARGS_T) or any(x!=y for x, y in zip(func.argtypes, ARGS_T, strict=False)): msg = f"function must have a signature that starts with {ARGS_T} for the first arguments to convert the input list of strings" raise ValueError(msg) + if not hasattr(func, 'ret_code_ptr_idx'): + func.ret_code_ptr_idx = None + if func.ret_code_ptr_idx is not None: + if func.ret_code_ptr_idx < len(ARGS_T): + msg = f"return code argument index must be at least 2, but got {func.ret_code_ptr_idx}" + raise ValueError(msg) + if func.argtypes[func.ret_code_ptr_idx] != c_int_p: + msg = f"return code argument must be a pointer to an integer ({c_int_p}), but got {func.argtypes[func.ret_code_ptr_idx]}" + raise ValueError(msg) + @functools.wraps(func) def myinner(argv, *args): argc = len(argv) argv = (c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) - return func(c_int(argc), argv, *args) - myinner = declare(myinner, argtypes=[list, *func.argtypes[2:]], restype=func.restype) + arguments = [c_int(argc), argv, *args] + if func.ret_code_ptr_idx is not None: + ret = c_int(0) + arguments.insert(func.ret_code_ptr_idx, ctypes.byref(ret)) + return func(*arguments) return myinner -def convert_out(func): - """Decorate a function to convert its output to a Python string and return it along with the return code. - - The function is expected to return a pointer to a null-terminated C string, which will be decoded as UTF-8 - and stripped of trailing newlines. - It is also expected to take a pointer to an integer as the third or second argument, where it will write the return code. - - We assume that in the former case the function is a _FuncPtr loaded from the shared library - and has a signature - ``` - char * func(int argc, char ** argv, int * ret_code, ...) - ``` - and in the latter case it is already decorated with `convert_in()` and has a 'signature' - ``` - char * func(argv: list[str], int * ret_code, ...) - ``` - The function has to have the `argtypes` and `restype` attributes defined and match one of the above signatures. - - In the future, we could also support the case where the return code argument index is passed - as an argument to the decorator. - - Args: - func (callable): The function to wrap, which has the `argtypes` attribute defined - and should return a pointer to a null-terminated string - and take a pointer to an integer for the return code. - - Returns: - callable: A wrapped function that returns a tuple of (return code (int), output (str)) - and takes the same arguments as the original function, - except that the argument for the return code is handled internally. - """ - _check_attrs("function", func, ['restype', 'argtypes']) - - argtypes2 = [list, c_int_p] - argtypes3 = [*ARGS_T, c_int_p] - for argtypes in (argtypes3, argtypes2): - if func.argtypes is None or len(func.argtypes) < len(argtypes): - continue - if func.argtypes[:len(argtypes)] == argtypes: - n = len(argtypes)-1 - break - else: - msg = f"function has to have a signature that matches\n{12*' '}either {argtypes3}\n{12*' '}or {argtypes2}\n{12*' '}for the first arguments to retrieve the return code via pointer" - raise ValueError(msg) - - if func.restype != c_char_p: - msg = f"function must return a pointer to a C string (restype={c_char_p})" - raise ValueError(msg) - - @functools.wraps(func) - def myinner(*args): - ret = c_int(0) - out = func(*(args[:n]), ctypes.byref(ret), *(args[n:])) - out = out.decode('utf-8').rstrip('\n') if out else None - return ret.value, out - - myinner = declare(myinner, argtypes=func.argtypes[:n]+func.argtypes[n+1:], restype=[int, str]) - return myinner - - -def declare(func, argtypes, restype): +def declare(func, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): """Declare a function from the shared library with the given argument and return types. Args: func (callable): The function to declare, typically obtained from the shared library. argtypes (list of ctypes types): The argument types of the function. restype (ctypes type): The return type of the function. + errcheck (callable, optional): A function that takes the result, the function, and the arguments, + and returns the processed result. + ret_code_ptr_idx (int, optional): Position of the `int *` argument to store the return value in. Returns: - callable: The function with the specified argument and return types. + callable: The function with the specified arguments and return types. """ func.argtypes = argtypes func.restype = restype + if errcheck: + func.errcheck = errcheck + if ret_code_ptr_idx is not None: + func.ret_code_ptr_idx = ret_code_ptr_idx return func @@ -236,13 +204,18 @@ def capture(*, mol=None, args=None, return_code=False): if mol: main = lib.main_wrap_in_out argtypes = [*ARGS_T, c_int_p, in_str_t] - arguments = (args, convert_in_mol(mol)) + arguments = [args, convert_in_mol(mol)] else: main = lib.main_wrap_out argtypes = [*ARGS_T, c_int_p] - arguments = (args,) + arguments = [args] + + def errcheck(result, func, args): + ret = args[func.ret_code_ptr_idx]._obj.value + out = result.decode('utf-8').rstrip('\n') if result else None + free() + return ret, out - main = convert_out(convert_in(declare(main, argtypes=argtypes, restype=c_char_p))) + main = convert_in(declare(main, argtypes=argtypes, restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2)) ret, out = main(*arguments) - free() return (ret, out) if return_code else out From 404674e25eae2b33a7a35b7b08bb175025c0d6e9 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Wed, 4 Mar 2026 02:22:20 +0100 Subject: [PATCH 20/48] Improve imports --- python/examples/ex1.py | 4 +--- python/examples/ex2.py | 4 ++-- python/vmol/__init__.py | 3 ++- python/vmol/__main__.py | 2 +- python/vmol/main.py | 1 + 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/examples/ex1.py b/python/examples/ex1.py index 429a00c..71ffcc6 100755 --- a/python/examples/ex1.py +++ b/python/examples/ex1.py @@ -9,9 +9,7 @@ 'cell:8.929542,0.0,0.0,4.197206,8.892922,0.0,0.480945,2.324788,10.016044', ] -# vmol.so = 'v.cpython-313-x86_64-linux-gnu.so' # set if want to specify the .so path - -r, o = vmol.main.capture(args=args, return_code=True) +r, o = vmol.capture(args=args, return_code=True) print("Return value:", r) print("Captured output:") diff --git a/python/examples/ex2.py b/python/examples/ex2.py index adc7092..0643e74 100755 --- a/python/examples/ex2.py +++ b/python/examples/ex2.py @@ -15,13 +15,13 @@ input('press enter to view a molecule...') # rotation matrix rot = 'rot:0.587785,0.000000,0.809017,0.670705,0.559193,-0.487296,-0.452397,0.829038,0.328685' -ret, xyz = vmol.main.capture(mol={'q': q, 'r': r, 'name': name}, args=[rot], return_code=True) +ret, xyz = vmol.capture(mol={'q': q, 'r': r, 'name': name}, args=[rot], return_code=True) print('return code:', ret) print('captured output:') print(xyz) print() input('press enter to get its point group in headless mode...') -point_group = vmol.main.capture(mol={'q': q, 'r': r}, args=['gui:0', 'com:.']) +point_group = vmol.capture(mol={'q': q, 'r': r}, args=['gui:0', 'com:.']) print(f'{point_group=}') print() diff --git a/python/vmol/__init__.py b/python/vmol/__init__.py index a3b8b4b..7f187ac 100644 --- a/python/vmol/__init__.py +++ b/python/vmol/__init__.py @@ -1,6 +1,6 @@ import os from sysconfig import get_path, get_config_var -from vmol import main +from vmol.main import * _v = 'v' _suffix = get_config_var('EXT_SUFFIX') @@ -17,5 +17,6 @@ so = _paths[_exists.index(True)] if sum(_exists) else None +del main del _v, _suffix del get_config_var, get_path, os diff --git a/python/vmol/__main__.py b/python/vmol/__main__.py index 9185e74..df0740f 100755 --- a/python/vmol/__main__.py +++ b/python/vmol/__main__.py @@ -5,7 +5,7 @@ def main(): - vmol.main.run(sys.argv) + vmol.run(sys.argv) if __name__ == "__main__": diff --git a/python/vmol/main.py b/python/vmol/main.py index ef5ae7d..2e60574 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -5,6 +5,7 @@ import functools import vmol +__all__ = ["capture", "run"] c_double_p = ctypes.POINTER(c_double) c_int_p = ctypes.POINTER(c_int) From 53b53fb77452e8c593e58ee33412830553457251 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Wed, 4 Mar 2026 02:25:12 +0100 Subject: [PATCH 21/48] Readme --- README.md | 4 ++ python/README.md | 99 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 81 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 498bd04..e862eba 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ A simple X11 molecular viewer. - [`.xyz`](https://en.wikipedia.org/wiki/XYZ_file_format) files - [extended `.xyz`](https://github.com/libAtoms/extxyz) files (currently the extra columns are ignored) +## Python package (wrapper / API) available + +[see python package page](python/README.md) + ## Download [↑](#download) ``` wget https://github.com/briling/v/releases/download/v2.0/v.2.0 -O v diff --git a/python/README.md b/python/README.md index 0da3cb6..3b5f0d7 100644 --- a/python/README.md +++ b/python/README.md @@ -6,12 +6,17 @@ This package allows to Inspired by @aligfellow's [xyzrender](https://github.com/aligfellow/xyzrender). -## Installation +## Requirements + +* X11 +* numpy -### requirements +### For installation: * `libX11-devel libXpm-devel xproto-devel` (`libx11-dev libxpm-dev x11proto-dev` on Ubuntu) for C compilation * `setuptools` for Python +## Installation + ``` VV="3.0rc3" # v version PY="313" # python version for wheels, also available "311" and "312" @@ -61,40 +66,90 @@ wget https://github.com/briling/v/releases/download/v${VV}/v.so && chmod +x v.so # OR build in the repo root (see Option 3/download) make v.so ``` -The package searches for the `v.so` file in its parent directory +The package searches for the `v.so` file in its parent directory and standard paths. For example, ``` >>> import vmol ->>> vmol.SO +>>> vmol.so '/home/xe/soft/miniconda3/lib/python3.13/site-packages/vmol/v.cpython-313-x86_64-linux-gnu.so' ``` To subsitute the `.so`, put in in the same directory or change manually: ``` ->>> vmol.SO='./v.so' +>>> vmol.so='./v.so' ``` -## Usage example +## Usage -``` ->>> # import the library +```python >>> import vmol - ->>> # it provides the main function wrapper `main`, ->>> # path to the shared library `SO`, ->>> # and a stdout parsing module `stdout` +>>> # `vmol` provides the two wrapper functions `capture` and `run` +>>> # along with the path to the shared library `so`: >>> dir(vmol) -['SO', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', -'__package__', '__path__', '__spec__', '_exists', '_paths', 'main', 'stdout'] +['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', + '__package__', '__path__', '__spec__', '_exists', '_paths', 'capture', 'run', 'so'] +>>> vmol.so +/home/xe/Documents/git/v/python/vmol/v.cpython-313-x86_64-linux-gnu.so +>>> # one can use a custom .so file: +>>> vmol.so = '../v.so' +``` + +### 1. Simple wrapper ->>> # the arguments are the same as the CLI ones: ->>> args = ['v/mol/MOL_3525.xyz'] ->>> # they should be an array of strings: ->>> args = ['v/mol/MOL_3525.xyz', 'bonds:0'] +The package provides a script which can be used exactly as `v` (see [reference](../README.md)). +The following command are equivalent: +```bash +vmol ... +python -m vmol ... +vmol/__main__.py ... +``` +For example, +```bash +python -m vmol ../mol/MOL_3525.xyz cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10 +``` + +It can also be run from a script, i.e. +```python +import vmol +vmol.run(['my_exe_name', '../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10']) +``` +The arguments are the same as the CLI ones. They should be an array of strings, +and the 0th argument stays for the program name and is ignored. + +### 2. Capture the output +See [example 1](examples/ex1.py). + +```python +import vmol +out = vmol.capture(args=['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10']) +# look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc` +print(out) +``` +The arguments `args` are the same as the CLI ones and should be an array of strings. +In this case, the 0th argument is not ignored. + +The return code can be captured as well: +```python +ret, out = vmol.capture(args=['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10'], return_code=True) +``` + +Headless mode also works: +```python +>>> vmol.capture(args=['../mol/S8.qm.out', 'gui:0', 'com:.']) +'D8h' +>>> vmol.capture(args=['../mol/S8.qm.out', 'gui:0', 'com:.', 'frame:-1']) +'D4d' +``` ->>> # look at the molecule: ->>> r, o = vmol.main.run(args) +### 3. Pass a structure +See [example 2](examples/ex2.py). ->>> # check the output: ->>> print(o) +```python +import vmol +name = 'HF' +q = [1, 9] +r = [[0,0,0],[0.9,0,0]] +out = vmol.capture(mol={'q': q, 'r': r, 'name': name}, args=['shell:0.6,0.7']) +# look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc` +print(out) ``` From be7cd6052add36ebfaf290699fb450946952171a Mon Sep 17 00:00:00 2001 From: Ksenia Date: Wed, 4 Mar 2026 02:31:48 +0100 Subject: [PATCH 22/48] Force AT3COORDS task when gui:0 fix segfault --- src/v/cli.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/v/cli.c b/src/v/cli.c index d5460a4..e6d6897 100644 --- a/src/v/cli.c +++ b/src/v/cli.c @@ -180,5 +180,13 @@ drawpars cli_parse(int argc, char ** argv){ for(int i=1; i Date: Wed, 4 Mar 2026 02:41:01 +0100 Subject: [PATCH 23/48] Fix segfault when AT3COORDS is forced and no files readable --- src/v/load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v/load.c b/src/v/load.c index a1331a5..73f6fbf 100644 --- a/src/v/load.c +++ b/src/v/load.c @@ -122,7 +122,7 @@ void * read_files(drawpars * dp){ } // if the first file does not contain normal modes, try to read other files - if(dp->task == AT3COORDS){ + if(ent && (dp->task == AT3COORDS)){ atcoords * acs = ent; int n0 = fill_nf(acs, 0); for(i++; i Date: Wed, 4 Mar 2026 13:30:44 +0100 Subject: [PATCH 24/48] Convert element symbols --- python/README.md | 4 ++-- python/vmol/main.py | 30 +++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/python/README.md b/python/README.md index 3b5f0d7..ee85716 100644 --- a/python/README.md +++ b/python/README.md @@ -146,8 +146,8 @@ See [example 2](examples/ex2.py). ```python import vmol -name = 'HF' -q = [1, 9] +name = 'HF molecule' +q = [1, 'F'] r = [[0,0,0],[0.9,0,0]] out = vmol.capture(mol={'q': q, 'r': r, 'name': name}, args=['shell:0.6,0.7']) # look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc` diff --git a/python/vmol/main.py b/python/vmol/main.py index 2e60574..0fb43d1 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -26,8 +26,8 @@ def convert_in_mol(mol): """Convert a molecule represented as a dictionary to the expected C structure for input. The input molecule should be a dictionary with the following keys - - 'q': a 1D array-like of integers representing the charges of the atoms - - 'r': a 2D array-like of floats with shape (n, 3) representing the coordinates of the atoms + - 'q': a 1D array-like of integers or strings representing the atomic numbers or element symbols + - 'r': a 2D array-like of floats with shape (n, 3) representing the atomic coordinates - 'name' (optional): a string representing the name of the molecule The function converts the 'q' and 'r' arrays to contiguous C arrays of the appropriate types, and the 'name' to a C string, and returns an instance of `in_str_t` with the corresponding fields set. @@ -56,15 +56,31 @@ def convert_in_mol(mol): if not isinstance(name, bytes): name = str(name).encode('utf-8') - r = np.ascontiguousarray(r, dtype=c_double) - q = np.ascontiguousarray(q, dtype=c_int) - n = len(q) - if q.ndim != 1: - msg = f"q must be a 1D array, but has shape {q.shape}" + + q_ = np.asarray(q) + n = len(q_) + if q_.ndim != 1: + msg = f"q must be a 1D array, but has shape {q_.shape}" raise ValueError(msg) + + r = np.ascontiguousarray(r, dtype=c_double) if r.shape != (n, 3): msg = f"r must be a 2D array with shape ({n}, 3), but has shape {r.shape}" raise ValueError(msg) + + try: + q = np.ascontiguousarray(q, dtype=c_int) + except ValueError as e: + lib = ctypes.cdll.LoadLibrary(vmol.so) + get_element = declare(lib.get_element, argtypes=[c_char_p], restype=c_int) + q = q.copy() + for i, qi in enumerate(q): + if isinstance(qi, str): + q[i] = get_element(qi.encode('utf-8')) + elif isinstance(qi, bytes): + q[i] = get_element(qi) + q = np.ascontiguousarray(q, dtype=c_int) + return in_str_t(n=c_int(n), q=q.ctypes.data_as(c_int_p), r=r.flatten().ctypes.data_as(c_double_p), From 826b4cdfe5639323f565a301ceb6f5ec827de19e Mon Sep 17 00:00:00 2001 From: Ksenia Date: Thu, 5 Mar 2026 01:35:50 +0100 Subject: [PATCH 25/48] Module -> class --- python/README.md | 16 +-- python/examples/ex1.py | 2 +- python/examples/ex2.py | 2 +- python/ruff.toml | 16 +-- python/vmol/__init__.py | 6 +- python/vmol/__main__.py | 2 +- python/vmol/main.py | 220 +++++++++++++++++++++++++--------------- 7 files changed, 159 insertions(+), 105 deletions(-) diff --git a/python/README.md b/python/README.md index ee85716..e5ef15c 100644 --- a/python/README.md +++ b/python/README.md @@ -82,12 +82,12 @@ To subsitute the `.so`, put in in the same directory or change manually: ## Usage ```python ->>> import vmol +>>> from vmol import vmol >>> # `vmol` provides the two wrapper functions `capture` and `run` ->>> # along with the path to the shared library `so`: ->>> dir(vmol) -['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', - '__package__', '__path__', '__spec__', '_exists', '_paths', 'capture', 'run', 'so'] +>>> # along with the path to the shared library `so`, +>>> # loaded library `lib`, and function namespace `f`. +>>> [*filter(lambda x: not str.startswith(x, '_'), dir(vmol))] +['capture', 'f', 'lib', 'run', 'so'] >>> vmol.so /home/xe/Documents/git/v/python/vmol/v.cpython-313-x86_64-linux-gnu.so >>> # one can use a custom .so file: @@ -110,7 +110,7 @@ python -m vmol ../mol/MOL_3525.xyz cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10 It can also be run from a script, i.e. ```python -import vmol +from vmol import vmol vmol.run(['my_exe_name', '../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10']) ``` The arguments are the same as the CLI ones. They should be an array of strings, @@ -120,7 +120,7 @@ and the 0th argument stays for the program name and is ignored. See [example 1](examples/ex1.py). ```python -import vmol +from vmol import vmol out = vmol.capture(args=['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10']) # look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc` print(out) @@ -145,7 +145,7 @@ Headless mode also works: See [example 2](examples/ex2.py). ```python -import vmol +from vmol import vmol name = 'HF molecule' q = [1, 'F'] r = [[0,0,0],[0.9,0,0]] diff --git a/python/examples/ex1.py b/python/examples/ex1.py index 71ffcc6..37f8929 100755 --- a/python/examples/ex1.py +++ b/python/examples/ex1.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from os.path import dirname, normpath -import vmol +from vmol import vmol mol_dir = normpath(f'{dirname(__file__)}/../../mol/') args = [ diff --git a/python/examples/ex2.py b/python/examples/ex2.py index 0643e74..190a5c7 100755 --- a/python/examples/ex2.py +++ b/python/examples/ex2.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import vmol +from vmol import vmol # mol/mol0001.xyz name = 'acetylene' diff --git a/python/ruff.toml b/python/ruff.toml index 78e8195..0bbdc11 100644 --- a/python/ruff.toml +++ b/python/ruff.toml @@ -19,12 +19,13 @@ select = [ "PERF", "FURB", "PLE", "TRY", "W", "UP", "RUF", "SIM", "NPY", "EM", "RET", "PLR", "FIX", "TD", - "D", + "D" ] ignore = [ - "E501", # line length + "E501", # line-too-long "D203", # incorrect-blank-line-before-class "D213", # multi-line-summary-second-line + #"ANN", "Q000", "SLF001", "PLC0415", "N801", "I001", "CPY001" ] preview = true @@ -32,12 +33,11 @@ preview = true extend-select = ["DOC"] extend-ignore = [ - # whitespaces - "E201", "E202", "E203", "E211", - "E221", "E222", "E225", "E226", "E228", - "E231", "E241", "E271", "E272", - # doc whitespaces - "D413", "D204", + "E221", # multiple-spaces-before-operator + "E222", # multiple-spaces-after-operator + "E225", # missing-whitespace-around-operator + "E241", # multiple-spaces-after-comma + "D413", # missing-blank-line-after-last-section ] [lint.per-file-ignores] diff --git a/python/vmol/__init__.py b/python/vmol/__init__.py index 7f187ac..1231d17 100644 --- a/python/vmol/__init__.py +++ b/python/vmol/__init__.py @@ -1,6 +1,6 @@ import os from sysconfig import get_path, get_config_var -from vmol.main import * +from vmol.main import Vmol _v = 'v' _suffix = get_config_var('EXT_SUFFIX') @@ -15,7 +15,9 @@ _exists = [os.path.isfile(p) for p in _paths] -so = _paths[_exists.index(True)] if sum(_exists) else None +_so = _paths[_exists.index(True)] if sum(_exists) else None + +vmol = Vmol(so=_so) del main del _v, _suffix diff --git a/python/vmol/__main__.py b/python/vmol/__main__.py index df0740f..703c96d 100755 --- a/python/vmol/__main__.py +++ b/python/vmol/__main__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -import vmol +from vmol import vmol def main(): diff --git a/python/vmol/main.py b/python/vmol/main.py index 0fb43d1..04776f8 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -1,11 +1,12 @@ """Run the viewer with specified command-line arguments and/or molecule data and capture the output.""" +from types import SimpleNamespace import ctypes from ctypes import c_int, c_double, c_char_p import functools -import vmol -__all__ = ["capture", "run"] + +__all__ = ["Vmol"] c_double_p = ctypes.POINTER(c_double) c_int_p = ctypes.POINTER(c_int) @@ -14,6 +15,7 @@ class in_str_t(ctypes.Structure): """C structure for the input molecule data, containing the number of atoms, charge array, coordinate array, and name.""" + _fields_ = [ ("n", c_int), ("q", c_int_p), @@ -22,7 +24,30 @@ class in_str_t(ctypes.Structure): ] -def convert_in_mol(mol): +def declare(func, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): + """Declare a function from the shared library with the given argument and return types. + + Args: + func (callable): The function to declare, typically obtained from the shared library. + argtypes (list of ctypes types): The argument types of the function. + restype (ctypes type): The return type of the function. + errcheck (callable, optional): A function that takes the result, the function, and the arguments, + and returns the processed result. + ret_code_ptr_idx (int, optional): Position of the `int *` argument to store the return value in. + + Returns: + callable: The function with the specified arguments and return types. + """ + func.argtypes = argtypes + func.restype = restype + if errcheck: + func.errcheck = errcheck + if ret_code_ptr_idx is not None: + func.ret_code_ptr_idx = ret_code_ptr_idx + return func + + +def dict2struct(get_element, mol): """Convert a molecule represented as a dictionary to the expected C structure for input. The input molecule should be a dictionary with the following keys @@ -33,6 +58,8 @@ def convert_in_mol(mol): and the 'name' to a C string, and returns an instance of `in_str_t` with the corresponding fields set. Args: + get_element (callable): A function that takes a byte string representing an element symbol + and returns its atomic number as an integer. mol (dict): A dictionary representing the molecule, with keys 'q', 'r', and optionally 'name'. Returns: @@ -70,9 +97,7 @@ def convert_in_mol(mol): try: q = np.ascontiguousarray(q, dtype=c_int) - except ValueError as e: - lib = ctypes.cdll.LoadLibrary(vmol.so) - get_element = declare(lib.get_element, argtypes=[c_char_p], restype=c_int) + except ValueError: q = q.copy() for i, qi in enumerate(q): if isinstance(qi, str): @@ -149,90 +174,117 @@ def myinner(argv, *args): return myinner -def declare(func, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): - """Declare a function from the shared library with the given argument and return types. - - Args: - func (callable): The function to declare, typically obtained from the shared library. - argtypes (list of ctypes types): The argument types of the function. - restype (ctypes type): The return type of the function. - errcheck (callable, optional): A function that takes the result, the function, and the arguments, - and returns the processed result. - ret_code_ptr_idx (int, optional): Position of the `int *` argument to store the return value in. - - Returns: - callable: The function with the specified arguments and return types. - """ - func.argtypes = argtypes - func.restype = restype - if errcheck: - func.errcheck = errcheck - if ret_code_ptr_idx is not None: - func.ret_code_ptr_idx = ret_code_ptr_idx - return func +class Hooked: + """A descriptor that calls a hook function whenever the attribute is set to a new value.""" + def __set_name__(self, owner, name): + self.private_name = "_" + name -def run(argv): - """Run the viewer with the given command-line arguments. + def __get__(self, obj, objtype=None): + if obj is None: + return self + return getattr(obj, self.private_name, None) - Args: - argv (list of str): The command-line arguments to pass to the main function. - Unlike `capture()`, the first argument is a string that represents the program name, - such as `sys.argv[0]` or the name of the shared library (`vmol.so`), - - Returns: - int: The return code from the main function. - """ - lib = ctypes.cdll.LoadLibrary(vmol.so) - main = convert_in(declare(lib.main, argtypes=ARGS_T, restype=c_int)) - return main(argv) + def __set__(self, obj, value): + setattr(obj, self.private_name, value) + obj._call_hook() -def capture(*, mol=None, args=None, return_code=False): - """Run the viewer with the given structure and/or command-line arguments and capture the output. +class VmolFunctions: - If `args` is provided, it will be passed as command-line arguments to the main function. - It can contain any arguments that the main function accepts, except for the program name, - includiing the paths to the molecule files to read. + so = Hooked() + f = SimpleNamespace() + lib = None - If `mol` is provided, it will be converted to the appropriate input structure and passed to the main function, - and the paths to the molecule files in `args` will be ignored. - The `mol` dictionary must contain 'q' and 'r' keys for the charge and coordinate arrays, respectively, - and can optionally contain a 'name' key for the molecule name. + def __init__(self, so=None): + self.so = so - Args: - mol (dict, optional): A dictionary representing the molecule. - Must contain 'q' (int 1D array-like) and 'r' (float 2D array-like of shape (n, 3) - for charge and coordinate arrays, respectively. - Optionally can contain a 'name' (str-like) for the molecule name. - args (list of str, optional): Command-line arguments to pass to the main function (without the program name). - return_code (bool, optional): Whether to return the return code along with the output. Defaults to False. + def _check_so(self): + if self.so is None: + msg = "shared library path is not set, cannot run the viewer" + raise ValueError(msg) - Returns: - If `return_code` is False: - str: The output from the main function, decoded as UTF-8 and stripped of trailing newlines. - If `return_code` is True: - tuple of (int, str): the function return code and the output string. - """ - args = [vmol.so, *args] if args else [vmol.so] - lib = ctypes.cdll.LoadLibrary(vmol.so) - free = declare(lib.free_out_str, argtypes=None, restype=None) - - if mol: - main = lib.main_wrap_in_out - argtypes = [*ARGS_T, c_int_p, in_str_t] - arguments = [args, convert_in_mol(mol)] - else: - main = lib.main_wrap_out - argtypes = [*ARGS_T, c_int_p] - arguments = [args] - - def errcheck(result, func, args): - ret = args[func.ret_code_ptr_idx]._obj.value - out = result.decode('utf-8').rstrip('\n') if result else None - free() - return ret, out - - main = convert_in(declare(main, argtypes=argtypes, restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2)) - ret, out = main(*arguments) - return (ret, out) if return_code else out + def _call_hook(self): + """Re-declare functions when self.so is set to a new value.""" + if self.so is None: + self.lib = None + self._reset_functions() + elif self.lib is None or self.lib._name != self.so: + self._declare_functions() + + def _reset_functions(self): + self.f.__dict__.clear() + + def _declare_functions(self): + + def errcheck(result, func, args): + ret = args[func.ret_code_ptr_idx]._obj.value + out = result.decode('utf-8').rstrip('\n') if result else None + self.f.free() + return ret, out + + self.lib = ctypes.cdll.LoadLibrary(self.so) + + self.f.free = declare(self.lib.free_out_str, argtypes=None, restype=None) + self.f.get_element = declare(self.lib.get_element, argtypes=[c_char_p], restype=c_int) + + self.f.main_raw = declare(self.lib.main, argtypes=ARGS_T, restype=c_int) + self.f.main_out_raw = declare(self.lib.main_wrap_out, argtypes=[*ARGS_T, c_int_p], + restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) + self.f.main_in_out_raw = declare(self.lib.main_wrap_in_out, argtypes=[*ARGS_T, c_int_p, in_str_t], + restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) + self.f.main = convert_in(self.f.main_raw) + self.f.main_out = convert_in(self.f.main_out_raw) + self.f.main_in_out = convert_in(self.f.main_in_out_raw) + + +class Vmol(VmolFunctions): + """Run the viewer with specified command-line arguments and/or molecule data and capture the output.""" + + def run(self, argv): + """Run the viewer with the given command-line arguments. + + Args: + argv (list of str): The command-line arguments to pass to the main function. + Unlike `capture()`, the first argument is a string that represents the program name, + such as `sys.argv[0]` or the name of the shared library. + + Returns: + int: The return code from the main function. + """ + self._check_so() + return self.f.main(argv) + + def capture(self, *, mol=None, args=None, return_code=False): + """Run the viewer with the given structure and/or command-line arguments and capture the output. + + If `args` is provided, it will be passed as command-line arguments to the main function. + It can contain any arguments that the main function accepts, except for the program name, + includiing the paths to the molecule files to read. + + If `mol` is provided, it will be converted to the appropriate input structure and passed to the main function, + and the paths to the molecule files in `args` will be ignored. + The `mol` dictionary must contain 'q' and 'r' keys for the charge and coordinate arrays, respectively, + and can optionally contain a 'name' key for the molecule name. + + Args: + mol (dict, optional): A dictionary representing the molecule. + Must contain 'q' (int 1D array-like) and 'r' (float 2D array-like of shape (n, 3) + for charge and coordinate arrays, respectively. + Optionally can contain a 'name' (str-like) for the molecule name. + args (list of str, optional): Command-line arguments to pass to the main function (without the program name). + return_code (bool, optional): Whether to return the return code along with the output. Defaults to False. + + Returns: + If `return_code` is False: + str: The output from the main function, decoded as UTF-8 and stripped of trailing newlines. + If `return_code` is True: + tuple of (int, str): the function return code and the output string. + """ + self._check_so() + args = [self.so, *args] if args else [self.so] + if mol: + ret, out = self.f.main_in_out(args, dict2struct(self.f.get_element, mol)) + else: + ret, out = self.f.main_out(args) + return (ret, out) if return_code else out From 22e361c9862811359a9c1e516c22b0ca33fce0b9 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Thu, 5 Mar 2026 19:50:59 +0100 Subject: [PATCH 26/48] Pass several structures --- python/README.md | 4 +++- python/examples/ex2.py | 18 ++++++++++++++++-- python/ruff.toml | 1 + python/vmol/main.py | 41 ++++++++++++++++++++++++++--------------- src/api.c | 41 ++++++++++++++++++++++++----------------- src/v/load.c | 35 ++++++++++++++++++++--------------- src/v/v.h | 4 ++-- 7 files changed, 92 insertions(+), 52 deletions(-) diff --git a/python/README.md b/python/README.md index e5ef15c..4250752 100644 --- a/python/README.md +++ b/python/README.md @@ -142,6 +142,8 @@ Headless mode also works: ``` ### 3. Pass a structure + +One can pass a structure (or several structures) as an argument. See [example 2](examples/ex2.py). ```python @@ -149,7 +151,7 @@ from vmol import vmol name = 'HF molecule' q = [1, 'F'] r = [[0,0,0],[0.9,0,0]] -out = vmol.capture(mol={'q': q, 'r': r, 'name': name}, args=['shell:0.6,0.7']) +out = vmol.capture(mols={'q': q, 'r': r, 'name': name}, args=['shell:0.6,0.7']) # look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc` print(out) ``` diff --git a/python/examples/ex2.py b/python/examples/ex2.py index 190a5c7..c4299ec 100755 --- a/python/examples/ex2.py +++ b/python/examples/ex2.py @@ -2,6 +2,8 @@ from vmol import vmol +vmol.so = './v.so' + # mol/mol0001.xyz name = 'acetylene' q = [6, 6, 1, 1] @@ -15,13 +17,25 @@ input('press enter to view a molecule...') # rotation matrix rot = 'rot:0.587785,0.000000,0.809017,0.670705,0.559193,-0.487296,-0.452397,0.829038,0.328685' -ret, xyz = vmol.capture(mol={'q': q, 'r': r, 'name': name}, args=[rot], return_code=True) +ret, xyz = vmol.capture(mols={'q': q, 'r': r, 'name': name}, args=[rot], return_code=True) print('return code:', ret) print('captured output:') print(xyz) print() input('press enter to get its point group in headless mode...') -point_group = vmol.capture(mol={'q': q, 'r': r}, args=['gui:0', 'com:.']) +point_group = vmol.capture(mols={'q': q, 'r': r}, args=['gui:0', 'com:.']) print(f'{point_group=}') print() + +input('press enter to view two molecules...') +mol1 = {'q': q, 'r': r, 'name': name} + +water_r = [[ 0.7493682, 0.0000000, 0.4424329], + [ 0.0000000, 0.0000000, -0.1653507], + [-0.7493682, 0.0000000, 0.4424329]] +mol2 = {'q': ['H', 8, '1'], 'r': water_r, 'name': 'water'} + +out = vmol.capture(mols=[mol2, mol1], args=[rot]) +print('captured output:') +print(out) diff --git a/python/ruff.toml b/python/ruff.toml index 0bbdc11..9ff2146 100644 --- a/python/ruff.toml +++ b/python/ruff.toml @@ -33,6 +33,7 @@ preview = true extend-select = ["DOC"] extend-ignore = [ + "E201", # whitespace-after-open-bracket "E221", # multiple-spaces-before-operator "E222", # multiple-spaces-after-operator "E225", # missing-whitespace-around-operator diff --git a/python/vmol/main.py b/python/vmol/main.py index 04776f8..48c220d 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -8,12 +8,13 @@ __all__ = ["Vmol"] + c_double_p = ctypes.POINTER(c_double) c_int_p = ctypes.POINTER(c_int) ARGS_T = (c_int, ctypes.POINTER(ctypes.c_char_p)) -class in_str_t(ctypes.Structure): +class inp_mols_t(ctypes.Structure): """C structure for the input molecule data, containing the number of atoms, charge array, coordinate array, and name.""" _fields_ = [ @@ -55,7 +56,7 @@ def dict2struct(get_element, mol): - 'r': a 2D array-like of floats with shape (n, 3) representing the atomic coordinates - 'name' (optional): a string representing the name of the molecule The function converts the 'q' and 'r' arrays to contiguous C arrays of the appropriate types, - and the 'name' to a C string, and returns an instance of `in_str_t` with the corresponding fields set. + and the 'name' to a C string, and returns an instance of `inp_mols_t` with the corresponding fields set. Args: get_element (callable): A function that takes a byte string representing an element symbol @@ -63,7 +64,7 @@ def dict2struct(get_element, mol): mol (dict): A dictionary representing the molecule, with keys 'q', 'r', and optionally 'name'. Returns: - in_str_t: An instance of `in_str_t` with the fields set according to the input molecule. + inp_mols_t: An instance of `inp_mols_t` with the fields set according to the input molecule. Raises: TypeError: If mol is not a dictionary. @@ -94,6 +95,7 @@ def dict2struct(get_element, mol): if r.shape != (n, 3): msg = f"r must be a 2D array with shape ({n}, 3), but has shape {r.shape}" raise ValueError(msg) + r = r.flatten() try: q = np.ascontiguousarray(q, dtype=c_int) @@ -106,10 +108,12 @@ def dict2struct(get_element, mol): q[i] = get_element(qi) q = np.ascontiguousarray(q, dtype=c_int) - return in_str_t(n=c_int(n), - q=q.ctypes.data_as(c_int_p), - r=r.flatten().ctypes.data_as(c_double_p), - name=name) + in_str = inp_mols_t(n=c_int(n), + q=q.ctypes.data_as(c_int_p), + r=r.ctypes.data_as(c_double_p), + name=name) + in_str._keepalive = (n, q, r, name) # keep strong references + return in_str def convert_in(func): @@ -231,7 +235,7 @@ def errcheck(result, func, args): self.f.main_raw = declare(self.lib.main, argtypes=ARGS_T, restype=c_int) self.f.main_out_raw = declare(self.lib.main_wrap_out, argtypes=[*ARGS_T, c_int_p], restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) - self.f.main_in_out_raw = declare(self.lib.main_wrap_in_out, argtypes=[*ARGS_T, c_int_p, in_str_t], + self.f.main_in_out_raw = declare(self.lib.main_wrap_in_out, argtypes=[*ARGS_T, c_int_p, c_int, ctypes.POINTER(inp_mols_t)], restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) self.f.main = convert_in(self.f.main_raw) self.f.main_out = convert_in(self.f.main_out_raw) @@ -255,23 +259,24 @@ def run(self, argv): self._check_so() return self.f.main(argv) - def capture(self, *, mol=None, args=None, return_code=False): + def capture(self, *, mols=None, args=None, return_code=False): """Run the viewer with the given structure and/or command-line arguments and capture the output. If `args` is provided, it will be passed as command-line arguments to the main function. It can contain any arguments that the main function accepts, except for the program name, includiing the paths to the molecule files to read. - If `mol` is provided, it will be converted to the appropriate input structure and passed to the main function, - and the paths to the molecule files in `args` will be ignored. - The `mol` dictionary must contain 'q' and 'r' keys for the charge and coordinate arrays, respectively, + If `mols` is provided, the molecules(s) will be converted to the appropriate input structure(s) + and passed to the main function, and the paths to the molecule files in `args` will be ignored. + The `mols` dictionaries must contain 'q' and 'r' keys for the charge and coordinate arrays, respectively, and can optionally contain a 'name' key for the molecule name. Args: - mol (dict, optional): A dictionary representing the molecule. + mols (dict or list[dict], optional): A dictionary representing the molecule. Must contain 'q' (int 1D array-like) and 'r' (float 2D array-like of shape (n, 3) for charge and coordinate arrays, respectively. Optionally can contain a 'name' (str-like) for the molecule name. + Could be a list containing dictionaries representing several molecules. args (list of str, optional): Command-line arguments to pass to the main function (without the program name). return_code (bool, optional): Whether to return the return code along with the output. Defaults to False. @@ -283,8 +288,14 @@ def capture(self, *, mol=None, args=None, return_code=False): """ self._check_so() args = [self.so, *args] if args else [self.so] - if mol: - ret, out = self.f.main_in_out(args, dict2struct(self.f.get_element, mol)) + if mols: + + if not isinstance(mols, list): + mols = [mols] + nmol = len(mols) + mols = (inp_mols_t * nmol)(*(dict2struct(self.f.get_element, mol) for mol in mols)) + + ret, out = self.f.main_in_out(args, nmol, mols) else: ret, out = self.f.main_out(args) return (ret, out) if return_code else out diff --git a/src/api.c b/src/api.c index 4a0ab1e..eacfd51 100644 --- a/src/api.c +++ b/src/api.c @@ -4,25 +4,32 @@ #define PRINTBUFLEN (1024*128) #define FREE0(PTR) { free(PTR); PTR = NULL; } -char * out_str; -in_str_t in_str; +struct { + int n_inp_mols; + inp_mols_t * inp_mols; + char * out_str; +} globals; char * main_wrap_out(int argc, char * argv[], int * ret) { - out_str = calloc(PRINTBUFLEN, 1); + globals.out_str = calloc(PRINTBUFLEN, 1); *ret = main(argc, argv); - return out_str; + return globals.out_str; } -char * main_wrap_in_out(int argc, char * argv[], int * ret, in_str_t in_str_) { - in_str = in_str_; - out_str = calloc(PRINTBUFLEN, 1); +char * main_wrap_in_out(int argc, char * argv[], + int * ret, + int n_inp_mols, inp_mols_t * inp_mols) { + globals.inp_mols = inp_mols; + globals.n_inp_mols = n_inp_mols; + globals.out_str = calloc(PRINTBUFLEN, 1); *ret = main(argc, argv); - memset(&in_str, 0, sizeof(in_str)); - return out_str; + globals.inp_mols = NULL; + globals.n_inp_mols = 0; + return globals.out_str; } void free_out_str(void){ - FREE0(out_str); + FREE0(globals.out_str); PRINTOUT(NULL, NULL); } @@ -39,7 +46,7 @@ void PRINTOUT(FILE * f, char * format, ...){ return; } - if(!out_str){ + if(!globals.out_str){ va_start(args, format); vfprintf(f, format, args); va_end(args); @@ -48,14 +55,14 @@ void PRINTOUT(FILE * f, char * format, ...){ va_start(args, format); size_t size = N-n; - size_t m = vsnprintf(out_str+n, size, format, args); + size_t m = vsnprintf(globals.out_str+n, size, format, args); va_end(args); if(m >= size){ N = m < N ? N * 2 : N + 2*m; - out_str = realloc(out_str, N); + globals.out_str = realloc(globals.out_str, N); va_start(args, format); - vsnprintf(out_str+n, N-n, format, args); + vsnprintf(globals.out_str+n, N-n, format, args); va_end(args); } @@ -65,18 +72,18 @@ void PRINTOUT(FILE * f, char * format, ...){ void * READ_FILES(drawpars * dp){ void * ret; - if(!in_str.n){ + if(!globals.inp_mols){ ret = read_files(dp); } else{ - ret = get_in_str(in_str, dp); + ret = get_in_str(globals.n_inp_mols, globals.inp_mols, dp); } FREE0(dp->input_files); return ret; } int SHOULD_PRINT_MAN(int argc){ - if((argc==1) && (!in_str.n)){ + if((argc==1) && (!globals.inp_mols)){ return 1; } return 0; diff --git a/src/v/load.c b/src/v/load.c index 73f6fbf..983c3a5 100644 --- a/src/v/load.c +++ b/src/v/load.c @@ -151,7 +151,7 @@ void * read_files(drawpars * dp){ return ent; } -atcoords * get_in_str(in_str_t in_str, drawpars * dp){ +atcoords * get_in_str(int N, inp_mols_t * inp_mols, drawpars * dp){ for(int i=0; iinput_files_n; i++){ PRINT_WARN("ignoring file '%s'\n", dp->input_files[i]); @@ -160,27 +160,32 @@ atcoords * get_in_str(in_str_t in_str, drawpars * dp){ PRINT_WARN("cannot read vibrations from input variable\n"); } dp->task = AT3COORDS; - dp->fname = in_str.name; - - int n = in_str.n; - txyz * xyz = malloc(sizeof(txyz)*n); - for(int i=0; iNmem = 1; - acs->n = 0; + acs->Nmem = N; acs->m = malloc(acs->Nmem*sizeof(atcoord *)); - acs->m[acs->n++] = atcoord_fill(n, xyz, in_str.name, dp->b, dp->center, dp->inertia, dp->bohr); + acs->n = N; + + int nmax = 0; + for(int i=0; in; i++){ + xyz[i].t = inmol->q[i]; + r3cp(xyz[i].r, inmol->r+i*3); + } + acs->m[i] = atcoord_fill(inmol->n, xyz, inmol->name, dp->b, dp->center, dp->inertia, dp->bohr); + } + + free(xyz); fill_nf(acs, 0); dp->scale = acs_scale(acs); newmol_prep(acs, dp); - intcoord_check(INT_MAX, dp->z); - free(xyz); + intcoord_check(nmax, dp->z); return acs; } diff --git a/src/v/v.h b/src/v/v.h index a8ea5b3..8843392 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -111,11 +111,11 @@ typedef struct { int * q; double * r; char * name; -} in_str_t; +} inp_mols_t; // load.c -atcoords * get_in_str(in_str_t in_str, drawpars * dp); +atcoords * get_in_str(int N, inp_mols_t * inp_mols, drawpars * dp); void acs_readmore (FILE * f, int b, int center, int inertia, int bohr, atcoords * acs, const char * fname); void * read_files(drawpars * dp); // scale.c From 9fde8e38b01aecae743ed5df80f38e1704992303 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Fri, 6 Mar 2026 19:41:41 +0100 Subject: [PATCH 27/48] Add ase.atoms.Atoms support --- python/README.md | 7 ++++ python/examples/ex2.py | 2 - python/examples/ex_ase.py | 13 ++++++ python/ruff.toml | 2 +- python/vmol/main.py | 84 +++++++++++++++++++++++---------------- 5 files changed, 70 insertions(+), 38 deletions(-) create mode 100755 python/examples/ex_ase.py diff --git a/python/README.md b/python/README.md index 4250752..b210166 100644 --- a/python/README.md +++ b/python/README.md @@ -155,3 +155,10 @@ out = vmol.capture(mols={'q': q, 'r': r, 'name': name}, args=['shell:0.6,0.7']) # look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc` print(out) ``` + +ASE Atoms (or anything with `.numbers` and `.positions`) are also supported: +```python +import ase.io +mols = ase.io.read('../mol/mol0002.xyz', index=':') +out = vmol.capture(mols=mols) +``` diff --git a/python/examples/ex2.py b/python/examples/ex2.py index c4299ec..6ba231e 100755 --- a/python/examples/ex2.py +++ b/python/examples/ex2.py @@ -2,8 +2,6 @@ from vmol import vmol -vmol.so = './v.so' - # mol/mol0001.xyz name = 'acetylene' q = [6, 6, 1, 1] diff --git a/python/examples/ex_ase.py b/python/examples/ex_ase.py new file mode 100755 index 0000000..2f09905 --- /dev/null +++ b/python/examples/ex_ase.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import ase.io +from vmol import vmol + + +mols = ase.io.read('../mol/mol0002.xyz', index=':') + +rot = 'rot:0.83,0.40,-0.39,0.55,-0.67,0.49,-0.06,-0.62,-0.78' + +out = vmol.capture(mols=mols, args=[rot]) +print('captured output:') +print(out) diff --git a/python/ruff.toml b/python/ruff.toml index 9ff2146..5ab7539 100644 --- a/python/ruff.toml +++ b/python/ruff.toml @@ -43,4 +43,4 @@ extend-ignore = [ [lint.per-file-ignores] "vmol/__main__.py" = ["D"] -"examples/ex?.py" = ["D"] +"examples/ex*.py" = ["D"] diff --git a/python/vmol/main.py b/python/vmol/main.py index 48c220d..80bb1bf 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -17,12 +17,12 @@ class inp_mols_t(ctypes.Structure): """C structure for the input molecule data, containing the number of atoms, charge array, coordinate array, and name.""" - _fields_ = [ + _fields_ = ( ("n", c_int), ("q", c_int_p), ("r", c_double_p), ("name", c_char_p), - ] + ) def declare(func, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): @@ -48,20 +48,24 @@ def declare(func, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): return func -def dict2struct(get_element, mol): - """Convert a molecule represented as a dictionary to the expected C structure for input. +def mol2struct(get_element, mol): + """Convert a molecule to the expected C structure for input. - The input molecule should be a dictionary with the following keys - - 'q': a 1D array-like of integers or strings representing the atomic numbers or element symbols - - 'r': a 2D array-like of floats with shape (n, 3) representing the atomic coordinates - - 'name' (optional): a string representing the name of the molecule - The function converts the 'q' and 'r' arrays to contiguous C arrays of the appropriate types, - and the 'name' to a C string, and returns an instance of `inp_mols_t` with the corresponding fields set. + Currently supports two formats for the input molecule: + + 1) Dictionary with the following keys: + - 'q': a 1D array-like of integers or strings representing the atomic numbers or element symbols, + - 'r': a 2D array-like of floats with shape (n, 3) representing the atomic coordinates, + - 'name' (optional): a string representing the name of the molecule. + + 2) ase.atoms.Atoms-like object with the following attributes: + - `numbers`: a 1D array of integers representing the atomic numbers, + - `positions`: a 2D array of floats with shape (n, 3) representing the atomic coordinates. Args: get_element (callable): A function that takes a byte string representing an element symbol and returns its atomic number as an integer. - mol (dict): A dictionary representing the molecule, with keys 'q', 'r', and optionally 'name'. + mol (dict or ase.atoms.Atoms-like): The molecule to convert. Returns: inp_mols_t: An instance of `inp_mols_t` with the fields set according to the input molecule. @@ -72,23 +76,27 @@ def dict2struct(get_element, mol): """ import numpy as np - if not isinstance(mol, dict): - msg = f"mol must be a dictionary, but got {type(mol)}" - raise TypeError(msg) - q = mol.get('q') - r = mol.get('r') - name = mol.get('name') - if q is None or r is None: - msg = "mol must contain 'q' and 'r' for charge and coordinate arrays, respectively" - raise ValueError(msg) + if isinstance(mol, dict): + q = mol.get('q') + r = mol.get('r') + name = mol.get('name') + if q is None or r is None: + msg = "mol must contain 'q' and 'r' for charge and coordinate arrays, respectively" + raise ValueError(msg) - if not isinstance(name, bytes): - name = str(name).encode('utf-8') + elif hasattr(mol, 'positions') and hasattr(mol, 'numbers'): + r = mol.positions + q = mol.numbers + name = str(mol) - q_ = np.asarray(q) - n = len(q_) - if q_.ndim != 1: - msg = f"q must be a 1D array, but has shape {q_.shape}" + else: + msg = f"mol must be a dictionary or ase.atoms.Atoms-like, but got {type(mol)}" + raise TypeError(msg) + + q_tmp = np.asarray(q) + n = len(q_tmp) + if q_tmp.ndim != 1: + msg = f"q must be a 1D array, but has shape {q_tmp.shape}" raise ValueError(msg) r = np.ascontiguousarray(r, dtype=c_double) @@ -108,10 +116,13 @@ def dict2struct(get_element, mol): q[i] = get_element(qi) q = np.ascontiguousarray(q, dtype=c_int) + if not isinstance(name, bytes): + name = str(name).encode('utf-8') + in_str = inp_mols_t(n=c_int(n), - q=q.ctypes.data_as(c_int_p), - r=r.ctypes.data_as(c_double_p), - name=name) + q=q.ctypes.data_as(c_int_p), + r=r.ctypes.data_as(c_double_p), + name=name) in_str._keepalive = (n, q, r, name) # keep strong references return in_str @@ -203,6 +214,12 @@ class VmolFunctions: def __init__(self, so=None): self.so = so + def __repr__(self): + return f"Vmol(so={self.so!r})" + + def __bool__(self): + return self.so is not None + def _check_so(self): if self.so is None: msg = "shared library path is not set, cannot run the viewer" @@ -272,11 +289,8 @@ def capture(self, *, mols=None, args=None, return_code=False): and can optionally contain a 'name' key for the molecule name. Args: - mols (dict or list[dict], optional): A dictionary representing the molecule. - Must contain 'q' (int 1D array-like) and 'r' (float 2D array-like of shape (n, 3) - for charge and coordinate arrays, respectively. - Optionally can contain a 'name' (str-like) for the molecule name. - Could be a list containing dictionaries representing several molecules. + mols (object or list[object], optional): An object or a list thereof representing the molecule(s). + See `mol2struct()` for the expected format. args (list of str, optional): Command-line arguments to pass to the main function (without the program name). return_code (bool, optional): Whether to return the return code along with the output. Defaults to False. @@ -293,7 +307,7 @@ def capture(self, *, mols=None, args=None, return_code=False): if not isinstance(mols, list): mols = [mols] nmol = len(mols) - mols = (inp_mols_t * nmol)(*(dict2struct(self.f.get_element, mol) for mol in mols)) + mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) ret, out = self.f.main_in_out(args, nmol, mols) else: From b9578e8b98f066cd41a8e061f25081a1b993d811 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Fri, 6 Mar 2026 20:01:10 +0100 Subject: [PATCH 28/48] Add cclib example TODO: add wrapper script --- mol/CEHZOF_1_SPE.out | 2152 +++++++++++++++++++++++++++++++++++ python/README.md | 4 +- python/examples/ex_cclib.py | 13 + 3 files changed, 2168 insertions(+), 1 deletion(-) create mode 100644 mol/CEHZOF_1_SPE.out create mode 100755 python/examples/ex_cclib.py diff --git a/mol/CEHZOF_1_SPE.out b/mol/CEHZOF_1_SPE.out new file mode 100644 index 0000000..6084b84 --- /dev/null +++ b/mol/CEHZOF_1_SPE.out @@ -0,0 +1,2152 @@ + + ***************** + * O R C A * + ***************** + + #, + ### + #### + ##### + ###### + ########, + ,,################,,,,, + ,,#################################,, + ,,##########################################,, + ,#########################################, ''#####, + ,#############################################,, '####, + ,##################################################,,,,####, + ,###########'''' ''''############################### + ,#####'' ,,,,##########,,,, '''####''' '#### + ,##' ,,,,###########################,,, '## + ' ,,###'''' '''############,,, + ,,##'' '''############,,,, ,,,,,,###'' + ,#'' '''#######################''' + ' ''''####'''' + ,#######, #######, ,#######, ## + ,#' '#, ## ## ,#' '#, #''# ###### ,####, + ## ## ## ,#' ## #' '# # #' '# + ## ## ####### ## ,######, #####, # # + '#, ,#' ## ## '#, ,#' ,# #, ## #, ,# + '#######' ## ## '#######' #' '# #####' # '####' + + + + ####################################################### + # -***- # + # Department of theory and spectroscopy # + # Directorship and core code : Frank Neese # + # Max Planck Institute fuer Kohlenforschung # + # Kaiser Wilhelm Platz 1 # + # D-45470 Muelheim/Ruhr # + # Germany # + # # + # All rights reserved # + # -***- # + ####################################################### + + + Program Version 5.0.3 - RELEASE - + + + With contributions from (in alphabetic order): + Daniel Aravena : Magnetic Suceptibility + Michael Atanasov : Ab Initio Ligand Field Theory (pilot matlab implementation) + Alexander A. Auer : GIAO ZORA, VPT2 properties, NMR spectrum + Ute Becker : Parallelization + Giovanni Bistoni : ED, misc. LED, open-shell LED, HFLD + Martin Brehm : Molecular dynamics + Dmytro Bykov : SCF Hessian + Vijay G. Chilkuri : MRCI spin determinant printing, contributions to CSF-ICE + Dipayan Datta : RHF DLPNO-CCSD density + Achintya Kumar Dutta : EOM-CC, STEOM-CC + Dmitry Ganyushin : Spin-Orbit,Spin-Spin,Magnetic field MRCI + Miquel Garcia : C-PCM and meta-GGA Hessian, CC/C-PCM, Gaussian charge scheme + Yang Guo : DLPNO-NEVPT2, F12-NEVPT2, CIM, IAO-localization + Andreas Hansen : Spin unrestricted coupled pair/coupled cluster methods + Benjamin Helmich-Paris : MC-RPA, TRAH-SCF, COSX integrals + Lee Huntington : MR-EOM, pCC + Robert Izsak : Overlap fitted RIJCOSX, COSX-SCS-MP3, EOM + Marcus Kettner : VPT2 + Christian Kollmar : KDIIS, OOCD, Brueckner-CCSD(T), CCSD density, CASPT2, CASPT2-K + Simone Kossmann : Meta GGA functionals, TD-DFT gradient, OOMP2, MP2 Hessian + Martin Krupicka : Initial AUTO-CI + Lucas Lang : DCDCAS + Marvin Lechner : AUTO-CI (C++ implementation), FIC-MRCC + Dagmar Lenk : GEPOL surface, SMD + Dimitrios Liakos : Extrapolation schemes; Compound Job, initial MDCI parallelization + Dimitrios Manganas : Further ROCIS development; embedding schemes + Dimitrios Pantazis : SARC Basis sets + Anastasios Papadopoulos: AUTO-CI, single reference methods and gradients + Taras Petrenko : DFT Hessian,TD-DFT gradient, ASA, ECA, R-Raman, ABS, FL, XAS/XES, NRVS + Peter Pinski : DLPNO-MP2, DLPNO-MP2 Gradient + Christoph Reimann : Effective Core Potentials + Marius Retegan : Local ZFS, SOC + Christoph Riplinger : Optimizer, TS searches, QM/MM, DLPNO-CCSD(T), (RO)-DLPNO pert. Triples + Tobias Risthaus : Range-separated hybrids, TD-DFT gradient, RPA, STAB + Michael Roemelt : Original ROCIS implementation + Masaaki Saitow : Open-shell DLPNO-CCSD energy and density + Barbara Sandhoefer : DKH picture change effects + Avijit Sen : IP-ROCIS + Kantharuban Sivalingam : CASSCF convergence, NEVPT2, FIC-MRCI + Bernardo de Souza : ESD, SOC TD-DFT + Georgi Stoychev : AutoAux, RI-MP2 NMR, DLPNO-MP2 response + Willem Van den Heuvel : Paramagnetic NMR + Boris Wezisla : Elementary symmetry handling + Frank Wennmohs : Technical directorship + + + We gratefully acknowledge several colleagues who have allowed us to + interface, adapt or use parts of their codes: + Stefan Grimme, W. Hujo, H. Kruse, P. Pracht, : VdW corrections, initial TS optimization, + C. Bannwarth, S. Ehlert DFT functionals, gCP, sTDA/sTD-DF + Ed Valeev, F. Pavosevic, A. Kumar : LibInt (2-el integral package), F12 methods + Garnet Chan, S. Sharma, J. Yang, R. Olivares : DMRG + Ulf Ekstrom : XCFun DFT Library + Mihaly Kallay : mrcc (arbitrary order and MRCC methods) + Jiri Pittner, Ondrej Demel : Mk-CCSD + Frank Weinhold : gennbo (NPA and NBO analysis) + Christopher J. Cramer and Donald G. Truhlar : smd solvation model + Lars Goerigk : TD-DFT with DH, B97 family of functionals + V. Asgeirsson, H. Jonsson : NEB implementation + FAccTs GmbH : IRC, NEB, NEB-TS, DLPNO-Multilevel, CI-OPT + MM, QMMM, 2- and 3-layer-ONIOM, Crystal-QMMM, + LR-CPCM, SF, NACMEs, symmetry and pop. for TD-DFT, + nearIR, NL-DFT gradient (VV10), updates on ESD, + ML-optimized integration grids + S Lehtola, MJT Oliveira, MAL Marques : LibXC Library + Liviu Ungur et al : ANISO software + + + Your calculation uses the libint2 library for the computation of 2-el integrals + For citations please refer to: http://libint.valeyev.net + + Your ORCA version has been built with support for libXC version: 5.1.0 + For citations please refer to: https://tddft.org/programs/libxc/ + + This ORCA versions uses: + CBLAS interface : Fast vector & matrix operations + LAPACKE interface : Fast linear algebra routines + SCALAPACK package : Parallel linear algebra routines + Shared memory : Shared parallel matrices + BLAS/LAPACK : OpenBLAS 0.3.15 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Zen SINGLE_THREADED + Core in use : Zen + Copyright (c) 2011-2014, The OpenBLAS Project + + + + +*************************************** +The coordinates will be read from file: CEHZOF.xyz +*************************************** + + +Your calculation utilizes the atom-pairwise dispersion correction +with the Becke-Johnson damping scheme (D3BJ) +Cite in your paper: +S.Grimme, S.Ehrlich, L.Goerigk, J Comput Chem, (2011), 32, 1456–1465 +S.Grimme, J.Antony, S.Ehrlich and H.Krieg, J.Chem.Phys., 132, (2010), 154104 + + +================================================================================ + +cite the ECPs for I [Def2-ECP] as follows: +Ce-Yb(ecp-28): M. Dolg, H. Stoll, H.Preuss, J. Chem. Phys., 1989, 90, 1730-1734. +Y-Cd(ecp-28), Hf-Hg(ecp-46): D. Andrae,U. Haeussermann, M. Dolg, H. Stoll, H. Preuss, Theor. Chim. Acta, 1990, 77, 123-141. +In-Sb(ecp-28), Tl-Bi(ecp-46): B. Metz, H. Stoll, M. Dolg, J. Chem. Phys., 2000, 113, 2563-2569. +Te-Xe(ecp-28), Po-Rn(ecp-46): K. A. Peterson, D. Figgen, E. Goll, H. Stoll, M. Dolg, J. Chem. Phys., 2003, 119, 11113-11123. +Rb(ecp-28), Cs(ecp-46): T. Leininger, A. Nicklass, W. Kuechle, H. Stoll, M. Dolg, A. Bergner, Chem. Phys. Lett., 1996, 255, 274-280. +Sr(ecp-28), Ba(ecp-46): M. Kaupp, P. V. Schleyer, H. Stoll and H. Preuss, J. Chem. Phys., 1991, 94, 1360-1366. +La(ecp-46): M. Dolg, H. Stoll, A. Savin, H. Preuss, Theor. Chim. Acta, 1989, 75, 173-194. +Lu(ecp-28): X. Cao, M. Dolg, J. Chem. Phys., 2001, 115, 7348-7355. + +ECP parameters for I [Def2-ECP] have been obtained from: +TURBOMOLE (7.0.2) + +----- Orbital basis set information ----- +Your calculation utilizes the basis: def2-TZVP + F. Weigend and R. Ahlrichs, Phys. Chem. Chem. Phys. 7, 3297 (2005). + +----- AuxJ basis set information ----- +Your calculation utilizes the auxiliary basis: def2/J + F. Weigend, Phys. Chem. Chem. Phys. 8, 1057 (2006). + +================================================================================ + WARNINGS + Please study these warnings very carefully! +================================================================================ + + +INFO : the flag for use of the SHARK integral package has been found! + +================================================================================ + INPUT FILE +================================================================================ +NAME = CEHZOF_1_SPE.inp +| 1> ! TPSSh D3BJ RIJCOSX def2-TZVP def2/J Slowconv Hirshfeld +| 2> %PAL NPROCS 64 END +| 3> %scf +| 4> MaxIter 1500 +| 5> SOSCFStart 0.00033 +| 6> end +| 7> +| 8> *xyzfile 0 1 CEHZOF.xyz +| 9> +| 10> ****END OF INPUT**** +================================================================================ + + **************************** + * Single Point Calculation * + **************************** + +--------------------------------- +CARTESIAN COORDINATES (ANGSTROEM) +--------------------------------- + I -0.691564 6.065851 10.218679 + Co -0.896730 6.291743 12.801124 + S -3.111547 5.942715 12.672839 + C -0.900957 4.763642 14.175690 + C -0.461276 5.983590 14.795995 + C 0.713137 6.405881 14.113956 + H 1.264840 7.323863 14.311032 + C 0.993227 5.481683 13.083596 + H 1.802106 5.559932 12.358853 + C 0.015965 4.473016 13.122433 + H -0.056529 3.635907 12.428292 + C -2.210760 4.059666 14.447381 + H -2.673227 4.493474 15.348774 + H -2.035736 2.991419 14.671175 + C -3.111610 4.202498 13.259335 + H -2.727972 3.649740 12.386330 + H -4.146425 3.867362 13.435280 + C -3.945153 6.793732 14.050514 + H -3.869637 7.852090 13.755824 + H -3.340371 6.686944 14.965041 + C -5.368941 6.350425 14.251741 + H -5.442055 5.313038 14.619953 + H -5.857396 6.994746 15.002527 + H -5.951474 6.421791 13.318039 + I -1.173397 8.852094 12.837558 + H -0.948251 6.502776 15.620742 + +---------------------------- +CARTESIAN COORDINATES (A.U.) +---------------------------- + NO LB ZA FRAG MASS X Y Z + 0 I 25.0000* 0 126.900 -1.306867 11.462797 19.310505 + 1 Co 27.0000 0 58.930 -1.694574 11.889671 24.190619 + 2 S 16.0000 0 32.060 -5.879972 11.230104 23.948195 + 3 C 6.0000 0 12.011 -1.702562 9.001979 26.788172 + 4 C 6.0000 0 12.011 -0.871685 11.307346 27.960378 + 5 C 6.0000 0 12.011 1.347634 12.105361 26.671512 + 6 H 1.0000 0 1.008 2.390201 13.840095 27.043931 + 7 C 6.0000 0 12.011 1.876927 10.358880 24.724413 + 8 H 1.0000 0 1.008 3.405487 10.506749 23.354847 + 9 C 6.0000 0 12.011 0.030169 8.452775 24.797805 + 10 H 1.0000 0 1.008 -0.106824 6.870868 23.486068 + 11 C 6.0000 0 12.011 -4.177731 7.671657 27.301593 + 12 H 1.0000 0 1.008 -5.051667 8.491435 29.004979 + 13 H 1.0000 0 1.008 -3.846984 5.652963 27.724503 + 14 C 6.0000 0 12.011 -5.880091 7.941570 25.056512 + 15 H 1.0000 0 1.008 -5.155120 6.897009 23.406772 + 16 H 1.0000 0 1.008 -7.835608 7.308255 25.389000 + 17 C 6.0000 0 12.011 -7.455259 12.838293 26.551624 + 18 H 1.0000 0 1.008 -7.312554 14.838300 25.994740 + 19 H 1.0000 0 1.008 -6.312386 12.636493 28.279829 + 20 C 6.0000 0 12.011 -10.145828 12.000564 26.931887 + 21 H 1.0000 0 1.008 -10.283994 10.040187 27.627707 + 22 H 1.0000 0 1.008 -11.068874 13.218154 28.350667 + 23 H 1.0000 0 1.008 -11.246656 12.135426 25.167446 + 24 I 25.0000* 0 126.900 -2.217399 16.728033 24.259469 + 25 H 1.0000 0 1.008 -1.791935 12.288466 29.518924 +* core charge reduced due to ECP + +-------------------------------- +INTERNAL COORDINATES (ANGSTROEM) +-------------------------------- + I 0 0 0 0.000000000000 0.00000000 0.00000000 + Co 1 0 0 2.600411979138 0.00000000 0.00000000 + S 2 1 0 2.245816539590 90.43436493 0.00000000 + C 2 1 3 2.055369120641 126.85031825 84.63446110 + C 4 2 1 1.437487668639 69.94033924 155.47260946 + C 5 4 2 1.422235135542 107.31471311 299.46230456 + H 6 5 4 1.088993159900 125.58064864 176.85958975 + C 6 5 4 1.412173530733 108.62393121 0.61575623 + H 8 6 5 1.088880415239 125.86917535 176.91885019 + C 8 6 5 1.404976315139 108.16280096 359.24702488 + H 10 8 6 1.089880078632 125.45620160 177.69944031 + C 4 2 1 1.511615727249 117.91911146 276.04037328 + H 12 4 2 1.102077332768 109.10482655 262.98623117 + H 12 4 2 1.105381747642 110.44181230 146.45040646 + C 12 4 2 1.497793377219 109.52245072 24.70321870 + H 15 12 4 1.102205630376 111.78265398 67.53695920 + H 15 12 4 1.101868806050 114.15390712 189.82992431 + C 3 2 1 1.821295501326 109.60631772 208.81493935 + H 18 3 2 1.101211386846 102.43109761 72.67552063 + H 18 3 2 1.101600916029 109.35350968 320.41606526 + C 18 3 2 1.504721127227 113.36450006 194.23408168 + H 21 18 3 1.103221429138 112.60478975 68.61552106 + H 21 18 3 1.103366419582 109.74536463 187.71143430 + H 21 18 3 1.102831458950 111.56267372 307.03086800 + I 2 1 3 2.575513406769 96.25077204 267.10571083 + H 5 4 2 1.089452324441 126.46925263 118.18331544 + +--------------------------- +INTERNAL COORDINATES (A.U.) +--------------------------- + I 0 0 0 0.000000000000 0.00000000 0.00000000 + Co 1 0 0 4.914066475939 0.00000000 0.00000000 + S 2 1 0 4.243978206857 90.43436493 0.00000000 + C 2 1 3 3.884084742131 126.85031825 84.63446110 + C 4 2 1 2.716458014617 69.94033924 155.47260946 + C 5 4 2 2.687634904215 107.31471311 299.46230456 + H 6 5 4 2.057898833925 125.58064864 176.85958975 + C 6 5 4 2.668621226659 108.62393121 0.61575623 + H 8 6 5 2.057685777392 125.86917535 176.91885019 + C 8 6 5 2.655020460259 108.16280096 359.24702488 + H 10 8 6 2.059574867430 125.45620160 177.69944031 + C 4 2 1 2.856539744228 117.91911146 276.04037328 + H 12 4 2 2.082624337335 109.10482655 262.98623117 + H 12 4 2 2.088868776479 110.44181230 146.45040646 + C 12 4 2 2.830419288144 109.52245072 24.70321870 + H 15 12 4 2.082866784677 111.78265398 67.53695920 + H 15 12 4 2.082230278945 114.15390712 189.82992431 + C 3 2 1 3.441749706449 109.60631772 208.81493935 + H 18 3 2 2.080987936695 102.43109761 72.67552063 + H 18 3 2 2.081724040173 109.35350968 320.41606526 + C 18 3 2 2.843510838383 113.36450006 194.23408168 + H 21 18 3 2.084786366144 112.60478975 68.61552106 + H 21 18 3 2.085060358376 109.74536463 187.71143430 + H 21 18 3 2.084049429288 111.56267372 307.03086800 + I 2 1 3 4.867014993036 96.25077204 267.10571083 + H 5 4 2 2.058766529158 126.46925263 118.18331544 + +--------------------- +BASIS SET INFORMATION +--------------------- +There are 5 groups of distinct atoms + + Group 1 Type I : 11s10p8d2f contracted to 6s5p3d2f pattern {521111/34111/611/11} + Group 2 Type Co : 17s11p7d1f contracted to 6s4p4d1f pattern {842111/6311/4111/1} + Group 3 Type S : 14s9p3d1f contracted to 5s5p2d1f pattern {73211/51111/21/1} + Group 4 Type C : 11s6p2d1f contracted to 5s3p2d1f pattern {62111/411/11/1} + Group 5 Type H : 5s1p contracted to 3s1p pattern {311/1} + +Atom 0I basis set group => 1 +Atom 1Co basis set group => 2 +Atom 2S basis set group => 3 +Atom 3C basis set group => 4 +Atom 4C basis set group => 4 +Atom 5C basis set group => 4 +Atom 6H basis set group => 5 +Atom 7C basis set group => 4 +Atom 8H basis set group => 5 +Atom 9C basis set group => 4 +Atom 10H basis set group => 5 +Atom 11C basis set group => 4 +Atom 12H basis set group => 5 +Atom 13H basis set group => 5 +Atom 14C basis set group => 4 +Atom 15H basis set group => 5 +Atom 16H basis set group => 5 +Atom 17C basis set group => 4 +Atom 18H basis set group => 5 +Atom 19H basis set group => 5 +Atom 20C basis set group => 4 +Atom 21H basis set group => 5 +Atom 22H basis set group => 5 +Atom 23H basis set group => 5 +Atom 24I basis set group => 1 +Atom 25H basis set group => 5 +--------------------------------- +AUXILIARY/J BASIS SET INFORMATION +--------------------------------- +There are 5 groups of distinct atoms + + Group 1 Type I : 11s5p5d3f1g contracted to 8s4p3d2f1g pattern {41111111/2111/311/21/1} + Group 2 Type Co : 19s5p5d3f3g contracted to 8s5p5d2f3g pattern {121111111/11111/11111/21/111} + Group 3 Type S : 14s5p5d2f1g contracted to 8s4p3d1f1g pattern {71111111/2111/311/2/1} + Group 4 Type C : 12s5p4d2f1g contracted to 6s4p3d1f1g pattern {711111/2111/211/2/1} + Group 5 Type H : 5s2p1d contracted to 3s1p1d pattern {311/2/1} + +Atom 0I basis set group => 1 +Atom 1Co basis set group => 2 +Atom 2S basis set group => 3 +Atom 3C basis set group => 4 +Atom 4C basis set group => 4 +Atom 5C basis set group => 4 +Atom 6H basis set group => 5 +Atom 7C basis set group => 4 +Atom 8H basis set group => 5 +Atom 9C basis set group => 4 +Atom 10H basis set group => 5 +Atom 11C basis set group => 4 +Atom 12H basis set group => 5 +Atom 13H basis set group => 5 +Atom 14C basis set group => 4 +Atom 15H basis set group => 5 +Atom 16H basis set group => 5 +Atom 17C basis set group => 4 +Atom 18H basis set group => 5 +Atom 19H basis set group => 5 +Atom 20C basis set group => 4 +Atom 21H basis set group => 5 +Atom 22H basis set group => 5 +Atom 23H basis set group => 5 +Atom 24I basis set group => 1 +Atom 25H basis set group => 5 +------------------------- +ECP PARAMETER INFORMATION +------------------------- + + Group 1, Type I ECP Def2-ECP (replacing 28 core electrons, lmax=3) + +Atom 0I ECP group => 1 +Atom 24I ECP group => 1 + + + + ************************************************************ + * Program running with 64 parallel MPI-processes * + * working on a common directory * + ************************************************************ +------------------------------------------------------------------------------ + ORCA GTO INTEGRAL CALCULATION + -- RI-GTO INTEGRALS CHOSEN -- +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ + ___ + / \ - P O W E R E D B Y - + / \ + | | | _ _ __ _____ __ __ + | | | | | | | / \ | _ \ | | / | + \ \/ | | | | / \ | | | | | | / / + / \ \ | |__| | / /\ \ | |_| | | |/ / + | | | | __ | / /__\ \ | / | \ + | | | | | | | | __ | | \ | |\ \ + \ / | | | | | | | | | |\ \ | | \ \ + \___/ |_| |_| |__| |__| |_| \__\ |__| \__/ + + - O R C A' S B I G F R I E N D - + & + - I N T E G R A L F E E D E R - + + v1 FN, 2020, v2 2021 +------------------------------------------------------------------------------ + + +Reading SHARK input file CEHZOF_1_SPE.SHARKINP.tmp ... ok +---------------------- +SHARK INTEGRAL PACKAGE +---------------------- + +Number of atoms ... 26 +Number of basis functions ... 539 +Number of shells ... 211 +Maximum angular momentum ... 3 +Integral batch strategy ... SHARK/LIBINT Hybrid +RI-J (if used) integral strategy ... SPLIT-RIJ (Revised 2003 algorithm where possible) +Printlevel ... 1 +Contraction scheme used ... SEGMENTED contraction +Coulomb Range Separation ... NOT USED +Exchange Range Separation ... NOT USED +Finite Nucleus Model ... NOT USED +Auxiliary Coulomb fitting basis ... AVAILABLE + # of basis functions in Aux-J ... 840 + # of shells in Aux-J ... 276 + Maximum angular momentum in Aux-J ... 4 +Auxiliary J/K fitting basis ... NOT available +Auxiliary Correlation fitting basis ... NOT available +Auxiliary 'external' fitting basis ... NOT available +Integral threshold ... 1.000000e-10 +Primitive cut-off ... 1.000000e-11 +Primitive pair pre-selection threshold ... 1.000000e-11 + +Calculating pre-screening integrals ... done ( 0.1 sec) Dimension = 211 +Organizing shell pair data ... done ( 0.2 sec) +Shell pair information +Total number of shell pairs ... 22366 +Shell pairs after pre-screening ... 18481 +Total number of primitive shell pairs ... 73938 +Primitive shell pairs kept ... 41394 + la=0 lb=0: 4533 shell pairs + la=1 lb=0: 5205 shell pairs + la=1 lb=1: 1528 shell pairs + la=2 lb=0: 2716 shell pairs + la=2 lb=1: 1563 shell pairs + la=2 lb=2: 429 shell pairs + la=3 lb=0: 1253 shell pairs + la=3 lb=1: 750 shell pairs + la=3 lb=2: 403 shell pairs + la=3 lb=3: 101 shell pairs + +Calculating one electron integrals ... done ( 0.0 sec) +Calculating ECP integrals ... done ( 1.2 sec) +Calculating RI/J V-Matrix + Cholesky decomp.... done ( 0.1 sec) +Calculating Nuclear repulsion ... done ( 0.0 sec) ENN= 1955.401286676237 Eh + +SHARK setup successfully completed in 1.8 seconds + +Maximum memory used throughout the entire GTOINT-calculation: 35.3 MB + + + ************************************************************ + * Program running with 64 parallel MPI-processes * + * working on a common directory * + ************************************************************ +------------------------------------------------------------------------------- + ORCA SCF +------------------------------------------------------------------------------- + +------------ +SCF SETTINGS +------------ +Hamiltonian: + Density Functional Method .... DFT(GTOs) + Exchange Functional Exchange .... TPSS + Correlation Functional Correlation .... TPSS + LDA part of GGA corr. LDAOpt .... PW91-LDA + Gradients option PostSCFGGA .... off + Hybrid DFT is turned on + Fraction HF Exchange ScalHFX .... 0.100000 + Scaling of DF-GGA-X ScalDFX .... 0.900000 + Scaling of DF-GGA-C ScalDFC .... 1.000000 + Scaling of DF-LDA-C ScalLDAC .... 1.000000 + Perturbative correction .... 0.000000 + Density functional embedding theory .... OFF + NL short-range parameter .... 5.200000 + RI-approximation to the Coulomb term is turned on + Number of AuxJ basis functions .... 840 + RIJ-COSX (HFX calculated with COS-X)).... on + + +General Settings: + Integral files IntName .... CEHZOF_1_SPE + Hartree-Fock type HFTyp .... RHF + Total Charge Charge .... 0 + Multiplicity Mult .... 1 + Number of Electrons NEL .... 160 + Basis Dimension Dim .... 539 + Nuclear Repulsion ENuc .... 1955.4012866762 Eh + +Convergence Acceleration: + DIIS CNVDIIS .... on + Start iteration DIISMaxIt .... 0 + Startup error DIISStart .... 0.200000 + # of expansion vecs DIISMaxEq .... 5 + Bias factor DIISBfac .... 1.050 + Max. coefficient DIISMaxC .... 10.000 + Trust-Rad. Augm. Hess. CNVTRAH .... auto + Auto Start mean grad. ratio tolernc. .... 1.125000 + Auto Start start iteration .... 20 + Auto Start num. interpolation iter. .... 10 + Max. Number of Micro iterations .... 16 + Max. Number of Macro iterations .... Maxiter - #DIIS iter + Number of Davidson start vectors .... 2 + Converg. threshold I (grad. norm) .... 5.000e-05 + Converg. threshold II (energy diff.) .... 1.000e-06 + Grad. Scal. Fac. for Micro threshold .... 0.100 + Minimum threshold for Micro iter. .... 0.010 + NR start threshold (gradient norm) .... 0.001 + Initial trust radius .... 0.400 + Minimum AH scaling param. (alpha) .... 1.000 + Maximum AH scaling param. (alpha) .... 1000.000 + Orbital update algorithm .... Taylor + White noise on init. David. guess .... on + Maximum white noise .... 0.010 + Quad. conv. algorithm .... NR + SOSCF CNVSOSCF .... off + Level Shifting CNVShift .... on + Level shift para. LevelShift .... 0.2500 + Turn off err/grad. ShiftErr .... 0.0000 + Zerner damping CNVZerner .... off + Static damping CNVDamp .... on + Fraction old density DampFac .... 0.8500 + Max. Damping (<1) DampMax .... 0.9800 + Min. Damping (>=0) DampMin .... 0.0000 + Turn off err/grad. DampErr .... 0.0300 + Fernandez-Rico CNVRico .... off + +SCF Procedure: + Maximum # iterations MaxIter .... 1500 + SCF integral mode SCFMode .... Direct + Integral package .... SHARK and LIBINT hybrid scheme + Reset frequency DirectResetFreq .... 20 + Integral Threshold Thresh .... 1.000e-10 Eh + Primitive CutOff TCut .... 1.000e-11 Eh + +Convergence Tolerance: + Convergence Check Mode ConvCheckMode .... Total+1el-Energy + Convergence forced ConvForced .... 0 + Energy Change TolE .... 1.000e-06 Eh + 1-El. energy change .... 1.000e-03 Eh + DIIS Error TolErr .... 1.000e-06 + + +Diagonalization of the overlap matrix: +Smallest eigenvalue ... 2.398e-05 +Time for diagonalization ... 0.048 sec +Threshold for overlap eigenvalues ... 1.000e-08 +Number of eigenvalues below threshold ... 0 +Time for construction of square roots ... 0.074 sec +Total time needed ... 0.126 sec + +Time for model grid setup = 0.186 sec + +------------------------------ +INITIAL GUESS: MODEL POTENTIAL +------------------------------ +Loading Hartree-Fock densities ... done + calling /store/marvel/mr31/rlaplaza/orca_5_0_3_linux_x86-64_shared_openmpi411/orca CEHZOF_1_SPE_atom53.inp > CEHZOF_1_SPE_atom53.out in order to generate an atomic fitting density for atom 0 (I with ECP) on-the-fly... + atom 0 (I ), assumed electronic state with S=2: 1s2 2s2 2p6 3s2 3p6 4s2 3d10 4p6 5s2 4d10 5p5 ... done +Calculating cut-offs ... done +Initializing the effective Hamiltonian ... done +Setting up the integral package (SHARK) ... done +Starting the Coulomb interaction ... done ( 0.1 sec) +Reading the grid ... done +Mapping shells ... done +Starting the XC term evaluation ... done ( 0.0 sec) + promolecular density results + # of electrons = 215.994766706 + EX = -479.065010048 + EC = -9.872468688 + EX+EC = -488.937478736 +Transforming the Hamiltonian ... done ( 0.1 sec) +Diagonalizing the Hamiltonian ... done ( 0.0 sec) +Back transforming the eigenvectors ... done ( 0.0 sec) +Now organizing SCF variables ... done + ------------------ + INITIAL GUESS DONE ( 410.9 sec) + ------------------ +------------------- +DFT GRID GENERATION +------------------- + +General Integration Accuracy IntAcc ... 4.388 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 4 (Lebedev-302) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... off +Rotationally invariant grid construction ... off + +Total number of grid points ... 134824 +Total number of batches ... 2120 +Average number of points per batch ... 63 +Average number of grid points per atom ... 5186 +Time for grid setup = 0.710 sec + +-------------------- +COSX GRID GENERATION +-------------------- + +GRIDX 1 +------- +General Integration Accuracy IntAcc ... 3.816 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 1 (Lebedev-50) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... on +Rotationally invariant grid construction ... off + +Total number of grid points ... 16404 +Total number of batches ... 270 +Average number of points per batch ... 60 +Average number of grid points per atom ... 631 +UseSFitting ... on + +GRIDX 2 +------- +General Integration Accuracy IntAcc ... 4.020 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 2 (Lebedev-110) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... on +Rotationally invariant grid construction ... off + +Total number of grid points ... 35487 +Total number of batches ... 567 +Average number of points per batch ... 62 +Average number of grid points per atom ... 1365 +UseSFitting ... on + +GRIDX 3 +------- +General Integration Accuracy IntAcc ... 4.338 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 3 (Lebedev-194) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... on +Rotationally invariant grid construction ... off + +Total number of grid points ... 76483 +Total number of batches ... 1208 +Average number of points per batch ... 63 +Average number of grid points per atom ... 2942 +UseSFitting ... on + +Time for X-Grid setup = 0.747 sec + +-------------- +SCF ITERATIONS +-------------- +ITER Energy Delta-E Max-DP RMS-DP [F,P] Damp + *** Starting incremental Fock matrix formation *** + 0 -2726.9314706590 0.000000000000 0.04803527 0.00052116 0.5764532 0.8500 + 1 -2727.0355041492 -0.104033490240 0.04043918 0.00049979 0.4817347 0.8500 + ***Turning on DIIS*** + 2 -2727.1013709425 -0.065866793318 0.03179017 0.00038984 0.4019278 0.8500 + 3 -2727.1439637023 -0.042592759792 0.01934970 0.00025559 0.3358518 0.8500 + 4 -2727.1756880783 -0.031724375999 0.01240033 0.00019764 0.2838091 0.8500 + 5 -2727.1994791329 -0.023791054567 0.01031932 0.00015559 0.2409349 0.8500 + 6 -2727.2191021747 -0.019623041755 0.00947220 0.00012640 0.2048477 0.8500 + 7 -2727.2357528384 -0.016650663697 0.00882554 0.00010676 0.1742407 0.8500 + 8 -2727.2501406564 -0.014387818062 0.00718225 0.00009135 0.1481058 0.8500 + 9 -2727.2622649286 -0.012124272157 0.00603488 0.00007919 0.1258027 0.8500 + 10 -2727.2723240665 -0.010059137902 0.00466509 0.00006752 0.1068453 0.8500 + 11 -2727.2807759730 -0.008451906562 0.00414315 0.00005681 0.0907605 0.8500 + 12 -2727.2878941843 -0.007118211281 0.00364708 0.00004742 0.0771230 0.8500 + 13 -2727.2939155469 -0.006021362535 0.00303783 0.00003984 0.0655453 0.8500 + 14 -2727.2990146963 -0.005099149416 0.00259839 0.00003406 0.0556986 0.8500 + 15 -2727.3033216969 -0.004307000668 0.00208192 0.00002923 0.0473238 0.8500 + 16 -2727.3069682148 -0.003646517897 0.00176892 0.00002498 0.0402046 0.8500 + 17 -2727.3100553321 -0.003087117241 0.00144702 0.00002113 0.0341596 0.8500 + 18 -2727.3126727178 -0.002617385731 0.00779391 0.00011898 0.0290266 0.0000 + 19 -2727.3273861454 -0.014713427548 0.00231744 0.00002327 0.0016432 0.0000 + *** Restarting incremental Fock matrix formation *** + *** Resetting DIIS *** + 20 -2727.3274517598 -0.000065614411 0.00704019 0.00007566 0.0065307 0.0000 + 21 -2727.3266850879 0.000766671901 0.00312708 0.00002843 0.0273081 0.0000 + 22 -2727.3273236929 -0.000638605070 0.00137680 0.00001251 0.0113812 0.0000 + 23 -2727.3274540049 -0.000130311951 0.00095028 0.00000850 0.0055646 0.0000 + 24 -2727.3274917306 -0.000037725740 0.00067883 0.00000519 0.0019785 0.0000 + 25 -2727.3274972016 -0.000005470982 0.00033756 0.00000284 0.0004636 0.0000 + *** Restarting incremental Fock matrix formation *** + *** Resetting DIIS *** + 26 -2727.3273923479 0.000104853735 0.00435152 0.00004529 0.0002458 0.0000 + 27 -2727.3273936155 -0.000001267590 0.00053863 0.00000658 0.0005926 0.0000 + 28 -2727.3273934524 0.000000163071 0.00018429 0.00000204 0.0007213 0.0000 + 29 -2727.3273941289 -0.000000676500 0.00024512 0.00000166 0.0002753 0.0000 + 30 -2727.3273941654 -0.000000036554 0.00022370 0.00000125 0.0000630 0.0000 + **** Energy Check signals convergence **** + + ***************************************************** + * SUCCESS * + * SCF CONVERGED AFTER 31 CYCLES * + ***************************************************** + +Old exchange energy = -17.645107139 Eh +New exchange energy = -17.645096264 Eh +Exchange energy change after final integration = 0.000010875 Eh +Total energy after final integration = -2727.327383429 Eh +Final COS-X integration done in = 1.403 sec + +---------------- +TOTAL SCF ENERGY +---------------- + +Total Energy : -2727.32738343 Eh -74214.35109 eV + +Components: +Nuclear Repulsion : 1955.40128668 Eh 53209.17411 eV +Electronic Energy : -4682.72867011 Eh -127423.52520 eV +One Electron Energy: -7874.35439008 Eh -214272.07634 eV +Two Electron Energy: 3191.62571997 Eh 86848.55114 eV +Max COSX asymmetry : 0.00000256 Eh 0.00007 eV + +Virial components: +Potential Energy : -5081.40226010 Eh -138271.98511 eV +Kinetic Energy : 2354.07487667 Eh 64057.63402 eV +Virial Ratio : 2.15855592 + + +DFT components: +N(Alpha) : 79.999925114347 electrons +N(Beta) : 79.999925114347 electrons +N(Total) : 159.999850228694 electrons +E(X) : -159.198063452424 Eh +E(C) : -6.430943327837 Eh +E(XC) : -165.629006780262 Eh +DFET-embed. en. : 0.000000000000 Eh + +--------------- +SCF CONVERGENCE +--------------- + + Last Energy change ... -1.3933e-07 Tolerance : 1.0000e-06 + Last MAX-Density change ... 0.0000e+00 Tolerance : 1.0000e-05 + Last RMS-Density change ... 0.0000e+00 Tolerance : 1.0000e-06 + Last DIIS Error ... 8.7695e-06 Tolerance : 1.0000e-06 + + **** THE GBW FILE WAS UPDATED (CEHZOF_1_SPE.gbw) **** + **** DENSITY CEHZOF_1_SPE.scfp WAS UPDATED **** + **** ENERGY FILE WAS UPDATED (CEHZOF_1_SPE.en.tmp) **** + **** THE GBW FILE WAS UPDATED (CEHZOF_1_SPE.gbw) **** + **** DENSITY CEHZOF_1_SPE.scfp WAS UPDATED **** +---------------- +ORBITAL ENERGIES +---------------- + + NO OCC E(Eh) E(eV) + 0 2.0000 -277.322254 -7546.3222 + 1 2.0000 -88.767022 -2415.4735 + 2 2.0000 -32.714836 -890.2159 + 3 2.0000 -28.343124 -771.2556 + 4 2.0000 -28.329376 -770.8815 + 5 2.0000 -28.327195 -770.8222 + 6 2.0000 -10.180294 -277.0199 + 7 2.0000 -10.178061 -276.9591 + 8 2.0000 -10.165220 -276.6097 + 9 2.0000 -10.164098 -276.5792 + 10 2.0000 -10.163699 -276.5683 + 11 2.0000 -10.162659 -276.5400 + 12 2.0000 -10.161120 -276.4981 + 13 2.0000 -10.159793 -276.4620 + 14 2.0000 -10.137903 -275.8664 + 15 2.0000 -7.910851 -215.2652 + 16 2.0000 -6.705151 -182.4564 + 17 2.0000 -6.702301 -182.3789 + 18 2.0000 -5.860819 -159.4810 + 19 2.0000 -5.857909 -159.4018 + 20 2.0000 -5.852921 -159.2661 + 21 2.0000 -4.740251 -128.9888 + 22 2.0000 -4.737650 -128.9180 + 23 2.0000 -4.732250 -128.7711 + 24 2.0000 -4.731720 -128.7566 + 25 2.0000 -4.729314 -128.6912 + 26 2.0000 -4.728685 -128.6741 + 27 2.0000 -3.698559 -100.6429 + 28 2.0000 -2.398853 -65.2761 + 29 2.0000 -2.371922 -64.5433 + 30 2.0000 -2.367686 -64.4280 + 31 2.0000 -1.813080 -49.3364 + 32 2.0000 -1.811263 -49.2870 + 33 2.0000 -1.810801 -49.2744 + 34 2.0000 -1.810384 -49.2631 + 35 2.0000 -1.808472 -49.2110 + 36 2.0000 -1.808039 -49.1992 + 37 2.0000 -1.803991 -49.0891 + 38 2.0000 -1.803954 -49.0881 + 39 2.0000 -1.800902 -49.0050 + 40 2.0000 -1.800872 -49.0042 + 41 2.0000 -0.914510 -24.8851 + 42 2.0000 -0.845312 -23.0021 + 43 2.0000 -0.794614 -21.6226 + 44 2.0000 -0.739357 -20.1189 + 45 2.0000 -0.734588 -19.9892 + 46 2.0000 -0.700998 -19.0751 + 47 2.0000 -0.647458 -17.6182 + 48 2.0000 -0.617584 -16.8053 + 49 2.0000 -0.607693 -16.5362 + 50 2.0000 -0.591462 -16.0945 + 51 2.0000 -0.568214 -15.4619 + 52 2.0000 -0.555836 -15.1251 + 53 2.0000 -0.528861 -14.3910 + 54 2.0000 -0.490192 -13.3388 + 55 2.0000 -0.481293 -13.0966 + 56 2.0000 -0.454863 -12.3774 + 57 2.0000 -0.442251 -12.0343 + 58 2.0000 -0.429864 -11.6972 + 59 2.0000 -0.424077 -11.5397 + 60 2.0000 -0.416252 -11.3268 + 61 2.0000 -0.410419 -11.1681 + 62 2.0000 -0.403125 -10.9696 + 63 2.0000 -0.389479 -10.5983 + 64 2.0000 -0.382812 -10.4168 + 65 2.0000 -0.371017 -10.0959 + 66 2.0000 -0.351148 -9.5552 + 67 2.0000 -0.346703 -9.4343 + 68 2.0000 -0.308895 -8.4055 + 69 2.0000 -0.303753 -8.2655 + 70 2.0000 -0.297837 -8.1046 + 71 2.0000 -0.278152 -7.5689 + 72 2.0000 -0.267277 -7.2730 + 73 2.0000 -0.265663 -7.2291 + 74 2.0000 -0.256570 -6.9816 + 75 2.0000 -0.245437 -6.6787 + 76 2.0000 -0.208473 -5.6728 + 77 2.0000 -0.203982 -5.5506 + 78 2.0000 -0.198704 -5.4070 + 79 2.0000 -0.193702 -5.2709 + 80 0.0000 -0.109033 -2.9669 + 81 0.0000 -0.107357 -2.9213 + 82 0.0000 -0.007186 -0.1955 + 83 0.0000 -0.005298 -0.1442 + 84 0.0000 0.006365 0.1732 + 85 0.0000 0.008275 0.2252 + 86 0.0000 0.029936 0.8146 + 87 0.0000 0.033275 0.9054 + 88 0.0000 0.038465 1.0467 + 89 0.0000 0.045921 1.2496 + 90 0.0000 0.060420 1.6441 + 91 0.0000 0.071799 1.9538 + 92 0.0000 0.078702 2.1416 + 93 0.0000 0.082460 2.2438 + 94 0.0000 0.083009 2.2588 + 95 0.0000 0.091620 2.4931 + 96 0.0000 0.095625 2.6021 + 97 0.0000 0.102926 2.8008 + 98 0.0000 0.109441 2.9780 + 99 0.0000 0.118957 3.2370 + 100 0.0000 0.123266 3.3542 + 101 0.0000 0.125651 3.4191 + 102 0.0000 0.128827 3.5056 + 103 0.0000 0.137928 3.7532 + 104 0.0000 0.144242 3.9250 + 105 0.0000 0.148439 4.0392 + 106 0.0000 0.155897 4.2422 + 107 0.0000 0.164590 4.4787 + 108 0.0000 0.166531 4.5315 + 109 0.0000 0.173826 4.7300 + 110 0.0000 0.175984 4.7888 + 111 0.0000 0.181940 4.9508 + 112 0.0000 0.187943 5.1142 + 113 0.0000 0.194778 5.3002 + 114 0.0000 0.196240 5.3400 + 115 0.0000 0.204201 5.5566 + 116 0.0000 0.210459 5.7269 + 117 0.0000 0.214235 5.8296 + 118 0.0000 0.217443 5.9169 + 119 0.0000 0.220178 5.9913 + 120 0.0000 0.226598 6.1660 + 121 0.0000 0.228911 6.2290 + 122 0.0000 0.233823 6.3627 + 123 0.0000 0.238575 6.4920 + 124 0.0000 0.249101 6.7784 + 125 0.0000 0.257326 7.0022 + 126 0.0000 0.275272 7.4905 + 127 0.0000 0.279208 7.5976 + 128 0.0000 0.285358 7.7650 + 129 0.0000 0.289476 7.8770 + 130 0.0000 0.294677 8.0186 + 131 0.0000 0.303783 8.2663 + 132 0.0000 0.308584 8.3970 + 133 0.0000 0.318014 8.6536 + 134 0.0000 0.322153 8.7662 + 135 0.0000 0.326493 8.8843 + 136 0.0000 0.344740 9.3808 + 137 0.0000 0.346838 9.4379 + 138 0.0000 0.354676 9.6512 + 139 0.0000 0.361881 9.8473 + 140 0.0000 0.369559 10.0562 + 141 0.0000 0.370315 10.0768 + 142 0.0000 0.378470 10.2987 + 143 0.0000 0.382132 10.3983 + 144 0.0000 0.387165 10.5353 + 145 0.0000 0.394925 10.7464 + 146 0.0000 0.401484 10.9249 + 147 0.0000 0.402873 10.9627 + 148 0.0000 0.409900 11.1539 + 149 0.0000 0.411722 11.2035 + 150 0.0000 0.420371 11.4389 + 151 0.0000 0.422704 11.5023 + 152 0.0000 0.430571 11.7164 + 153 0.0000 0.436321 11.8729 + 154 0.0000 0.439013 11.9462 + 155 0.0000 0.448811 12.2128 + 156 0.0000 0.450902 12.2697 + 157 0.0000 0.461927 12.5697 + 158 0.0000 0.462754 12.5922 + 159 0.0000 0.471611 12.8332 + 160 0.0000 0.483552 13.1581 + 161 0.0000 0.486661 13.2427 + 162 0.0000 0.492473 13.4009 + 163 0.0000 0.493895 13.4396 + 164 0.0000 0.504458 13.7270 + 165 0.0000 0.510220 13.8838 + 166 0.0000 0.519586 14.1387 + 167 0.0000 0.526139 14.3170 + 168 0.0000 0.528420 14.3790 + 169 0.0000 0.541727 14.7411 + 170 0.0000 0.548611 14.9285 + 171 0.0000 0.558598 15.2002 + 172 0.0000 0.564787 15.3686 + 173 0.0000 0.567893 15.4532 + 174 0.0000 0.570658 15.5284 + 175 0.0000 0.578993 15.7552 + 176 0.0000 0.584235 15.8979 + 177 0.0000 0.595794 16.2124 + 178 0.0000 0.607372 16.5274 + 179 0.0000 0.613898 16.7050 + 180 0.0000 0.632089 17.2000 + 181 0.0000 0.639302 17.3963 + 182 0.0000 0.648628 17.6501 + 183 0.0000 0.667688 18.1687 + 184 0.0000 0.676218 18.4008 + 185 0.0000 0.695841 18.9348 + 186 0.0000 0.707873 19.2622 + 187 0.0000 0.718281 19.5454 + 188 0.0000 0.726222 19.7615 + 189 0.0000 0.744045 20.2465 + 190 0.0000 0.751762 20.4565 + 191 0.0000 0.759955 20.6794 + 192 0.0000 0.767692 20.8899 + 193 0.0000 0.788487 21.4558 + 194 0.0000 0.794810 21.6279 + 195 0.0000 0.808862 22.0102 + 196 0.0000 0.820913 22.3382 + 197 0.0000 0.830176 22.5902 + 198 0.0000 0.841314 22.8933 + 199 0.0000 0.848874 23.0990 + 200 0.0000 0.856957 23.3190 + 201 0.0000 0.872108 23.7313 + 202 0.0000 0.873053 23.7570 + 203 0.0000 0.888972 24.1902 + 204 0.0000 0.892594 24.2887 + 205 0.0000 0.901550 24.5324 + 206 0.0000 0.904087 24.6014 + 207 0.0000 0.918284 24.9878 + 208 0.0000 0.922171 25.0936 + 209 0.0000 0.925896 25.1949 + 210 0.0000 0.930713 25.3260 + 211 0.0000 0.932775 25.3821 + 212 0.0000 0.940719 25.5983 + 213 0.0000 0.945146 25.7187 + 214 0.0000 0.956251 26.0209 + 215 0.0000 0.959667 26.1139 + 216 0.0000 0.966535 26.3008 + 217 0.0000 0.971295 26.4303 + 218 0.0000 0.986763 26.8512 + 219 0.0000 0.992147 26.9977 + 220 0.0000 1.005352 27.3570 + 221 0.0000 1.012306 27.5463 + 222 0.0000 1.017564 27.6893 + 223 0.0000 1.022813 27.8322 + 224 0.0000 1.029697 28.0195 + 225 0.0000 1.040735 28.3198 + 226 0.0000 1.044921 28.4337 + 227 0.0000 1.058009 28.7899 + 228 0.0000 1.067087 29.0369 + 229 0.0000 1.073039 29.1989 + 230 0.0000 1.083469 29.4827 + 231 0.0000 1.103114 30.0173 + 232 0.0000 1.119857 30.4729 + 233 0.0000 1.135793 30.9065 + 234 0.0000 1.140573 31.0366 + 235 0.0000 1.147214 31.2173 + 236 0.0000 1.167784 31.7770 + 237 0.0000 1.176507 32.0144 + 238 0.0000 1.178647 32.0726 + 239 0.0000 1.189860 32.3777 + 240 0.0000 1.204648 32.7801 + 241 0.0000 1.206066 32.8187 + 242 0.0000 1.221791 33.2466 + 243 0.0000 1.227625 33.4054 + 244 0.0000 1.243976 33.8503 + 245 0.0000 1.249836 34.0098 + 246 0.0000 1.264328 34.4041 + 247 0.0000 1.287737 35.0411 + 248 0.0000 1.291819 35.1522 + 249 0.0000 1.308940 35.6181 + 250 0.0000 1.324302 36.0361 + 251 0.0000 1.335798 36.3489 + 252 0.0000 1.349961 36.7343 + 253 0.0000 1.369218 37.2583 + 254 0.0000 1.377920 37.4951 + 255 0.0000 1.387209 37.7479 + 256 0.0000 1.406527 38.2735 + 257 0.0000 1.419940 38.6385 + 258 0.0000 1.431218 38.9454 + 259 0.0000 1.440716 39.2039 + 260 0.0000 1.453640 39.5556 + 261 0.0000 1.456746 39.6401 + 262 0.0000 1.469764 39.9943 + 263 0.0000 1.477963 40.2174 + 264 0.0000 1.487812 40.4854 + 265 0.0000 1.490290 40.5529 + 266 0.0000 1.505032 40.9540 + 267 0.0000 1.512353 41.1532 + 268 0.0000 1.520414 41.3726 + 269 0.0000 1.525472 41.5102 + 270 0.0000 1.533730 41.7349 + 271 0.0000 1.537562 41.8392 + 272 0.0000 1.542003 41.9600 + 273 0.0000 1.553024 42.2599 + 274 0.0000 1.560647 42.4674 + 275 0.0000 1.570312 42.7304 + 276 0.0000 1.576343 42.8945 + 277 0.0000 1.583852 43.0988 + 278 0.0000 1.589931 43.2642 + 279 0.0000 1.593744 43.3680 + 280 0.0000 1.606443 43.7135 + 281 0.0000 1.615489 43.9597 + 282 0.0000 1.621709 44.1290 + 283 0.0000 1.636816 44.5400 + 284 0.0000 1.646652 44.8077 + 285 0.0000 1.653022 44.9810 + 286 0.0000 1.668434 45.4004 + 287 0.0000 1.671531 45.4847 + 288 0.0000 1.678354 45.6703 + 289 0.0000 1.682935 45.7950 + 290 0.0000 1.693558 46.0840 + 291 0.0000 1.710778 46.5526 + 292 0.0000 1.718299 46.7573 + 293 0.0000 1.729049 47.0498 + 294 0.0000 1.742663 47.4203 + 295 0.0000 1.747655 47.5561 + 296 0.0000 1.764771 48.0219 + 297 0.0000 1.778153 48.3860 + 298 0.0000 1.794780 48.8385 + 299 0.0000 1.815896 49.4131 + 300 0.0000 1.822029 49.5799 + 301 0.0000 1.834825 49.9281 + 302 0.0000 1.843418 50.1620 + 303 0.0000 1.856755 50.5249 + 304 0.0000 1.866056 50.7780 + 305 0.0000 1.872188 50.9448 + 306 0.0000 1.888596 51.3913 + 307 0.0000 1.903946 51.8090 + 308 0.0000 1.919436 52.2305 + 309 0.0000 1.937691 52.7272 + 310 0.0000 1.952023 53.1172 + 311 0.0000 1.964773 53.4642 + 312 0.0000 1.981091 53.9082 + 313 0.0000 1.996621 54.3308 + 314 0.0000 2.008721 54.6601 + 315 0.0000 2.031084 55.2686 + 316 0.0000 2.058065 56.0028 + 317 0.0000 2.061608 56.0992 + 318 0.0000 2.067574 56.2616 + 319 0.0000 2.086108 56.7659 + 320 0.0000 2.101334 57.1802 + 321 0.0000 2.121727 57.7351 + 322 0.0000 2.130856 57.9835 + 323 0.0000 2.146018 58.3961 + 324 0.0000 2.163683 58.8768 + 325 0.0000 2.174050 59.1589 + 326 0.0000 2.198566 59.8260 + 327 0.0000 2.228799 60.6487 + 328 0.0000 2.242290 61.0158 + 329 0.0000 2.251552 61.2679 + 330 0.0000 2.270929 61.7951 + 331 0.0000 2.308043 62.8050 + 332 0.0000 2.325301 63.2746 + 333 0.0000 2.334033 63.5123 + 334 0.0000 2.365273 64.3623 + 335 0.0000 2.368442 64.4486 + 336 0.0000 2.373302 64.5808 + 337 0.0000 2.381724 64.8100 + 338 0.0000 2.395986 65.1981 + 339 0.0000 2.415755 65.7360 + 340 0.0000 2.427157 66.0463 + 341 0.0000 2.439364 66.3785 + 342 0.0000 2.452035 66.7233 + 343 0.0000 2.461922 66.9923 + 344 0.0000 2.467398 67.1413 + 345 0.0000 2.480765 67.5051 + 346 0.0000 2.491794 67.8052 + 347 0.0000 2.507461 68.2315 + 348 0.0000 2.515444 68.4487 + 349 0.0000 2.531799 68.8938 + 350 0.0000 2.542783 69.1926 + 351 0.0000 2.556511 69.5662 + 352 0.0000 2.566325 69.8332 + 353 0.0000 2.572200 69.9931 + 354 0.0000 2.582473 70.2727 + 355 0.0000 2.608838 70.9901 + 356 0.0000 2.616164 71.1895 + 357 0.0000 2.620437 71.3057 + 358 0.0000 2.634054 71.6763 + 359 0.0000 2.649002 72.0830 + 360 0.0000 2.654650 72.2367 + 361 0.0000 2.662700 72.4557 + 362 0.0000 2.670728 72.6742 + 363 0.0000 2.683466 73.0208 + 364 0.0000 2.696223 73.3680 + 365 0.0000 2.699820 73.4658 + 366 0.0000 2.711006 73.7702 + 367 0.0000 2.719591 74.0038 + 368 0.0000 2.730450 74.2993 + 369 0.0000 2.753586 74.9289 + 370 0.0000 2.763819 75.2073 + 371 0.0000 2.776983 75.5656 + 372 0.0000 2.787269 75.8454 + 373 0.0000 2.805837 76.3507 + 374 0.0000 2.827634 76.9438 + 375 0.0000 2.843840 77.3848 + 376 0.0000 2.851877 77.6035 + 377 0.0000 2.862419 77.8904 + 378 0.0000 2.879198 78.3470 + 379 0.0000 2.897416 78.8427 + 380 0.0000 2.908155 79.1349 + 381 0.0000 2.924273 79.5735 + 382 0.0000 2.943314 80.0916 + 383 0.0000 2.958521 80.5054 + 384 0.0000 2.973349 80.9090 + 385 0.0000 2.999523 81.6212 + 386 0.0000 3.009048 81.8804 + 387 0.0000 3.034917 82.5843 + 388 0.0000 3.042182 82.7820 + 389 0.0000 3.052162 83.0535 + 390 0.0000 3.068702 83.5036 + 391 0.0000 3.073230 83.6268 + 392 0.0000 3.081407 83.8494 + 393 0.0000 3.085390 83.9577 + 394 0.0000 3.089378 84.0663 + 395 0.0000 3.098383 84.3113 + 396 0.0000 3.101621 84.3994 + 397 0.0000 3.105059 84.4929 + 398 0.0000 3.112687 84.7005 + 399 0.0000 3.123280 84.9888 + 400 0.0000 3.125864 85.0591 + 401 0.0000 3.136950 85.3608 + 402 0.0000 3.142255 85.5051 + 403 0.0000 3.146654 85.6248 + 404 0.0000 3.153968 85.8238 + 405 0.0000 3.169512 86.2468 + 406 0.0000 3.174393 86.3796 + 407 0.0000 3.187331 86.7317 + 408 0.0000 3.193834 86.9086 + 409 0.0000 3.200678 87.0949 + 410 0.0000 3.223250 87.7091 + 411 0.0000 3.227308 87.8195 + 412 0.0000 3.233106 87.9773 + 413 0.0000 3.237526 88.0976 + 414 0.0000 3.242651 88.2370 + 415 0.0000 3.254238 88.5523 + 416 0.0000 3.262644 88.7810 + 417 0.0000 3.273354 89.0725 + 418 0.0000 3.280407 89.2644 + 419 0.0000 3.299118 89.7736 + 420 0.0000 3.302311 89.8605 + 421 0.0000 3.316364 90.2429 + 422 0.0000 3.322095 90.3988 + 423 0.0000 3.332681 90.6869 + 424 0.0000 3.352514 91.2266 + 425 0.0000 3.359505 91.4168 + 426 0.0000 3.371960 91.7557 + 427 0.0000 3.385216 92.1164 + 428 0.0000 3.392140 92.3048 + 429 0.0000 3.401913 92.5708 + 430 0.0000 3.410211 92.7966 + 431 0.0000 3.421934 93.1156 + 432 0.0000 3.431774 93.3833 + 433 0.0000 3.434395 93.4546 + 434 0.0000 3.450938 93.9048 + 435 0.0000 3.472549 94.4929 + 436 0.0000 3.476189 94.5919 + 437 0.0000 3.482580 94.7658 + 438 0.0000 3.487636 94.9034 + 439 0.0000 3.501105 95.2699 + 440 0.0000 3.513175 95.5984 + 441 0.0000 3.519548 95.7718 + 442 0.0000 3.533898 96.1622 + 443 0.0000 3.547759 96.5394 + 444 0.0000 3.572094 97.2016 + 445 0.0000 3.584175 97.5303 + 446 0.0000 3.601574 98.0038 + 447 0.0000 3.647376 99.2502 + 448 0.0000 3.676702 100.0481 + 449 0.0000 3.694447 100.5310 + 450 0.0000 3.714869 101.0867 + 451 0.0000 3.752345 102.1065 + 452 0.0000 3.762411 102.3804 + 453 0.0000 3.793604 103.2292 + 454 0.0000 3.832308 104.2824 + 455 0.0000 3.860618 105.0528 + 456 0.0000 3.868915 105.2785 + 457 0.0000 3.897191 106.0480 + 458 0.0000 3.912144 106.4549 + 459 0.0000 3.945575 107.3646 + 460 0.0000 3.973541 108.1256 + 461 0.0000 3.984884 108.4342 + 462 0.0000 3.995906 108.7341 + 463 0.0000 4.000804 108.8674 + 464 0.0000 4.040584 109.9499 + 465 0.0000 4.058119 110.4270 + 466 0.0000 4.075551 110.9014 + 467 0.0000 4.096547 111.4727 + 468 0.0000 4.123713 112.2119 + 469 0.0000 4.140797 112.6768 + 470 0.0000 4.152935 113.0071 + 471 0.0000 4.166084 113.3649 + 472 0.0000 4.196111 114.1820 + 473 0.0000 4.216007 114.7234 + 474 0.0000 4.218693 114.7965 + 475 0.0000 4.258926 115.8913 + 476 0.0000 4.282540 116.5338 + 477 0.0000 4.293391 116.8291 + 478 0.0000 4.307069 117.2013 + 479 0.0000 4.320080 117.5553 + 480 0.0000 4.352937 118.4494 + 481 0.0000 4.356711 118.5521 + 482 0.0000 4.382164 119.2448 + 483 0.0000 4.408705 119.9670 + 484 0.0000 4.426032 120.4385 + 485 0.0000 4.434741 120.6754 + 486 0.0000 4.457905 121.3057 + 487 0.0000 4.476402 121.8091 + 488 0.0000 4.486918 122.0953 + 489 0.0000 4.505483 122.6004 + 490 0.0000 4.536488 123.4441 + 491 0.0000 4.572466 124.4231 + 492 0.0000 4.581363 124.6652 + 493 0.0000 4.636734 126.1719 + 494 0.0000 4.655318 126.6776 + 495 0.0000 4.699734 127.8863 + 496 0.0000 4.772779 129.8739 + 497 0.0000 4.786858 130.2570 + 498 0.0000 4.809882 130.8835 + 499 0.0000 4.819650 131.1493 + 500 0.0000 4.853862 132.0803 + 501 0.0000 4.866531 132.4251 + 502 0.0000 4.898774 133.3024 + 503 0.0000 4.918604 133.8420 + 504 0.0000 4.927099 134.0732 + 505 0.0000 4.959547 134.9561 + 506 0.0000 4.982796 135.5888 + 507 0.0000 5.118633 139.2851 + 508 0.0000 5.132677 139.6672 + 509 0.0000 5.138646 139.8297 + 510 0.0000 5.208699 141.7359 + 511 0.0000 5.267288 143.3302 + 512 0.0000 5.333376 145.1285 + 513 0.0000 5.369687 146.1166 + 514 0.0000 5.433415 147.8507 + 515 0.0000 5.465252 148.7171 + 516 0.0000 9.143661 248.8117 + 517 0.0000 9.314038 253.4478 + 518 0.0000 9.439899 256.8727 + 519 0.0000 19.736655 537.0617 + 520 0.0000 22.324468 607.4796 + 521 0.0000 22.405880 609.6950 + 522 0.0000 22.428312 610.3054 + 523 0.0000 22.444657 610.7502 + 524 0.0000 22.556592 613.7961 + 525 0.0000 22.642718 616.1397 + 526 0.0000 22.721879 618.2938 + 527 0.0000 22.821108 620.9939 + 528 0.0000 23.081693 628.0848 + 529 0.0000 34.537112 939.8026 + 530 0.0000 34.561513 940.4666 + 531 0.0000 34.590844 941.2647 + 532 0.0000 34.628637 942.2931 + 533 0.0000 34.774241 946.2552 + 534 0.0000 34.869920 948.8588 + 535 0.0000 42.864343 1166.3981 + 536 0.0000 42.871469 1166.5920 + 537 0.0000 118.220068 3216.9316 + 538 0.0000 118.223144 3217.0153 + + ******************************** + * MULLIKEN POPULATION ANALYSIS * + ******************************** + +----------------------- +MULLIKEN ATOMIC CHARGES +----------------------- + 0 I : -0.291706 + 1 Co: -0.149950 + 2 S : 0.155694 + 3 C : 0.208227 + 4 C : -0.122746 + 5 C : -0.073805 + 6 H : 0.158979 + 7 C : -0.063033 + 8 H : 0.154379 + 9 C : -0.141335 + 10 H : 0.143189 + 11 C : -0.276692 + 12 H : 0.131956 + 13 H : 0.127750 + 14 C : -0.206817 + 15 H : 0.153374 + 16 H : 0.147739 + 17 C : -0.181058 + 18 H : 0.167992 + 19 H : 0.112588 + 20 C : -0.354654 + 21 H : 0.112806 + 22 H : 0.136520 + 23 H : 0.138561 + 24 I : -0.319808 + 25 H : 0.131853 +Sum of atomic charges: -0.0000000 + +-------------------------------- +MULLIKEN REDUCED ORBITAL CHARGES +-------------------------------- + 0 I s : 3.963233 s : 3.963233 + pz : 3.390695 p : 11.287630 + px : 3.946649 + py : 3.950286 + dz2 : 2.007803 d : 10.035759 + dxz : 2.011376 + dyz : 2.012454 + dx2y2 : 2.002984 + dxy : 2.001142 + f0 : 0.001588 f : 0.005084 + f+1 : 0.001448 + f-1 : 0.001451 + f+2 : 0.000340 + f-2 : 0.000183 + f+3 : 0.000045 + f-3 : 0.000028 + 1 Cos : 6.490941 s : 6.490941 + pz : 4.267064 p : 12.776928 + px : 4.244704 + py : 4.265160 + dz2 : 1.102526 d : 7.881496 + dxz : 1.901339 + dyz : 1.909372 + dx2y2 : 1.108543 + dxy : 1.859716 + f0 : 0.000091 f : 0.000584 + f+1 : 0.000102 + f-1 : 0.000085 + f+2 : 0.000094 + f-2 : 0.000037 + f+3 : 0.000100 + f-3 : 0.000075 + 2 S s : 5.825092 s : 5.825092 + pz : 3.364250 p : 9.784410 + px : 3.413520 + py : 3.006640 + dz2 : 0.036110 d : 0.217003 + dxz : 0.042730 + dyz : 0.045549 + dx2y2 : 0.053239 + dxy : 0.039376 + f0 : 0.002544 f : 0.017801 + f+1 : 0.001887 + f-1 : 0.002583 + f+2 : 0.003692 + f-2 : 0.002231 + f+3 : 0.002285 + f-3 : 0.002578 + 3 C s : 3.097745 s : 3.097745 + pz : 0.827437 p : 2.549001 + px : 0.881627 + py : 0.839937 + dz2 : 0.025921 d : 0.134694 + dxz : 0.026693 + dyz : 0.021310 + dx2y2 : 0.032894 + dxy : 0.027876 + f0 : 0.001356 f : 0.010334 + f+1 : 0.001033 + f-1 : 0.001235 + f+2 : 0.001578 + f-2 : 0.001687 + f+3 : 0.001743 + f-3 : 0.001702 + 4 C s : 3.200639 s : 3.200639 + pz : 1.004502 p : 2.834338 + px : 0.936817 + py : 0.893018 + dz2 : 0.014926 d : 0.080062 + dxz : 0.010417 + dyz : 0.010789 + dx2y2 : 0.023970 + dxy : 0.019960 + f0 : 0.000571 f : 0.007708 + f+1 : 0.001275 + f-1 : 0.001232 + f+2 : 0.001115 + f-2 : 0.001385 + f+3 : 0.001053 + f-3 : 0.001078 + 5 C s : 3.186096 s : 3.186096 + pz : 0.900824 p : 2.788378 + px : 0.922461 + py : 0.965092 + dz2 : 0.022477 d : 0.091260 + dxz : 0.016524 + dyz : 0.013571 + dx2y2 : 0.017609 + dxy : 0.021079 + f0 : 0.000965 f : 0.008072 + f+1 : 0.001126 + f-1 : 0.000879 + f+2 : 0.001147 + f-2 : 0.001432 + f+3 : 0.001658 + f-3 : 0.000864 + 6 H s : 0.819544 s : 0.819544 + pz : 0.004241 p : 0.021477 + px : 0.006269 + py : 0.010967 + 7 C s : 3.160938 s : 3.160938 + pz : 0.939496 p : 2.805094 + px : 0.966508 + py : 0.899091 + dz2 : 0.019380 d : 0.088969 + dxz : 0.019834 + dyz : 0.017468 + dx2y2 : 0.020771 + dxy : 0.011516 + f0 : 0.001293 f : 0.008032 + f+1 : 0.001035 + f-1 : 0.001010 + f+2 : 0.001157 + f-2 : 0.001508 + f+3 : 0.001218 + f-3 : 0.000810 + 8 H s : 0.824186 s : 0.824186 + pz : 0.008545 p : 0.021435 + px : 0.009039 + py : 0.003850 + 9 C s : 3.231103 s : 3.231103 + pz : 0.899048 p : 2.817540 + px : 0.923250 + py : 0.995242 + dz2 : 0.018857 d : 0.084746 + dxz : 0.016952 + dyz : 0.020049 + dx2y2 : 0.019284 + dxy : 0.009604 + f0 : 0.001259 f : 0.007946 + f+1 : 0.000988 + f-1 : 0.000954 + f+2 : 0.001220 + f-2 : 0.001456 + f+3 : 0.000763 + f-3 : 0.001305 + 10 H s : 0.835343 s : 0.835343 + pz : 0.008209 p : 0.021468 + px : 0.004020 + py : 0.009239 + 11 C s : 3.206064 s : 3.206064 + pz : 0.979722 p : 2.957973 + px : 0.915088 + py : 1.063164 + dz2 : 0.021578 d : 0.105795 + dxz : 0.024161 + dyz : 0.017133 + dx2y2 : 0.025465 + dxy : 0.017458 + f0 : 0.000941 f : 0.006860 + f+1 : 0.001244 + f-1 : 0.000781 + f+2 : 0.000764 + f-2 : 0.001253 + f+3 : 0.000968 + f-3 : 0.000909 + 12 H s : 0.847827 s : 0.847827 + pz : 0.009564 p : 0.020217 + px : 0.005443 + py : 0.005211 + 13 H s : 0.852348 s : 0.852348 + pz : 0.004703 p : 0.019902 + px : 0.004170 + py : 0.011029 + 14 C s : 3.160845 s : 3.160845 + pz : 0.992212 p : 2.934603 + px : 1.050509 + py : 0.891881 + dz2 : 0.024908 d : 0.105490 + dxz : 0.014074 + dyz : 0.026074 + dx2y2 : 0.021580 + dxy : 0.018854 + f0 : 0.000866 f : 0.005879 + f+1 : 0.000997 + f-1 : 0.000741 + f+2 : 0.000965 + f-2 : 0.000843 + f+3 : 0.000661 + f-3 : 0.000806 + 15 H s : 0.825868 s : 0.825868 + pz : 0.009402 p : 0.020758 + px : 0.004957 + py : 0.006399 + 16 H s : 0.831491 s : 0.831491 + pz : 0.004292 p : 0.020770 + px : 0.011375 + py : 0.005103 + 17 C s : 3.142570 s : 3.142570 + pz : 0.930323 p : 2.925068 + px : 0.956981 + py : 1.037764 + dz2 : 0.018896 d : 0.107684 + dxz : 0.033723 + dyz : 0.011172 + dx2y2 : 0.024376 + dxy : 0.019517 + f0 : 0.000741 f : 0.005736 + f+1 : 0.000964 + f-1 : 0.000476 + f+2 : 0.001046 + f-2 : 0.000620 + f+3 : 0.000826 + f-3 : 0.001063 + 18 H s : 0.809858 s : 0.809858 + pz : 0.004811 p : 0.022150 + px : 0.004695 + py : 0.012643 + 19 H s : 0.866338 s : 0.866338 + pz : 0.009521 p : 0.021074 + px : 0.006926 + py : 0.004627 + 20 C s : 3.236789 s : 3.236789 + pz : 1.074192 p : 3.047222 + px : 0.937745 + py : 1.035285 + dz2 : 0.006388 d : 0.066077 + dxz : 0.023022 + dyz : 0.007648 + dx2y2 : 0.016300 + dxy : 0.012719 + f0 : 0.000490 f : 0.004566 + f+1 : 0.000908 + f-1 : 0.000248 + f+2 : 0.000864 + f-2 : 0.000403 + f+3 : 0.000783 + f-3 : 0.000870 + 21 H s : 0.867352 s : 0.867352 + pz : 0.005176 p : 0.019842 + px : 0.004334 + py : 0.010332 + 22 H s : 0.843698 s : 0.843698 + pz : 0.007411 p : 0.019781 + px : 0.005951 + py : 0.006420 + 23 H s : 0.841761 s : 0.841761 + pz : 0.009006 p : 0.019678 + px : 0.006442 + py : 0.004229 + 24 I s : 3.966272 s : 3.966272 + pz : 3.959023 p : 11.308356 + px : 3.941897 + py : 3.407436 + dz2 : 2.004162 d : 10.039790 + dxz : 2.002058 + dyz : 2.012820 + dx2y2 : 2.007105 + dxy : 2.013645 + f0 : 0.000627 f : 0.005390 + f+1 : 0.000150 + f-1 : 0.000859 + f+2 : 0.000954 + f-2 : 0.000251 + f+3 : 0.001472 + f-3 : 0.001078 + 25 H s : 0.846589 s : 0.846589 + pz : 0.009632 p : 0.021557 + px : 0.005760 + py : 0.006166 + + + ******************************* + * LOEWDIN POPULATION ANALYSIS * + ******************************* + +---------------------- +LOEWDIN ATOMIC CHARGES +---------------------- + 0 I : 0.059474 + 1 Co: -0.955304 + 2 S : 0.867979 + 3 C : -0.126143 + 4 C : -0.090922 + 5 C : -0.097195 + 6 H : 0.161457 + 7 C : -0.104485 + 8 H : 0.163658 + 9 C : -0.093558 + 10 H : 0.160733 + 11 C : -0.231454 + 12 H : 0.150358 + 13 H : 0.154810 + 14 C : -0.390144 + 15 H : 0.147920 + 16 H : 0.130567 + 17 C : -0.452600 + 18 H : 0.138466 + 19 H : 0.126851 + 20 C : -0.330111 + 21 H : 0.117024 + 22 H : 0.130836 + 23 H : 0.128048 + 24 I : 0.078369 + 25 H : 0.155366 + +------------------------------- +LOEWDIN REDUCED ORBITAL CHARGES +------------------------------- + 0 I s : 3.718429 s : 3.718429 + pz : 3.373938 p : 11.146936 + px : 3.882834 + py : 3.890164 + dz2 : 2.017246 d : 10.067414 + dxz : 2.021433 + dyz : 2.022031 + dx2y2 : 2.005131 + dxy : 2.001573 + f0 : 0.002466 f : 0.007748 + f+1 : 0.002288 + f-1 : 0.002257 + f+2 : 0.000382 + f-2 : 0.000248 + f+3 : 0.000070 + f-3 : 0.000038 + 1 Cos : 6.290000 s : 6.290000 + pz : 4.275828 p : 12.813021 + px : 4.261717 + py : 4.275477 + dz2 : 1.413367 d : 8.851438 + dxz : 2.014425 + dyz : 2.040000 + dx2y2 : 1.412430 + dxy : 1.971216 + f0 : 0.000139 f : 0.000845 + f+1 : 0.000149 + f-1 : 0.000119 + f+2 : 0.000137 + f-2 : 0.000037 + f+3 : 0.000157 + f-3 : 0.000108 + 2 S s : 5.144999 s : 5.144999 + pz : 3.331008 p : 9.574740 + px : 3.284512 + py : 2.959220 + dz2 : 0.059293 d : 0.361628 + dxz : 0.071139 + dyz : 0.073599 + dx2y2 : 0.090640 + dxy : 0.066956 + f0 : 0.006972 f : 0.050655 + f+1 : 0.004424 + f-1 : 0.007867 + f+2 : 0.010511 + f-2 : 0.005990 + f+3 : 0.007138 + f-3 : 0.007754 + 3 C s : 2.699167 s : 2.699167 + pz : 0.917738 p : 2.799253 + px : 0.955591 + py : 0.925924 + dz2 : 0.109663 d : 0.563696 + dxz : 0.110966 + dyz : 0.099598 + dx2y2 : 0.120321 + dxy : 0.123148 + f0 : 0.008090 f : 0.064027 + f+1 : 0.007260 + f-1 : 0.009068 + f+2 : 0.010621 + f-2 : 0.008630 + f+3 : 0.011501 + f-3 : 0.008857 + 4 C s : 2.746384 s : 2.746384 + pz : 0.940718 p : 2.889314 + px : 0.980256 + py : 0.968339 + dz2 : 0.067697 d : 0.406035 + dxz : 0.077750 + dyz : 0.080181 + dx2y2 : 0.091060 + dxy : 0.089347 + f0 : 0.004120 f : 0.049190 + f+1 : 0.008145 + f-1 : 0.007541 + f+2 : 0.009980 + f-2 : 0.005960 + f+3 : 0.006574 + f-3 : 0.006870 + 5 C s : 2.749521 s : 2.749521 + pz : 0.940791 p : 2.871068 + px : 0.950985 + py : 0.979292 + dz2 : 0.099533 d : 0.425281 + dxz : 0.083085 + dyz : 0.070025 + dx2y2 : 0.075181 + dxy : 0.097457 + f0 : 0.006029 f : 0.051324 + f+1 : 0.008180 + f-1 : 0.006408 + f+2 : 0.008811 + f-2 : 0.007541 + f+3 : 0.007640 + f-3 : 0.006715 + 6 H s : 0.778613 s : 0.778613 + pz : 0.011092 p : 0.059930 + px : 0.016924 + py : 0.031914 + 7 C s : 2.743688 s : 2.743688 + pz : 0.967073 p : 2.882059 + px : 0.944096 + py : 0.970891 + dz2 : 0.068134 d : 0.426467 + dxz : 0.093790 + dyz : 0.080678 + dx2y2 : 0.105496 + dxy : 0.078369 + f0 : 0.008208 f : 0.052271 + f+1 : 0.005511 + f-1 : 0.006425 + f+2 : 0.004844 + f-2 : 0.009904 + f+3 : 0.008968 + f-3 : 0.008411 + 8 H s : 0.776579 s : 0.776579 + pz : 0.024364 p : 0.059762 + px : 0.024853 + py : 0.010546 + 9 C s : 2.740148 s : 2.740148 + pz : 0.960717 p : 2.879993 + px : 0.962330 + py : 0.956945 + dz2 : 0.067916 d : 0.421866 + dxz : 0.078545 + dyz : 0.096839 + dx2y2 : 0.102358 + dxy : 0.076208 + f0 : 0.008194 f : 0.051551 + f+1 : 0.005983 + f-1 : 0.005494 + f+2 : 0.004734 + f-2 : 0.009806 + f+3 : 0.008241 + f-3 : 0.009099 + 10 H s : 0.779382 s : 0.779382 + pz : 0.023383 p : 0.059885 + px : 0.011065 + py : 0.025437 + 11 C s : 2.765909 s : 2.765909 + pz : 1.020055 p : 3.021338 + px : 0.991503 + py : 1.009779 + dz2 : 0.087248 d : 0.402797 + dxz : 0.099209 + dyz : 0.060541 + dx2y2 : 0.092906 + dxy : 0.062893 + f0 : 0.006257 f : 0.041410 + f+1 : 0.006928 + f-1 : 0.005178 + f+2 : 0.004080 + f-2 : 0.008110 + f+3 : 0.005653 + f-3 : 0.005205 + 12 H s : 0.792667 s : 0.792667 + pz : 0.025715 p : 0.056975 + px : 0.015077 + py : 0.016183 + 13 H s : 0.788202 s : 0.788202 + pz : 0.012910 p : 0.056989 + px : 0.012150 + py : 0.031929 + 14 C s : 2.842164 s : 2.842164 + pz : 1.059912 p : 3.101720 + px : 1.047312 + py : 0.994497 + dz2 : 0.086997 d : 0.410337 + dxz : 0.060006 + dyz : 0.108941 + dx2y2 : 0.088732 + dxy : 0.065660 + f0 : 0.005804 f : 0.035922 + f+1 : 0.004857 + f-1 : 0.005199 + f+2 : 0.005114 + f-2 : 0.006029 + f+3 : 0.004234 + f-3 : 0.004685 + 15 H s : 0.791213 s : 0.791213 + pz : 0.027267 p : 0.060867 + px : 0.015550 + py : 0.018050 + 16 H s : 0.808163 s : 0.808163 + pz : 0.012741 p : 0.061270 + px : 0.033693 + py : 0.014836 + 17 C s : 2.852632 s : 2.852632 + pz : 1.031839 p : 3.146913 + px : 1.060722 + py : 1.054352 + dz2 : 0.083777 d : 0.417601 + dxz : 0.125712 + dyz : 0.047595 + dx2y2 : 0.094083 + dxy : 0.066433 + f0 : 0.004495 f : 0.035454 + f+1 : 0.006010 + f-1 : 0.003865 + f+2 : 0.005028 + f-2 : 0.004814 + f+3 : 0.005095 + f-3 : 0.006147 + 18 H s : 0.797255 s : 0.797255 + pz : 0.013903 p : 0.064279 + px : 0.012470 + py : 0.037907 + 19 H s : 0.812027 s : 0.812027 + pz : 0.029046 p : 0.061122 + px : 0.018624 + py : 0.013452 + 20 C s : 2.840273 s : 2.840273 + pz : 1.072521 p : 3.183792 + px : 1.049251 + py : 1.062020 + dz2 : 0.030059 d : 0.279306 + dxz : 0.086803 + dyz : 0.032385 + dx2y2 : 0.074807 + dxy : 0.055252 + f0 : 0.003021 f : 0.026741 + f+1 : 0.004692 + f-1 : 0.001704 + f+2 : 0.003270 + f-2 : 0.003403 + f+3 : 0.005044 + f-3 : 0.005607 + 21 H s : 0.823923 s : 0.823923 + pz : 0.015277 p : 0.059053 + px : 0.012082 + py : 0.031693 + 22 H s : 0.810038 s : 0.810038 + pz : 0.022773 p : 0.059126 + px : 0.016128 + py : 0.020225 + 23 H s : 0.812628 s : 0.812628 + pz : 0.029123 p : 0.059324 + px : 0.017707 + py : 0.012494 + 24 I s : 3.705627 s : 3.705627 + pz : 3.890943 p : 11.136094 + px : 3.854278 + py : 3.390873 + dz2 : 2.007371 d : 10.071640 + dxz : 2.003024 + dyz : 2.022676 + dx2y2 : 2.016407 + dxy : 2.022162 + f0 : 0.000950 f : 0.008271 + f+1 : 0.000215 + f-1 : 0.001234 + f+2 : 0.001529 + f-2 : 0.000313 + f+3 : 0.002315 + f-3 : 0.001714 + 25 H s : 0.784407 s : 0.784407 + pz : 0.025782 p : 0.060227 + px : 0.016651 + py : 0.017794 + + + ***************************** + * MAYER POPULATION ANALYSIS * + ***************************** + + NA - Mulliken gross atomic population + ZA - Total nuclear charge + QA - Mulliken gross atomic charge + VA - Mayer's total valence + BVA - Mayer's bonded valence + FA - Mayer's free valence + + ATOM NA ZA QA VA BVA FA + 0 I 25.2917 25.0000 -0.2917 1.0903 1.0903 0.0000 + 1 Co 27.1499 27.0000 -0.1499 4.9304 4.9304 0.0000 + 2 S 15.8443 16.0000 0.1557 2.8711 2.8711 0.0000 + 3 C 5.7918 6.0000 0.2082 3.6433 3.6433 -0.0000 + 4 C 6.1227 6.0000 -0.1227 3.8815 3.8815 -0.0000 + 5 C 6.0738 6.0000 -0.0738 3.9566 3.9566 -0.0000 + 6 H 0.8410 1.0000 0.1590 0.9850 0.9850 -0.0000 + 7 C 6.0630 6.0000 -0.0630 3.9392 3.9392 0.0000 + 8 H 0.8456 1.0000 0.1544 0.9882 0.9882 -0.0000 + 9 C 6.1413 6.0000 -0.1413 3.9198 3.9198 0.0000 + 10 H 0.8568 1.0000 0.1432 0.9948 0.9948 0.0000 + 11 C 6.2767 6.0000 -0.2767 4.1156 4.1156 -0.0000 + 12 H 0.8680 1.0000 0.1320 0.9649 0.9649 -0.0000 + 13 H 0.8722 1.0000 0.1278 0.9686 0.9686 0.0000 + 14 C 6.2068 6.0000 -0.2068 3.9214 3.9214 0.0000 + 15 H 0.8466 1.0000 0.1534 0.9797 0.9797 0.0000 + 16 H 0.8523 1.0000 0.1477 0.9586 0.9586 0.0000 + 17 C 6.1811 6.0000 -0.1811 3.9014 3.9014 -0.0000 + 18 H 0.8320 1.0000 0.1680 0.9858 0.9858 -0.0000 + 19 H 0.8874 1.0000 0.1126 0.9725 0.9725 -0.0000 + 20 C 6.3547 6.0000 -0.3547 3.9438 3.9438 -0.0000 + 21 H 0.8872 1.0000 0.1128 0.9705 0.9705 0.0000 + 22 H 0.8635 1.0000 0.1365 0.9682 0.9682 -0.0000 + 23 H 0.8614 1.0000 0.1386 0.9764 0.9764 -0.0000 + 24 I 25.3198 25.0000 -0.3198 1.0792 1.0792 -0.0000 + 25 H 0.8681 1.0000 0.1319 0.9926 0.9926 0.0000 + + Mayer bond orders larger than 0.100000 +B( 0-I , 1-Co) : 0.8988 B( 1-Co, 2-S ) : 0.7546 B( 1-Co, 3-C ) : 0.3616 +B( 1-Co, 4-C ) : 0.5176 B( 1-Co, 5-C ) : 0.4083 B( 1-Co, 7-C ) : 0.4413 +B( 1-Co, 9-C ) : 0.4991 B( 1-Co, 24-I ) : 0.8696 B( 2-S , 14-C ) : 0.9384 +B( 2-S , 17-C ) : 0.9514 B( 3-C , 4-C ) : 1.1497 B( 3-C , 9-C ) : 1.1537 +B( 3-C , 11-C ) : 0.9991 B( 4-C , 5-C ) : 1.1974 B( 4-C , 25-H ) : 0.9237 +B( 5-C , 6-H ) : 0.9271 B( 5-C , 7-C ) : 1.2890 B( 7-C , 8-H ) : 0.9283 +B( 7-C , 9-C ) : 1.1996 B( 9-C , 10-H ) : 0.9342 B( 11-C , 12-H ) : 0.9647 +B( 11-C , 13-H ) : 0.9248 B( 11-C , 14-C ) : 1.0144 B( 14-C , 15-H ) : 0.9305 +B( 14-C , 16-H ) : 0.9367 B( 17-C , 18-H ) : 0.9184 B( 17-C , 19-H ) : 0.9393 +B( 17-C , 20-C ) : 1.0122 B( 20-C , 21-H ) : 0.9626 B( 20-C , 22-H ) : 0.9567 +B( 20-C , 23-H ) : 0.9617 + + +------------------ +HIRSHFELD ANALYSIS +------------------ + +Total integrated alpha density = 79.999925118 +Total integrated beta density = 79.999925118 + + ATOM CHARGE SPIN + 0 I -0.282108 0.000000 + 1 Co -0.015265 0.000000 + 2 S 0.118196 0.000000 + 3 C 0.012204 0.000000 + 4 C -0.028064 0.000000 + 5 C -0.004352 0.000000 + 6 H 0.067878 0.000000 + 7 C -0.009099 0.000000 + 8 H 0.070305 0.000000 + 9 C -0.023852 0.000000 + 10 H 0.061421 0.000000 + 11 C -0.019841 0.000000 + 12 H 0.037778 0.000000 + 13 H 0.044078 0.000000 + 14 C -0.011520 0.000000 + 15 H 0.051178 0.000000 + 16 H 0.041878 0.000000 + 17 C -0.016573 0.000000 + 18 H 0.043332 0.000000 + 19 H 0.034535 0.000000 + 20 C -0.061046 0.000000 + 21 H 0.025568 0.000000 + 22 H 0.039027 0.000000 + 23 H 0.035046 0.000000 + 24 I -0.271272 0.000000 + 25 H 0.060718 0.000000 + + TOTAL 0.000150 0.000000 + +------- +TIMINGS +------- + +Total SCF time: 0 days 0 hours 7 min 31 sec + +Total time .... 451.277 sec +Sum of individual times .... 449.893 sec ( 99.7%) + +Fock matrix formation .... 30.954 sec ( 6.9%) + Split-RI-J .... 4.885 sec ( 15.8% of F) + Chain of spheres X .... 13.745 sec ( 44.4% of F) + XC integration .... 10.791 sec ( 34.9% of F) + Basis function eval. .... 0.370 sec ( 3.4% of XC) + Density eval. .... 1.730 sec ( 16.0% of XC) + XC-Functional eval. .... 0.101 sec ( 0.9% of XC) + XC-Potential eval. .... 1.284 sec ( 11.9% of XC) +Diagonalization .... 3.565 sec ( 0.8%) +Density matrix formation .... 0.172 sec ( 0.0%) +Population analysis .... 0.813 sec ( 0.2%) +Initial guess .... 410.665 sec ( 91.0%) +Orbital Transformation .... 0.000 sec ( 0.0%) +Orbital Orthonormalization .... 0.000 sec ( 0.0%) +DIIS solution .... 2.081 sec ( 0.5%) +Grid generation .... 1.643 sec ( 0.4%) + +Maximum memory used throughout the entire SCF-calculation: 110.1 MB + + +------------------------------------------------------------------------------- + DFT DISPERSION CORRECTION + + DFTD3 V3.1 Rev 1 + USING Becke-Johnson damping +------------------------------------------------------------------------------- +The TPSSH functional is recognized +Active option DFTDOPT ... 4 + +molecular C6(AA) [au] = 14592.114703 + + + DFT-D V3 + parameters + s6 scaling factor : 1.0000 + a1 scaling factor : 0.4529 + s8 scaling factor : 2.2382 + a2 scaling factor : 4.6550 + ad hoc parameters k1-k3 : 16.0000 1.3333 -4.0000 + + Edisp/kcal,au: -34.568968677211 -0.055089152305 + E6 /kcal : -14.215411173 + E8 /kcal : -20.353557504 + % E8 : 58.878116077 + +------------------------- ---------------- +Dispersion correction -0.055089152 +------------------------- ---------------- + + +------------------------- -------------------- +FINAL SINGLE POINT ENERGY -2727.382472581588 +------------------------- -------------------- + + + *************************************** + * ORCA property calculations * + *************************************** + + --------------------- + Active property flags + --------------------- + (+) Dipole Moment + + +------------------------------------------------------------------------------ + ORCA ELECTRIC PROPERTIES CALCULATION +------------------------------------------------------------------------------ + +Dipole Moment Calculation ... on +Quadrupole Moment Calculation ... off +Polarizability Calculation ... off +GBWName ... CEHZOF_1_SPE.gbw +Electron density ... CEHZOF_1_SPE.scfp +The origin for moment calculation is the CENTER OF MASS = (-2.412849, 12.607622 23.419831) + +------------- +DIPOLE MOMENT +------------- + X Y Z +Electronic contribution: 66.98533 124.75009 -140.83557 +Nuclear contribution : -67.97124 -126.95103 143.44692 + ----------------------------------------- +Total Dipole Moment : -0.98591 -2.20093 2.61135 + ----------------------------------------- +Magnitude (a.u.) : 3.55461 +Magnitude (Debye) : 9.03510 + + + +-------------------- +Rotational spectrum +-------------------- + +Rotational constants in cm-1: 0.010866 0.009836 0.007715 +Rotational constants in MHz : 325.751803 294.869348 231.299954 + + Dipole components along the rotational axes: +x,y,z [a.u.] : 2.232036 -2.590306 0.971385 +x,y,z [Debye]: 5.673383 -6.584034 2.469065 + + + +Timings for individual modules: + +Sum of individual times ... 4725.452 sec (= 78.758 min) +GTO integral calculation ... 2077.791 sec (= 34.630 min) 44.0 % +SCF iterations ... 2647.661 sec (= 44.128 min) 56.0 % + ****ORCA TERMINATED NORMALLY**** +TOTAL RUN TIME: 0 days 2 hours 4 minutes 35 seconds 844 msec diff --git a/python/README.md b/python/README.md index b210166..3d689bf 100644 --- a/python/README.md +++ b/python/README.md @@ -156,9 +156,11 @@ out = vmol.capture(mols={'q': q, 'r': r, 'name': name}, args=['shell:0.6,0.7']) print(out) ``` -ASE Atoms (or anything with `.numbers` and `.positions`) are also supported: +ASE Atoms (or anything with `.numbers` and `.positions`) are also [supported](examples/ex_ase.py): ```python import ase.io mols = ase.io.read('../mol/mol0002.xyz', index=':') out = vmol.capture(mols=mols) ``` + +Formats which are not supported natively can be read with `cclib` as passed (see [example](examples/ex_cclib)). diff --git a/python/examples/ex_cclib.py b/python/examples/ex_cclib.py new file mode 100755 index 0000000..dbad330 --- /dev/null +++ b/python/examples/ex_cclib.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import cclib +from vmol import vmol + +path = '../mol/CEHZOF_1_SPE.out' +parser = cclib.io.ccopen(path) + +data = parser.parse() +mols = [{'q': data.atomnos, 'r': r, 'name': str(parser)} for r in data.atomcoords] +out = vmol.capture(mols=mols) +print('captured output:') +print(out) From ffa8d337f78ffd7426d2b0929b99582c178761cc Mon Sep 17 00:00:00 2001 From: Ksenia Date: Fri, 6 Mar 2026 20:59:32 +0100 Subject: [PATCH 29/48] Add checks --- python/vmol/__init__.py | 2 ++ python/vmol/main.py | 56 +++++++++++++++++++++++++++++++---------- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/python/vmol/__init__.py b/python/vmol/__init__.py index 1231d17..0cb2288 100644 --- a/python/vmol/__init__.py +++ b/python/vmol/__init__.py @@ -5,6 +5,8 @@ _v = 'v' _suffix = get_config_var('EXT_SUFFIX') _paths = [ + f'./{_v}.so', + f'./{_v}{_suffix}', f'{__path__[0]}/{_v}.so', f'{__path__[0]}/{_v}{_suffix}', f"{get_path('purelib')}/{__package__}/{_v}{_suffix}", diff --git a/python/vmol/main.py b/python/vmol/main.py index 80bb1bf..0921129 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -4,6 +4,7 @@ import ctypes from ctypes import c_int, c_double, c_char_p import functools +from warnings import warn __all__ = ["Vmol"] @@ -11,7 +12,6 @@ c_double_p = ctypes.POINTER(c_double) c_int_p = ctypes.POINTER(c_int) -ARGS_T = (c_int, ctypes.POINTER(ctypes.c_char_p)) class inp_mols_t(ctypes.Structure): @@ -25,6 +25,10 @@ class inp_mols_t(ctypes.Structure): ) +ARGS_T = (c_int, ctypes.POINTER(ctypes.c_char_p)) +INP_MOLS_T = (c_int, ctypes.POINTER(inp_mols_t)) + + def declare(func, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): """Declare a function from the shared library with the given argument and return types. @@ -159,6 +163,8 @@ def wrapped_func(argv: list[str], ...) TypeError: If func is not a ctypes function. ValueError: If its attributes are wrong. """ + if func is None: + return None if not isinstance(func, ctypes._CFuncPtr): msg = "function should be a ctypes function" raise TypeError(msg) @@ -201,8 +207,9 @@ def __get__(self, obj, objtype=None): return getattr(obj, self.private_name, None) def __set__(self, obj, value): - setattr(obj, self.private_name, value) - obj._call_hook() + if obj._call_pre_hook(value): + setattr(obj, self.private_name, value) + obj._call_post_hook() class VmolFunctions: @@ -225,17 +232,41 @@ def _check_so(self): msg = "shared library path is not set, cannot run the viewer" raise ValueError(msg) - def _call_hook(self): + def _call_pre_hook(self, new_so): + """Check if the new shared library path is different from the current one and can be loaded.""" + if new_so is None: + self.lib = None + return True + elif self.lib is None or self.lib._name != new_so: + try: + self.lib = ctypes.cdll.LoadLibrary(new_so) + except OSError as e: + msg = f"Failed to load shared library: {e}, keeping the old value {self.so}" + warn(msg, RuntimeWarning, stacklevel=3) + return False + return True + else: + return False + + + def _call_post_hook(self): """Re-declare functions when self.so is set to a new value.""" if self.so is None: - self.lib = None self._reset_functions() - elif self.lib is None or self.lib._name != self.so: + else: self._declare_functions() def _reset_functions(self): self.f.__dict__.clear() + def _declare(self, name, *kargs, **kwargs): + if hasattr(self.lib, name): + return declare(getattr(self.lib, name), *kargs, **kwargs) + else: + msg = f"Function '{name}' not found in the shared library '{self.so}'" + warn(msg, RuntimeWarning, stacklevel=2) + return None + def _declare_functions(self): def errcheck(result, func, args): @@ -244,16 +275,15 @@ def errcheck(result, func, args): self.f.free() return ret, out - self.lib = ctypes.cdll.LoadLibrary(self.so) - - self.f.free = declare(self.lib.free_out_str, argtypes=None, restype=None) - self.f.get_element = declare(self.lib.get_element, argtypes=[c_char_p], restype=c_int) + self.f.free = self._declare('free_out_str', argtypes=None, restype=None) + self.f.get_element = self._declare('get_element', argtypes=[c_char_p], restype=c_int) - self.f.main_raw = declare(self.lib.main, argtypes=ARGS_T, restype=c_int) - self.f.main_out_raw = declare(self.lib.main_wrap_out, argtypes=[*ARGS_T, c_int_p], + self.f.main_raw = self._declare('main', argtypes=ARGS_T, restype=c_int) + self.f.main_out_raw = self._declare('main_wrap_out', argtypes=[*ARGS_T, c_int_p], restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) - self.f.main_in_out_raw = declare(self.lib.main_wrap_in_out, argtypes=[*ARGS_T, c_int_p, c_int, ctypes.POINTER(inp_mols_t)], + self.f.main_in_out_raw = self._declare('main_wrap_in_out', argtypes=[*ARGS_T, c_int_p, *INP_MOLS_T], restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) + self.f.main = convert_in(self.f.main_raw) self.f.main_out = convert_in(self.f.main_out_raw) self.f.main_in_out = convert_in(self.f.main_in_out_raw) From c262275ab1a4508bea36266fc147332dcb03e979 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 7 Mar 2026 09:33:23 +0100 Subject: [PATCH 30/48] fix ffa8d33 --- python/vmol/main.py | 81 +++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/python/vmol/main.py b/python/vmol/main.py index 0921129..f8bcc9a 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -29,29 +29,6 @@ class inp_mols_t(ctypes.Structure): INP_MOLS_T = (c_int, ctypes.POINTER(inp_mols_t)) -def declare(func, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): - """Declare a function from the shared library with the given argument and return types. - - Args: - func (callable): The function to declare, typically obtained from the shared library. - argtypes (list of ctypes types): The argument types of the function. - restype (ctypes type): The return type of the function. - errcheck (callable, optional): A function that takes the result, the function, and the arguments, - and returns the processed result. - ret_code_ptr_idx (int, optional): Position of the `int *` argument to store the return value in. - - Returns: - callable: The function with the specified arguments and return types. - """ - func.argtypes = argtypes - func.restype = restype - if errcheck: - func.errcheck = errcheck - if ret_code_ptr_idx is not None: - func.ret_code_ptr_idx = ret_code_ptr_idx - return func - - def mol2struct(get_element, mol): """Convert a molecule to the expected C structure for input. @@ -207,9 +184,8 @@ def __get__(self, obj, objtype=None): return getattr(obj, self.private_name, None) def __set__(self, obj, value): - if obj._call_pre_hook(value): - setattr(obj, self.private_name, value) - obj._call_post_hook() + setattr(obj, self.private_name, value) + obj._call_hook() class VmolFunctions: @@ -232,41 +208,52 @@ def _check_so(self): msg = "shared library path is not set, cannot run the viewer" raise ValueError(msg) - def _call_pre_hook(self, new_so): - """Check if the new shared library path is different from the current one and can be loaded.""" - if new_so is None: + def _call_hook(self): + """Re-declare functions when self.so is set to a new value.""" + if self.so is None: self.lib = None - return True - elif self.lib is None or self.lib._name != new_so: + self._reset_functions() + elif self.lib is None or self.lib._name != self.so: try: - self.lib = ctypes.cdll.LoadLibrary(new_so) + self.lib = ctypes.cdll.LoadLibrary(self.so) except OSError as e: msg = f"Failed to load shared library: {e}, keeping the old value {self.so}" warn(msg, RuntimeWarning, stacklevel=3) - return False - return True - else: - return False - - - def _call_post_hook(self): - """Re-declare functions when self.so is set to a new value.""" - if self.so is None: - self._reset_functions() - else: + self.so = None + return self._declare_functions() def _reset_functions(self): self.f.__dict__.clear() - def _declare(self, name, *kargs, **kwargs): - if hasattr(self.lib, name): - return declare(getattr(self.lib, name), *kargs, **kwargs) - else: + def _declare(self, name, *, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): + """Declare a function from the shared library with the given argument and return types. + + Args: + name (str): The name of the function to declare. + argtypes (list of ctypes types): The argument types of the function. + restype (ctypes type): The return type of the function. + errcheck (callable, optional): A function that takes the result, the function, and the arguments, + and returns the processed result. + ret_code_ptr_idx (int, optional): Position of the `int *` argument to store the return value in. + + Returns: + callable: The function with the specified arguments and return types. + """ + if not hasattr(self.lib, name): msg = f"Function '{name}' not found in the shared library '{self.so}'" warn(msg, RuntimeWarning, stacklevel=2) return None + func = getattr(self.lib, name) + func.argtypes = argtypes + func.restype = restype + if errcheck: + func.errcheck = errcheck + if ret_code_ptr_idx is not None: + func.ret_code_ptr_idx = ret_code_ptr_idx + return func + def _declare_functions(self): def errcheck(result, func, args): From cad60fba6ae0a79eacdc71dee6d3e08abe061a15 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Fri, 6 Mar 2026 21:01:43 +0100 Subject: [PATCH 31/48] Pass input w/o capturing output --- python/README.md | 6 ++++++ python/vmol/main.py | 15 +++++++++++++-- src/api.c | 15 ++++++++++----- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/python/README.md b/python/README.md index 3d689bf..4e47650 100644 --- a/python/README.md +++ b/python/README.md @@ -163,4 +163,10 @@ mols = ase.io.read('../mol/mol0002.xyz', index=':') out = vmol.capture(mols=mols) ``` +Without capturing the output: +```python +from vmol import vmol +vmol.run(argv=['vmol'], mols={'q': [1, 'F'], 'r': [[0,0,0],[0.9,0,0]], 'name': 'hydrogen fluoride'}) +``` + Formats which are not supported natively can be read with `cclib` as passed (see [example](examples/ex_cclib)). diff --git a/python/vmol/main.py b/python/vmol/main.py index f8bcc9a..e0341d1 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -270,28 +270,39 @@ def errcheck(result, func, args): restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) self.f.main_in_out_raw = self._declare('main_wrap_in_out', argtypes=[*ARGS_T, c_int_p, *INP_MOLS_T], restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) + self.f.main_in_raw = self._declare('main_wrap_in', argtypes=[*ARGS_T, *INP_MOLS_T], restype=c_int) self.f.main = convert_in(self.f.main_raw) self.f.main_out = convert_in(self.f.main_out_raw) self.f.main_in_out = convert_in(self.f.main_in_out_raw) + self.f.main_in = convert_in(self.f.main_in_raw) class Vmol(VmolFunctions): """Run the viewer with specified command-line arguments and/or molecule data and capture the output.""" - def run(self, argv): + def run(self, argv, *, mols=None): """Run the viewer with the given command-line arguments. Args: argv (list of str): The command-line arguments to pass to the main function. Unlike `capture()`, the first argument is a string that represents the program name, such as `sys.argv[0]` or the name of the shared library. + mols (object or list[object], optional): An object or a list thereof representing the molecule(s). + See `mol2struct()` for the expected format. Returns: int: The return code from the main function. """ self._check_so() - return self.f.main(argv) + if mols is None: + return self.f.main(argv) + else: + if not isinstance(mols, list): + mols = [mols] + nmol = len(mols) + mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) + return self.f.main_in(argv, nmol, mols) def capture(self, *, mols=None, args=None, return_code=False): """Run the viewer with the given structure and/or command-line arguments and capture the output. diff --git a/src/api.c b/src/api.c index eacfd51..9a298c1 100644 --- a/src/api.c +++ b/src/api.c @@ -16,15 +16,20 @@ char * main_wrap_out(int argc, char * argv[], int * ret) { return globals.out_str; } -char * main_wrap_in_out(int argc, char * argv[], - int * ret, - int n_inp_mols, inp_mols_t * inp_mols) { +int main_wrap_in(int argc, char * argv[], int n_inp_mols, inp_mols_t * inp_mols) { globals.inp_mols = inp_mols; globals.n_inp_mols = n_inp_mols; - globals.out_str = calloc(PRINTBUFLEN, 1); - *ret = main(argc, argv); + int ret = main(argc, argv); globals.inp_mols = NULL; globals.n_inp_mols = 0; + return ret; +} + +char * main_wrap_in_out(int argc, char * argv[], + int * ret, + int n_inp_mols, inp_mols_t * inp_mols) { + globals.out_str = calloc(PRINTBUFLEN, 1); + *ret = main_wrap_in(argc, argv, n_inp_mols, inp_mols); return globals.out_str; } From 40ffd2411e6089ee332085c04556bf621279ef58 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 7 Mar 2026 09:44:18 +0100 Subject: [PATCH 32/48] fix cad60fb --- python/vmol/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/python/vmol/main.py b/python/vmol/main.py index e0341d1..5efbb63 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -295,14 +295,15 @@ def run(self, argv, *, mols=None): int: The return code from the main function. """ self._check_so() + if mols is None: return self.f.main(argv) - else: - if not isinstance(mols, list): - mols = [mols] - nmol = len(mols) - mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) - return self.f.main_in(argv, nmol, mols) + + if not isinstance(mols, list): + mols = [mols] + nmol = len(mols) + mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) + return self.f.main_in(argv, nmol, mols) def capture(self, *, mols=None, args=None, return_code=False): """Run the viewer with the given structure and/or command-line arguments and capture the output. From 1f1c937b9112cf18e0da1416b70332e572f966d1 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 7 Mar 2026 10:02:00 +0100 Subject: [PATCH 33/48] Fix argv[0] --- python/README.md | 8 +++----- python/vmol/__main__.py | 2 +- python/vmol/main.py | 30 +++++++++++++++--------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/python/README.md b/python/README.md index 4e47650..3cb105b 100644 --- a/python/README.md +++ b/python/README.md @@ -111,10 +111,9 @@ python -m vmol ../mol/MOL_3525.xyz cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10 It can also be run from a script, i.e. ```python from vmol import vmol -vmol.run(['my_exe_name', '../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10']) +vmol.run(['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10']) ``` -The arguments are the same as the CLI ones. They should be an array of strings, -and the 0th argument stays for the program name and is ignored. +The arguments are the same as the CLI ones and should be an array of strings. ### 2. Capture the output See [example 1](examples/ex1.py). @@ -126,7 +125,6 @@ out = vmol.capture(args=['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0 print(out) ``` The arguments `args` are the same as the CLI ones and should be an array of strings. -In this case, the 0th argument is not ignored. The return code can be captured as well: ```python @@ -166,7 +164,7 @@ out = vmol.capture(mols=mols) Without capturing the output: ```python from vmol import vmol -vmol.run(argv=['vmol'], mols={'q': [1, 'F'], 'r': [[0,0,0],[0.9,0,0]], 'name': 'hydrogen fluoride'}) +vmol.run(args=['shell:0.6,0.7'], mols={'q': [1, 'F'], 'r': [[0,0,0],[0.9,0,0]], 'name': 'hydrogen fluoride'}) ``` Formats which are not supported natively can be read with `cclib` as passed (see [example](examples/ex_cclib)). diff --git a/python/vmol/__main__.py b/python/vmol/__main__.py index 703c96d..f8eb3d2 100755 --- a/python/vmol/__main__.py +++ b/python/vmol/__main__.py @@ -5,7 +5,7 @@ def main(): - vmol.run(sys.argv) + vmol.run(args=sys.argv, with_arg0=True) if __name__ == "__main__": diff --git a/python/vmol/main.py b/python/vmol/main.py index 5efbb63..de2a694 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -281,29 +281,31 @@ def errcheck(result, func, args): class Vmol(VmolFunctions): """Run the viewer with specified command-line arguments and/or molecule data and capture the output.""" - def run(self, argv, *, mols=None): + def run(self, *, args=None, mols=None, with_arg0=False): """Run the viewer with the given command-line arguments. Args: - argv (list of str): The command-line arguments to pass to the main function. - Unlike `capture()`, the first argument is a string that represents the program name, - such as `sys.argv[0]` or the name of the shared library. + args (list of str, optional): The command-line arguments to pass to the main function. mols (object or list[object], optional): An object or a list thereof representing the molecule(s). See `mol2struct()` for the expected format. + with_arg0 (bool, optional): Whether the first argument in `args` is the program name (e.g., `sys.argv[0]`). + If False or if `args` is None or empty, the program name is automatically added as the first argument. + Otherwise, `args` is used as is. Defaults to False. Returns: int: The return code from the main function. """ self._check_so() - - if mols is None: - return self.f.main(argv) - - if not isinstance(mols, list): - mols = [mols] - nmol = len(mols) - mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) - return self.f.main_in(argv, nmol, mols) + args = (args if with_arg0 else [self.so, *args]) if args else [self.so] + if mols: + if not isinstance(mols, list): + mols = [mols] + nmol = len(mols) + mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) + ret = self.f.main_in(args, nmol, mols) + else: + ret = self.f.main(args) + return ret def capture(self, *, mols=None, args=None, return_code=False): """Run the viewer with the given structure and/or command-line arguments and capture the output. @@ -332,12 +334,10 @@ def capture(self, *, mols=None, args=None, return_code=False): self._check_so() args = [self.so, *args] if args else [self.so] if mols: - if not isinstance(mols, list): mols = [mols] nmol = len(mols) mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) - ret, out = self.f.main_in_out(args, nmol, mols) else: ret, out = self.f.main_out(args) From b08946c010ae1430b0a078301e4c61303640235b Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 7 Mar 2026 10:33:22 +0100 Subject: [PATCH 34/48] Add exitcom CLI option --- README.md | 3 +- src/v/cli.c | 4 ++- src/v/evr.c | 1 + src/v/headless.c | 82 ++++++++++++++++++++++++++---------------------- src/v/man.c | 1 + src/v/v.h | 2 ++ 6 files changed, 54 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index e862eba..2c6e543 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,8 @@ Show the reference: | `center:%d` | origin is geometric center (`1`, default) / center of mass (`2`) / as is (`0`) | | `inertia:%d` | if rotate molecules wrt axis of inertia (`1`) or not (`0`, default) | | `gui:%d` | normal (default `1`) / headless (`0`) mode | -| `com:%d` | command sequence for `gui:0` | +| `com:%s` | command sequence for `gui:0` | +| `exitcom:%s` | command sequence to run on exit (same as for `gui:0`) | diff --git a/src/v/cli.c b/src/v/cli.c index e6d6897..e9a633c 100644 --- a/src/v/cli.c +++ b/src/v/cli.c @@ -93,11 +93,12 @@ static int cli_parse_arg(char * arg, drawpars * dp){ int a10 = sscanf (arg, "center:%d", &(dp->center)); int a11 = sscanf (arg, "inertia:%d", &(dp->inertia)); int a12 = sscanf (arg, "com:%255s", dp->com); + int a13 = sscanf (arg, "exitcom:%255s", dp->on_exit); int rot_count = sscan_rot (arg, rot); int cell_count = sscan_cell (arg, cell); int shell_count = sscan_shell(arg, shell); - int cli = a0||a1||a2||a3||a4||a5||a6||a7||a8||a9||a10||a11||a12 || rot_count||cell_count||shell_count; + int cli = a0||a1||a2||a3||a4||a5||a6||a7||a8||a9||a10||a11||a12||a13 || rot_count||cell_count||shell_count; if(vib==0){ dp->task = AT3COORDS; @@ -161,6 +162,7 @@ static drawpars dp_init(void){ dp.z[0] = dp.z[1] = dp.z[2] = dp.z[3] = dp.z[4] = 0; vecset(3*8, dp.vertices, 0.0); memset(dp.com, 0, STRLEN); + memset(dp.on_exit, 0, STRLEN); dp.input_files_n = 0; dp.input_files = NULL; // from data read diff --git a/src/v/evr.c b/src/v/evr.c index e25840f..d2f2a6a 100644 --- a/src/v/evr.c +++ b/src/v/evr.c @@ -353,6 +353,7 @@ void kp_move_d(void * ent, drawpars * dp){ } void kp_exit(void * ent, drawpars * dp){ + run_commands(NULL, dp->on_exit, dp, ent); ent_free(ent, dp); close_x(); dp->closed = 1; diff --git a/src/v/headless.c b/src/v/headless.c index 7867e55..104498b 100644 --- a/src/v/headless.c +++ b/src/v/headless.c @@ -1,50 +1,58 @@ #include "v.h" #include "evr.h" -int headless(drawpars * dp, void * ent){ - atcoord * ac = ((atcoords *)ent)->m[dp->n]; - if(dp->b>0 && !ac->bond_flag){ - bonds_fill(dp->rl, dp->bmax, ac); +void run_commands(FILE * f, char * command, drawpars * dp, void * ent){ + char * com = command; + char c; + + while(1){ + + if(command[0]){ + c = *(com++); + } + else if(f){ + c = getc(f); + } + else{ + c = 0; + } + if((!c) || (c == EOF)){ + break; } - char * com = dp->com; - char c; + switch(c){ + case('p'): + kp_print2fig(ent, dp); break; + case('z'): + kp_print_xyz(ent, dp); break; + case('x'): + kp_print(ent, dp); break; + case('.'): + { + styp sym; + pg(((atcoords *)ent)->m[dp->n], sym, dp->symtol); + PRINTOUT(stdout, "%s\n", sym); + }; break; - while(1){ - if (dp->com[0]!='\0'){ - c = *(com++); - } - else{ - c = getc(stdin); - } - if ((c == '\0') || (c == EOF)){ + case(' '): + case('\n'): break; - } - - switch(c){ - case('p'): - kp_print2fig(ent, dp); break; - case('z'): - kp_print_xyz(ent, dp); break; - case('x'): - kp_print(ent, dp); break; - case('.'): - { - styp sym; - pg(ac, sym, dp->symtol); - PRINTOUT(stdout, "%s\n", sym); - }; break; - case(' '): - case('\n'): - break; + default: + { + PRINT_WARN("Unknown command: %c\n", c); break; + } + } + } + return; +} - default: - { - PRINT_WARN("Unknown command: %c\n", c); break; - } - } +int headless(drawpars * dp, void * ent){ + atcoord * ac = ((atcoords *)ent)->m[dp->n]; + if(dp->b>0 && !ac->bond_flag){ + bonds_fill(dp->rl, dp->bmax, ac); } + run_commands(stdin, dp->com, dp, ent); ent_free(ent, dp); return 0; } diff --git a/src/v/man.c b/src/v/man.c index b255e9b..cc9aea8 100644 --- a/src/v/man.c +++ b/src/v/man.c @@ -32,6 +32,7 @@ void printman(FILE * f, char * exename){ inertia:%%d if rotate molecules wrt axis of inertia (1) or not (0, default) \n\ gui:%%d normal (1) / headless (0) mode \n\ com:%%s command sequence for gui:0 \n\ + exitcom:%%s command sequence to run on exit (same as for gui:0) \n\ \n\ KEYBOARD REFERENCE:\n\ \n\ diff --git a/src/v/v.h b/src/v/v.h index 8843392..ddf0b6f 100644 --- a/src/v/v.h +++ b/src/v/v.h @@ -95,6 +95,7 @@ typedef struct { // int closed; // 1: time to go char com[STRLEN]; // command string for gui:0 + char on_exit[STRLEN]; // command string to run on exit int input_files_n; // number of input files char ** input_files; // input files @@ -175,6 +176,7 @@ void vibro_text(modestr * ms, drawpars * dp); void pg(atcoord * a, styp s, double symtol); // headless.c +void run_commands(FILE * f, char * command, drawpars * dp, void * ent); int headless(drawpars * dp, void * ent); // main.c From 7b1212d1b3329452694bcb43629483866b545fa4 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 7 Mar 2026 10:41:59 +0100 Subject: [PATCH 35/48] Add python examples wrt b08946c --- python/README.md | 6 ++++++ python/examples/ex2.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/python/README.md b/python/README.md index 3cb105b..e95f2fb 100644 --- a/python/README.md +++ b/python/README.md @@ -139,6 +139,12 @@ Headless mode also works: 'D4d' ``` +Tell the viewer to automatically print the coordinates before exit: +```python +>>> out = vmol.capture(args=['../mol/rotation1.in', 'exitcom:z']) +>>> print(out) +``` + ### 3. Pass a structure One can pass a structure (or several structures) as an argument. diff --git a/python/examples/ex2.py b/python/examples/ex2.py index 6ba231e..e5f5fee 100755 --- a/python/examples/ex2.py +++ b/python/examples/ex2.py @@ -15,7 +15,7 @@ input('press enter to view a molecule...') # rotation matrix rot = 'rot:0.587785,0.000000,0.809017,0.670705,0.559193,-0.487296,-0.452397,0.829038,0.328685' -ret, xyz = vmol.capture(mols={'q': q, 'r': r, 'name': name}, args=[rot], return_code=True) +ret, xyz = vmol.capture(mols={'q': q, 'r': r, 'name': name}, args=[rot, 'exitcom:z'], return_code=True) print('return code:', ret) print('captured output:') print(xyz) From 6dec3644be15398c7551ae2e3f05dad921e71e32 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 7 Mar 2026 17:51:12 +0100 Subject: [PATCH 36/48] Add script using cclib --- mol/AJALIH_5_SPE.out | 4887 ++++++++++++++++++++++++++++++++++++++++++ python/README.md | 11 +- python/vmol/vmol2.py | 95 + src/v/headless.c | 14 +- 4 files changed, 4998 insertions(+), 9 deletions(-) create mode 100644 mol/AJALIH_5_SPE.out create mode 100755 python/vmol/vmol2.py diff --git a/mol/AJALIH_5_SPE.out b/mol/AJALIH_5_SPE.out new file mode 100644 index 0000000..d7b3eeb --- /dev/null +++ b/mol/AJALIH_5_SPE.out @@ -0,0 +1,4887 @@ + + ***************** + * O R C A * + ***************** + + #, + ### + #### + ##### + ###### + ########, + ,,################,,,,, + ,,#################################,, + ,,##########################################,, + ,#########################################, ''#####, + ,#############################################,, '####, + ,##################################################,,,,####, + ,###########'''' ''''############################### + ,#####'' ,,,,##########,,,, '''####''' '#### + ,##' ,,,,###########################,,, '## + ' ,,###'''' '''############,,, + ,,##'' '''############,,,, ,,,,,,###'' + ,#'' '''#######################''' + ' ''''####'''' + ,#######, #######, ,#######, ## + ,#' '#, ## ## ,#' '#, #''# ###### ,####, + ## ## ## ,#' ## #' '# # #' '# + ## ## ####### ## ,######, #####, # # + '#, ,#' ## ## '#, ,#' ,# #, ## #, ,# + '#######' ## ## '#######' #' '# #####' # '####' + + + + ####################################################### + # -***- # + # Department of theory and spectroscopy # + # Directorship and core code : Frank Neese # + # Max Planck Institute fuer Kohlenforschung # + # Kaiser Wilhelm Platz 1 # + # D-45470 Muelheim/Ruhr # + # Germany # + # # + # All rights reserved # + # -***- # + ####################################################### + + + Program Version 5.0.3 - RELEASE - + + + With contributions from (in alphabetic order): + Daniel Aravena : Magnetic Suceptibility + Michael Atanasov : Ab Initio Ligand Field Theory (pilot matlab implementation) + Alexander A. Auer : GIAO ZORA, VPT2 properties, NMR spectrum + Ute Becker : Parallelization + Giovanni Bistoni : ED, misc. LED, open-shell LED, HFLD + Martin Brehm : Molecular dynamics + Dmytro Bykov : SCF Hessian + Vijay G. Chilkuri : MRCI spin determinant printing, contributions to CSF-ICE + Dipayan Datta : RHF DLPNO-CCSD density + Achintya Kumar Dutta : EOM-CC, STEOM-CC + Dmitry Ganyushin : Spin-Orbit,Spin-Spin,Magnetic field MRCI + Miquel Garcia : C-PCM and meta-GGA Hessian, CC/C-PCM, Gaussian charge scheme + Yang Guo : DLPNO-NEVPT2, F12-NEVPT2, CIM, IAO-localization + Andreas Hansen : Spin unrestricted coupled pair/coupled cluster methods + Benjamin Helmich-Paris : MC-RPA, TRAH-SCF, COSX integrals + Lee Huntington : MR-EOM, pCC + Robert Izsak : Overlap fitted RIJCOSX, COSX-SCS-MP3, EOM + Marcus Kettner : VPT2 + Christian Kollmar : KDIIS, OOCD, Brueckner-CCSD(T), CCSD density, CASPT2, CASPT2-K + Simone Kossmann : Meta GGA functionals, TD-DFT gradient, OOMP2, MP2 Hessian + Martin Krupicka : Initial AUTO-CI + Lucas Lang : DCDCAS + Marvin Lechner : AUTO-CI (C++ implementation), FIC-MRCC + Dagmar Lenk : GEPOL surface, SMD + Dimitrios Liakos : Extrapolation schemes; Compound Job, initial MDCI parallelization + Dimitrios Manganas : Further ROCIS development; embedding schemes + Dimitrios Pantazis : SARC Basis sets + Anastasios Papadopoulos: AUTO-CI, single reference methods and gradients + Taras Petrenko : DFT Hessian,TD-DFT gradient, ASA, ECA, R-Raman, ABS, FL, XAS/XES, NRVS + Peter Pinski : DLPNO-MP2, DLPNO-MP2 Gradient + Christoph Reimann : Effective Core Potentials + Marius Retegan : Local ZFS, SOC + Christoph Riplinger : Optimizer, TS searches, QM/MM, DLPNO-CCSD(T), (RO)-DLPNO pert. Triples + Tobias Risthaus : Range-separated hybrids, TD-DFT gradient, RPA, STAB + Michael Roemelt : Original ROCIS implementation + Masaaki Saitow : Open-shell DLPNO-CCSD energy and density + Barbara Sandhoefer : DKH picture change effects + Avijit Sen : IP-ROCIS + Kantharuban Sivalingam : CASSCF convergence, NEVPT2, FIC-MRCI + Bernardo de Souza : ESD, SOC TD-DFT + Georgi Stoychev : AutoAux, RI-MP2 NMR, DLPNO-MP2 response + Willem Van den Heuvel : Paramagnetic NMR + Boris Wezisla : Elementary symmetry handling + Frank Wennmohs : Technical directorship + + + We gratefully acknowledge several colleagues who have allowed us to + interface, adapt or use parts of their codes: + Stefan Grimme, W. Hujo, H. Kruse, P. Pracht, : VdW corrections, initial TS optimization, + C. Bannwarth, S. Ehlert DFT functionals, gCP, sTDA/sTD-DF + Ed Valeev, F. Pavosevic, A. Kumar : LibInt (2-el integral package), F12 methods + Garnet Chan, S. Sharma, J. Yang, R. Olivares : DMRG + Ulf Ekstrom : XCFun DFT Library + Mihaly Kallay : mrcc (arbitrary order and MRCC methods) + Jiri Pittner, Ondrej Demel : Mk-CCSD + Frank Weinhold : gennbo (NPA and NBO analysis) + Christopher J. Cramer and Donald G. Truhlar : smd solvation model + Lars Goerigk : TD-DFT with DH, B97 family of functionals + V. Asgeirsson, H. Jonsson : NEB implementation + FAccTs GmbH : IRC, NEB, NEB-TS, DLPNO-Multilevel, CI-OPT + MM, QMMM, 2- and 3-layer-ONIOM, Crystal-QMMM, + LR-CPCM, SF, NACMEs, symmetry and pop. for TD-DFT, + nearIR, NL-DFT gradient (VV10), updates on ESD, + ML-optimized integration grids + S Lehtola, MJT Oliveira, MAL Marques : LibXC Library + Liviu Ungur et al : ANISO software + + + Your calculation uses the libint2 library for the computation of 2-el integrals + For citations please refer to: http://libint.valeyev.net + + Your ORCA version has been built with support for libXC version: 5.1.0 + For citations please refer to: https://tddft.org/programs/libxc/ + + This ORCA versions uses: + CBLAS interface : Fast vector & matrix operations + LAPACKE interface : Fast linear algebra routines + SCALAPACK package : Parallel linear algebra routines + Shared memory : Shared parallel matrices + BLAS/LAPACK : OpenBLAS 0.3.15 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Zen SINGLE_THREADED + Core in use : Zen + Copyright (c) 2011-2014, The OpenBLAS Project + + + + +*************************************** +The coordinates will be read from file: AJALIH.xyz +*************************************** + + +Your calculation utilizes the atom-pairwise dispersion correction +with the Becke-Johnson damping scheme (D3BJ) +Cite in your paper: +S.Grimme, S.Ehrlich, L.Goerigk, J Comput Chem, (2011), 32, 1456–1465 +S.Grimme, J.Antony, S.Ehrlich and H.Krieg, J.Chem.Phys., 132, (2010), 154104 + + +================================================================================ + +----- Orbital basis set information ----- +Your calculation utilizes the basis: def2-TZVP + F. Weigend and R. Ahlrichs, Phys. Chem. Chem. Phys. 7, 3297 (2005). + +----- AuxJ basis set information ----- +Your calculation utilizes the auxiliary basis: def2/J + F. Weigend, Phys. Chem. Chem. Phys. 8, 1057 (2006). + +================================================================================ + WARNINGS + Please study these warnings very carefully! +================================================================================ + + +WARNING: your system is open-shell and RHF/RKS was chosen + ===> : WILL SWITCH to UHF/UKS + + +INFO : the flag for use of the SHARK integral package has been found! + +================================================================================ + INPUT FILE +================================================================================ +NAME = AJALIH_5_SPE.inp +| 1> ! TPSSh D3BJ RIJCOSX def2-TZVP def2/J Slowconv Hirshfeld +| 2> %PAL NPROCS 64 END +| 3> %scf +| 4> MaxIter 1500 +| 5> SOSCFStart 0.00033 +| 6> end +| 7> +| 8> *xyzfile 0 5 AJALIH.xyz +| 9> +| 10> ****END OF INPUT**** +================================================================================ + + **************************** + * Single Point Calculation * + **************************** + +--------------------------------- +CARTESIAN COORDINATES (ANGSTROEM) +--------------------------------- + Fe 0.140050 -0.960280 0.248600 + Br 0.047600 -2.717700 -1.350520 + Br 0.510980 -1.669250 2.489940 + P -1.670450 0.646300 0.041540 + P 1.491370 1.004070 -0.306910 + N -0.939080 2.010590 -0.662280 + N 0.405530 2.319970 -0.341540 + H 0.454330 2.856590 0.532750 + C -2.552040 1.051180 1.622530 + H -2.909530 0.060970 1.963460 + C -1.544120 1.566080 2.634970 + H -2.015750 1.689080 3.625140 + H -1.158220 2.559270 2.336840 + H -0.693420 0.874230 2.749060 + C -3.727340 2.015250 1.487990 + H -4.188470 2.188530 2.476120 + H -4.519000 1.639880 0.819330 + H -3.396640 2.996550 1.106530 + C -3.006940 0.251470 -1.157040 + H -3.732050 1.085180 -1.138590 + C -2.445340 0.093840 -2.583960 + H -3.266430 -0.159430 -3.276170 + H -1.706600 -0.723760 -2.612260 + H -1.958530 1.011060 -2.946400 + C -3.712050 -1.031920 -0.701230 + H -4.504410 -1.300550 -1.420330 + H -4.184840 -0.928530 0.289440 + H -2.994920 -1.869410 -0.658240 + C -1.638400 3.167640 -1.223000 + H -1.098470 3.521870 -2.117760 + H -1.702790 4.007810 -0.502050 + H -2.660910 2.886080 -1.511560 + C 2.683230 1.671700 0.941880 + H 2.010240 1.869590 1.799060 + C 3.700790 0.625350 1.408450 + H 4.244370 1.007590 2.289290 + H 4.448360 0.404400 0.630770 + H 3.200720 -0.313730 1.697850 + C 3.361160 2.981450 0.510650 + H 3.920040 3.411330 1.359700 + H 2.641300 3.737390 0.156150 + H 4.085320 2.800490 -0.301400 + C 2.310220 1.036310 -1.960460 + H 2.771560 2.032840 -2.076460 + C 3.355560 -0.074190 -2.025370 + H 3.751740 -0.156930 -3.052160 + H 2.901400 -1.046850 -1.766540 + H 4.211700 0.097570 -1.355270 + C 1.262930 0.808060 -3.035060 + H 1.736520 0.821470 -4.032210 + H 0.477480 1.580870 -3.022290 + H 0.779390 -0.173710 -2.899810 + +---------------------------- +CARTESIAN COORDINATES (A.U.) +---------------------------- + NO LB ZA FRAG MASS X Y Z + 0 Fe 26.0000 0 55.850 0.264656 -1.814666 0.469786 + 1 Br 35.0000 0 79.900 0.089951 -5.135709 -2.552113 + 2 Br 35.0000 0 79.900 0.965612 -3.154425 4.705305 + 3 P 15.0000 0 30.974 -3.156693 1.221330 0.078499 + 4 P 15.0000 0 30.974 2.818281 1.897417 -0.579976 + 5 N 7.0000 0 14.007 -1.774604 3.799464 -1.251528 + 6 N 7.0000 0 14.007 0.766341 4.384108 -0.645417 + 7 H 1.0000 0 1.008 0.858559 5.398173 1.006752 + 8 C 6.0000 0 12.011 -4.822657 1.986442 3.066137 + 9 H 1.0000 0 1.008 -5.498215 0.115217 3.710402 + 10 C 6.0000 0 12.011 -2.917964 2.959462 4.979372 + 11 H 1.0000 0 1.008 -3.809215 3.191899 6.850522 + 12 H 1.0000 0 1.008 -2.188719 4.836319 4.415988 + 13 H 1.0000 0 1.008 -1.310374 1.652055 5.194971 + 14 C 6.0000 0 12.011 -7.043652 3.808271 2.811894 + 15 H 1.0000 0 1.008 -7.915061 4.135722 4.679189 + 16 H 1.0000 0 1.008 -8.539672 3.098924 1.548309 + 17 H 1.0000 0 1.008 -6.418719 5.662659 2.091039 + 18 C 6.0000 0 12.011 -5.682293 0.475209 -2.186489 + 19 H 1.0000 0 1.008 -7.052552 2.050693 -2.151623 + 20 C 6.0000 0 12.011 -4.621023 0.177332 -4.882977 + 21 H 1.0000 0 1.008 -6.172658 -0.301279 -6.191064 + 22 H 1.0000 0 1.008 -3.225007 -1.367708 -4.936456 + 23 H 1.0000 0 1.008 -3.701085 1.910627 -5.567889 + 24 C 6.0000 0 12.011 -7.014758 -1.950046 -1.325133 + 25 H 1.0000 0 1.008 -8.512101 -2.457683 -2.684035 + 26 H 1.0000 0 1.008 -7.908202 -1.754667 0.546962 + 27 H 1.0000 0 1.008 -5.659579 -3.532673 -1.243893 + 28 C 6.0000 0 12.011 -3.096127 5.985972 -2.311135 + 29 H 1.0000 0 1.008 -2.075807 6.655370 -4.001986 + 30 H 1.0000 0 1.008 -3.217807 7.573663 -0.948737 + 31 H 1.0000 0 1.008 -5.028391 5.453901 -2.856434 + 32 C 6.0000 0 12.011 5.070570 3.159055 1.779895 + 33 H 1.0000 0 1.008 3.798803 3.533013 3.399731 + 34 C 6.0000 0 12.011 6.993480 1.181740 2.661585 + 35 H 1.0000 0 1.008 8.020697 1.904069 4.326131 + 36 H 1.0000 0 1.008 8.406182 0.764205 1.191983 + 37 H 1.0000 0 1.008 6.048484 -0.592864 3.208472 + 38 C 6.0000 0 12.011 6.351672 5.634124 0.964989 + 39 H 1.0000 0 1.008 7.407802 6.446479 2.569461 + 40 H 1.0000 0 1.008 4.991334 7.062644 0.295081 + 41 H 1.0000 0 1.008 7.720136 5.292159 -0.569563 + 42 C 6.0000 0 12.011 4.365683 1.958342 -3.704732 + 43 H 1.0000 0 1.008 5.237489 3.841511 -3.923941 + 44 C 6.0000 0 12.011 6.341089 -0.140199 -3.827395 + 45 H 1.0000 0 1.008 7.089761 -0.296555 -5.767747 + 46 H 1.0000 0 1.008 5.482851 -1.978260 -3.338277 + 47 H 1.0000 0 1.008 7.958960 0.184381 -2.561089 + 48 C 6.0000 0 12.011 2.386592 1.527012 -5.735432 + 49 H 1.0000 0 1.008 3.281547 1.552353 -7.619773 + 50 H 1.0000 0 1.008 0.902306 2.987411 -5.711300 + 51 H 1.0000 0 1.008 1.472834 -0.328264 -5.479847 + +-------------------------------- +INTERNAL COORDINATES (ANGSTROEM) +-------------------------------- + Fe 0 0 0 0.000000000000 0.00000000 0.00000000 + Br 1 0 0 2.377868127820 0.00000000 0.00000000 + Br 1 2 0 2.379880778821 114.78671518 0.00000000 + P 1 2 3 2.429379219060 113.73241454 227.43649322 + P 1 2 3 2.448127452769 117.50889906 134.09761416 + N 4 1 2 1.700456372095 104.20072547 254.80517459 + N 6 4 1 1.416533156725 119.32582981 326.20902948 + H 7 6 4 1.026998280670 110.60862809 275.98544973 + C 4 1 2 1.854901108577 115.20786365 131.11380519 + H 9 4 1 1.106593063913 102.75693112 302.28293480 + C 9 4 1 1.518571529432 109.07526128 56.94288838 + H 11 9 4 1.103630592997 110.62881567 187.46335421 + H 11 9 4 1.106447776897 110.86761789 69.03968503 + H 11 9 4 1.102435231930 111.61568505 307.58554133 + C 9 4 1 1.526060964215 115.39049244 182.44906399 + H 15 9 4 1.104114003262 109.99246977 179.65845572 + H 15 9 4 1.102149893662 113.04912265 59.81770045 + H 15 9 4 1.103550593131 111.18851004 298.19121898 + C 4 1 2 1.838121395719 117.09040304 7.06109635 + H 19 4 1 1.105077951413 107.70717401 180.95961988 + C 19 4 1 1.541538991820 111.14071316 300.74294536 + H 21 19 4 1.103398914763 109.45512999 179.02676329 + H 21 19 4 1.102273758011 110.10684567 60.20466790 + H 21 19 4 1.099836014186 112.39641776 299.41284111 + C 19 4 1 1.533633841665 108.67766216 63.07327899 + H 25 19 4 1.103223121812 109.89219086 181.29187936 + H 25 19 4 1.102563796385 112.68886343 61.44568840 + H 25 19 4 1.103409750319 110.36038306 300.16942984 + C 6 4 1 1.463632495984 125.96673378 167.98659449 + H 29 6 4 1.103448573972 109.30724659 217.07244104 + H 29 6 4 1.108963752113 112.18542266 97.05244357 + H 29 6 4 1.099122198529 110.03307283 336.66212055 + C 5 1 2 1.850874533997 119.45743698 227.85333263 + H 33 5 1 1.107625182361 101.26411745 302.88784403 + C 33 5 1 1.532306836440 112.75237523 56.71672755 + H 35 33 5 1.103388299557 109.49154750 191.53799234 + H 35 33 5 1.101120333933 111.88978905 72.59914305 + H 35 33 5 1.102584967837 111.12059100 310.75132005 + C 33 5 1 1.536552459339 113.71726379 185.60819795 + H 39 33 5 1.103643770109 109.84837892 170.39527882 + H 39 33 5 1.102412787117 112.74608398 49.74316583 + H 39 33 5 1.102986595431 110.88188337 288.85931339 + C 5 1 2 1.845476183157 117.53232220 2.21342811 + H 43 5 1 1.104247543126 107.17339044 173.68773775 + C 43 5 1 1.526485923191 109.22278735 294.57874500 + H 45 43 5 1.103676675526 109.87183163 172.11858178 + H 45 43 5 1.104229029731 110.43761535 53.77613715 + H 45 43 5 1.100686698021 113.15649920 292.13428076 + C 43 5 1 1.517787721192 109.00092712 54.12108206 + H 49 43 5 1.103981629693 109.97810277 180.15486347 + H 49 43 5 1.101966456613 112.21921728 60.01048741 + H 49 43 5 1.102712939527 110.46416585 299.32452656 + +--------------------------- +INTERNAL COORDINATES (A.U.) +--------------------------- + Fe 0 0 0 0.000000000000 0.00000000 0.00000000 + Br 1 0 0 4.493519544159 0.00000000 0.00000000 + Br 1 2 0 4.497322903354 114.78671518 0.00000000 + P 1 2 3 4.590861399463 113.73241454 227.43649322 + P 1 2 3 4.626290426667 117.50889906 134.09761416 + N 4 1 2 3.213396845942 104.20072547 254.80517459 + N 6 4 1 2.676859725828 119.32582981 326.20902948 + H 7 6 4 1.940745490475 110.60862809 275.98544973 + C 4 1 2 3.505255100717 115.20786365 131.11380519 + H 9 4 1 2.091157832492 102.75693112 302.28293480 + C 9 4 1 2.869684305396 109.07526128 56.94288838 + H 11 9 4 2.085559573782 110.62881567 187.46335421 + H 11 9 4 2.090883279821 110.86761789 69.03968503 + H 11 9 4 2.083300668733 111.61568505 307.58554133 + C 9 4 1 2.883837286034 115.39049244 182.44906399 + H 15 9 4 2.086473086793 109.99246977 179.65845572 + H 15 9 4 2.082761457552 113.04912265 59.81770045 + H 15 9 4 2.085408395944 111.18851004 298.19121898 + C 4 1 2 3.473546038810 117.09040304 7.06109635 + H 19 4 1 2.088294684806 107.70717401 180.95961988 + C 19 4 1 2.913086519300 111.14071316 300.74294536 + H 21 19 4 2.085121765368 109.45512999 179.02676329 + H 21 19 4 2.082995527249 110.10684567 60.20466790 + H 21 19 4 2.078388859035 112.39641776 299.41284111 + C 19 4 1 2.898147950460 108.67766216 63.07327899 + H 25 19 4 2.084789564834 109.89219086 181.29187936 + H 25 19 4 2.083543620345 112.68886343 61.44568840 + H 25 19 4 2.085142241602 110.36038306 300.16942984 + C 6 4 1 2.765864578117 125.96673378 167.98659449 + H 29 6 4 2.085215607672 109.30724659 217.07244104 + H 29 6 4 2.095637783939 112.18542266 97.05244357 + H 29 6 4 2.077039942934 110.03307283 336.66212055 + C 5 1 2 3.497645977504 119.45743698 227.85333263 + H 33 5 1 2.093108253697 101.26411745 302.88784403 + C 33 5 1 2.895640274006 112.75237523 56.71672755 + H 35 33 5 2.085101705536 109.49154750 191.53799234 + H 35 33 5 2.080815871625 111.88978905 72.59914305 + H 35 33 5 2.083583628590 111.12059100 310.75132005 + C 33 5 1 2.903663338553 113.71726379 185.60819795 + H 39 33 5 2.085584474914 109.84837892 170.39527882 + H 39 33 5 2.083258254185 112.74608398 49.74316583 + H 39 33 5 2.084342594750 110.88188337 288.85931339 + C 5 1 2 3.487444572841 117.53232220 2.21342811 + H 43 5 1 2.086725440564 107.17339044 173.68773775 + C 43 5 1 2.884640342117 109.22278735 294.57874500 + H 45 43 5 2.085646657141 109.87183163 172.11858178 + H 45 43 5 2.086690455317 110.43761535 53.77613715 + H 45 43 5 2.079996418509 113.15649920 292.13428076 + C 43 5 1 2.868203122481 109.00092712 54.12108206 + H 49 43 5 2.086222937000 109.97810277 180.15486347 + H 49 43 5 2.082414811766 112.21921728 60.01048741 + H 49 43 5 2.083825460037 110.46416585 299.32452656 + +--------------------- +BASIS SET INFORMATION +--------------------- +There are 6 groups of distinct atoms + + Group 1 Type Fe : 17s11p7d1f contracted to 6s4p4d1f pattern {842111/6311/4111/1} + Group 2 Type Br : 17s13p8d1f contracted to 6s5p4d1f pattern {842111/64111/5111/1} + Group 3 Type P : 14s9p3d1f contracted to 5s5p2d1f pattern {73211/51111/21/1} + Group 4 Type N : 11s6p2d1f contracted to 5s3p2d1f pattern {62111/411/11/1} + Group 5 Type H : 5s1p contracted to 3s1p pattern {311/1} + Group 6 Type C : 11s6p2d1f contracted to 5s3p2d1f pattern {62111/411/11/1} + +Atom 0Fe basis set group => 1 +Atom 1Br basis set group => 2 +Atom 2Br basis set group => 2 +Atom 3P basis set group => 3 +Atom 4P basis set group => 3 +Atom 5N basis set group => 4 +Atom 6N basis set group => 4 +Atom 7H basis set group => 5 +Atom 8C basis set group => 6 +Atom 9H basis set group => 5 +Atom 10C basis set group => 6 +Atom 11H basis set group => 5 +Atom 12H basis set group => 5 +Atom 13H basis set group => 5 +Atom 14C basis set group => 6 +Atom 15H basis set group => 5 +Atom 16H basis set group => 5 +Atom 17H basis set group => 5 +Atom 18C basis set group => 6 +Atom 19H basis set group => 5 +Atom 20C basis set group => 6 +Atom 21H basis set group => 5 +Atom 22H basis set group => 5 +Atom 23H basis set group => 5 +Atom 24C basis set group => 6 +Atom 25H basis set group => 5 +Atom 26H basis set group => 5 +Atom 27H basis set group => 5 +Atom 28C basis set group => 6 +Atom 29H basis set group => 5 +Atom 30H basis set group => 5 +Atom 31H basis set group => 5 +Atom 32C basis set group => 6 +Atom 33H basis set group => 5 +Atom 34C basis set group => 6 +Atom 35H basis set group => 5 +Atom 36H basis set group => 5 +Atom 37H basis set group => 5 +Atom 38C basis set group => 6 +Atom 39H basis set group => 5 +Atom 40H basis set group => 5 +Atom 41H basis set group => 5 +Atom 42C basis set group => 6 +Atom 43H basis set group => 5 +Atom 44C basis set group => 6 +Atom 45H basis set group => 5 +Atom 46H basis set group => 5 +Atom 47H basis set group => 5 +Atom 48C basis set group => 6 +Atom 49H basis set group => 5 +Atom 50H basis set group => 5 +Atom 51H basis set group => 5 +--------------------------------- +AUXILIARY/J BASIS SET INFORMATION +--------------------------------- +There are 6 groups of distinct atoms + + Group 1 Type Fe : 19s5p5d3f3g contracted to 8s5p5d2f3g pattern {121111111/11111/11111/21/111} + Group 2 Type Br : 19s5p5d3f1g contracted to 8s4p3d2f1g pattern {121111111/2111/311/21/1} + Group 3 Type P : 14s5p5d2f1g contracted to 8s4p3d1f1g pattern {71111111/2111/311/2/1} + Group 4 Type N : 12s5p4d2f1g contracted to 6s4p3d1f1g pattern {711111/2111/211/2/1} + Group 5 Type H : 5s2p1d contracted to 3s1p1d pattern {311/2/1} + Group 6 Type C : 12s5p4d2f1g contracted to 6s4p3d1f1g pattern {711111/2111/211/2/1} + +Atom 0Fe basis set group => 1 +Atom 1Br basis set group => 2 +Atom 2Br basis set group => 2 +Atom 3P basis set group => 3 +Atom 4P basis set group => 3 +Atom 5N basis set group => 4 +Atom 6N basis set group => 4 +Atom 7H basis set group => 5 +Atom 8C basis set group => 6 +Atom 9H basis set group => 5 +Atom 10C basis set group => 6 +Atom 11H basis set group => 5 +Atom 12H basis set group => 5 +Atom 13H basis set group => 5 +Atom 14C basis set group => 6 +Atom 15H basis set group => 5 +Atom 16H basis set group => 5 +Atom 17H basis set group => 5 +Atom 18C basis set group => 6 +Atom 19H basis set group => 5 +Atom 20C basis set group => 6 +Atom 21H basis set group => 5 +Atom 22H basis set group => 5 +Atom 23H basis set group => 5 +Atom 24C basis set group => 6 +Atom 25H basis set group => 5 +Atom 26H basis set group => 5 +Atom 27H basis set group => 5 +Atom 28C basis set group => 6 +Atom 29H basis set group => 5 +Atom 30H basis set group => 5 +Atom 31H basis set group => 5 +Atom 32C basis set group => 6 +Atom 33H basis set group => 5 +Atom 34C basis set group => 6 +Atom 35H basis set group => 5 +Atom 36H basis set group => 5 +Atom 37H basis set group => 5 +Atom 38C basis set group => 6 +Atom 39H basis set group => 5 +Atom 40H basis set group => 5 +Atom 41H basis set group => 5 +Atom 42C basis set group => 6 +Atom 43H basis set group => 5 +Atom 44C basis set group => 6 +Atom 45H basis set group => 5 +Atom 46H basis set group => 5 +Atom 47H basis set group => 5 +Atom 48C basis set group => 6 +Atom 49H basis set group => 5 +Atom 50H basis set group => 5 +Atom 51H basis set group => 5 + + + ************************************************************ + * Program running with 64 parallel MPI-processes * + * working on a common directory * + ************************************************************ +------------------------------------------------------------------------------ + ORCA GTO INTEGRAL CALCULATION + -- RI-GTO INTEGRALS CHOSEN -- +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ + ___ + / \ - P O W E R E D B Y - + / \ + | | | _ _ __ _____ __ __ + | | | | | | | / \ | _ \ | | / | + \ \/ | | | | / \ | | | | | | / / + / \ \ | |__| | / /\ \ | |_| | | |/ / + | | | | __ | / /__\ \ | / | \ + | | | | | | | | __ | | \ | |\ \ + \ / | | | | | | | | | |\ \ | | \ \ + \___/ |_| |_| |__| |__| |_| \__\ |__| \__/ + + - O R C A' S B I G F R I E N D - + & + - I N T E G R A L F E E D E R - + + v1 FN, 2020, v2 2021 +------------------------------------------------------------------------------ + + +Reading SHARK input file AJALIH_5_SPE.SHARKINP.tmp ... ok +---------------------- +SHARK INTEGRAL PACKAGE +---------------------- + +Number of atoms ... 52 +Number of basis functions ... 872 +Number of shells ... 366 +Maximum angular momentum ... 3 +Integral batch strategy ... SHARK/LIBINT Hybrid +RI-J (if used) integral strategy ... SPLIT-RIJ (Revised 2003 algorithm where possible) +Printlevel ... 1 +Contraction scheme used ... SEGMENTED contraction +Coulomb Range Separation ... NOT USED +Exchange Range Separation ... NOT USED +Finite Nucleus Model ... NOT USED +Auxiliary Coulomb fitting basis ... AVAILABLE + # of basis functions in Aux-J ... 1394 + # of shells in Aux-J ... 478 + Maximum angular momentum in Aux-J ... 4 +Auxiliary J/K fitting basis ... NOT available +Auxiliary Correlation fitting basis ... NOT available +Auxiliary 'external' fitting basis ... NOT available +Integral threshold ... 1.000000e-10 +Primitive cut-off ... 1.000000e-11 +Primitive pair pre-selection threshold ... 1.000000e-11 + +Calculating pre-screening integrals ... done ( 0.0 sec) Dimension = 366 +Organizing shell pair data ... done ( 1.3 sec) +Shell pair information +Total number of shell pairs ... 67161 +Shell pairs after pre-screening ... 47334 +Total number of primitive shell pairs ... 218819 +Primitive shell pairs kept ... 96922 + la=0 lb=0: 13899 shell pairs + la=1 lb=0: 14178 shell pairs + la=1 lb=1: 3701 shell pairs + la=2 lb=0: 6494 shell pairs + la=2 lb=1: 3374 shell pairs + la=2 lb=2: 821 shell pairs + la=3 lb=0: 2646 shell pairs + la=3 lb=1: 1410 shell pairs + la=3 lb=2: 662 shell pairs + la=3 lb=3: 149 shell pairs + +Calculating one electron integrals ... done ( 0.1 sec) +Calculating RI/J V-Matrix + Cholesky decomp.... done ( 0.2 sec) +Calculating Nuclear repulsion ... done ( 0.0 sec) ENN= 4054.696254121859 Eh + +SHARK setup successfully completed in 2.1 seconds + +Maximum memory used throughout the entire GTOINT-calculation: 69.9 MB + + + ************************************************************ + * Program running with 64 parallel MPI-processes * + * working on a common directory * + ************************************************************ +------------------------------------------------------------------------------- + ORCA SCF +------------------------------------------------------------------------------- + +------------ +SCF SETTINGS +------------ +Hamiltonian: + Density Functional Method .... DFT(GTOs) + Exchange Functional Exchange .... TPSS + Correlation Functional Correlation .... TPSS + LDA part of GGA corr. LDAOpt .... PW91-LDA + Gradients option PostSCFGGA .... off + Hybrid DFT is turned on + Fraction HF Exchange ScalHFX .... 0.100000 + Scaling of DF-GGA-X ScalDFX .... 0.900000 + Scaling of DF-GGA-C ScalDFC .... 1.000000 + Scaling of DF-LDA-C ScalLDAC .... 1.000000 + Perturbative correction .... 0.000000 + Density functional embedding theory .... OFF + NL short-range parameter .... 5.200000 + RI-approximation to the Coulomb term is turned on + Number of AuxJ basis functions .... 1394 + RIJ-COSX (HFX calculated with COS-X)).... on + + +General Settings: + Integral files IntName .... AJALIH_5_SPE + Hartree-Fock type HFTyp .... UHF + Total Charge Charge .... 0 + Multiplicity Mult .... 5 + Number of Electrons NEL .... 250 + Basis Dimension Dim .... 872 + Nuclear Repulsion ENuc .... 4054.6962541219 Eh + +Convergence Acceleration: + DIIS CNVDIIS .... on + Start iteration DIISMaxIt .... 0 + Startup error DIISStart .... 0.200000 + # of expansion vecs DIISMaxEq .... 5 + Bias factor DIISBfac .... 1.050 + Max. coefficient DIISMaxC .... 10.000 + Trust-Rad. Augm. Hess. CNVTRAH .... auto + Auto Start mean grad. ratio tolernc. .... 1.125000 + Auto Start start iteration .... 20 + Auto Start num. interpolation iter. .... 10 + Max. Number of Micro iterations .... 16 + Max. Number of Macro iterations .... Maxiter - #DIIS iter + Number of Davidson start vectors .... 2 + Converg. threshold I (grad. norm) .... 5.000e-05 + Converg. threshold II (energy diff.) .... 1.000e-06 + Grad. Scal. Fac. for Micro threshold .... 0.100 + Minimum threshold for Micro iter. .... 0.010 + NR start threshold (gradient norm) .... 0.001 + Initial trust radius .... 0.400 + Minimum AH scaling param. (alpha) .... 1.000 + Maximum AH scaling param. (alpha) .... 1000.000 + Orbital update algorithm .... Taylor + White noise on init. David. guess .... on + Maximum white noise .... 0.010 + Quad. conv. algorithm .... NR + SOSCF CNVSOSCF .... off + Level Shifting CNVShift .... on + Level shift para. LevelShift .... 0.2500 + Turn off err/grad. ShiftErr .... 0.0000 + Zerner damping CNVZerner .... off + Static damping CNVDamp .... on + Fraction old density DampFac .... 0.8500 + Max. Damping (<1) DampMax .... 0.9800 + Min. Damping (>=0) DampMin .... 0.0000 + Turn off err/grad. DampErr .... 0.0300 + Fernandez-Rico CNVRico .... off + +SCF Procedure: + Maximum # iterations MaxIter .... 1500 + SCF integral mode SCFMode .... Direct + Integral package .... SHARK and LIBINT hybrid scheme + Reset frequency DirectResetFreq .... 20 + Integral Threshold Thresh .... 1.000e-10 Eh + Primitive CutOff TCut .... 1.000e-11 Eh + +Convergence Tolerance: + Convergence Check Mode ConvCheckMode .... Total+1el-Energy + Convergence forced ConvForced .... 0 + Energy Change TolE .... 1.000e-06 Eh + 1-El. energy change .... 1.000e-03 Eh + DIIS Error TolErr .... 1.000e-06 + + +Diagonalization of the overlap matrix: +Smallest eigenvalue ... 1.187e-04 +Time for diagonalization ... 0.143 sec +Threshold for overlap eigenvalues ... 1.000e-08 +Number of eigenvalues below threshold ... 0 +Time for construction of square roots ... 0.139 sec +Total time needed ... 0.287 sec + +Time for model grid setup = 0.238 sec + +------------------------------ +INITIAL GUESS: MODEL POTENTIAL +------------------------------ +Loading Hartree-Fock densities ... done +Calculating cut-offs ... done +Initializing the effective Hamiltonian ... done +Setting up the integral package (SHARK) ... done +Starting the Coulomb interaction ... done ( 0.2 sec) +Reading the grid ... done +Mapping shells ... done +Starting the XC term evaluation ... done ( 0.0 sec) + promolecular density results + # of electrons = 249.987588367 + EX = -366.904033437 + EC = -9.882246770 + EX+EC = -376.786280207 +Transforming the Hamiltonian ... done ( 0.1 sec) +Diagonalizing the Hamiltonian ... done ( 0.1 sec) +Back transforming the eigenvectors ... done ( 0.0 sec) +Now organizing SCF variables ... done + ------------------ + INITIAL GUESS DONE ( 0.8 sec) + ------------------ +------------------- +DFT GRID GENERATION +------------------- + +General Integration Accuracy IntAcc ... 4.388 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 4 (Lebedev-302) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... off +Rotationally invariant grid construction ... off + +Total number of grid points ... 237023 +Total number of batches ... 3727 +Average number of points per batch ... 63 +Average number of grid points per atom ... 4558 +Time for grid setup = 1.140 sec + +-------------------- +COSX GRID GENERATION +-------------------- + +GRIDX 1 +------- +General Integration Accuracy IntAcc ... 3.816 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 1 (Lebedev-50) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... on +Rotationally invariant grid construction ... off + +Total number of grid points ... 29474 +Total number of batches ... 487 +Average number of points per batch ... 60 +Average number of grid points per atom ... 567 +UseSFitting ... on + +GRIDX 2 +------- +General Integration Accuracy IntAcc ... 4.020 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 2 (Lebedev-110) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... on +Rotationally invariant grid construction ... off + +Total number of grid points ... 60556 +Total number of batches ... 971 +Average number of points per batch ... 62 +Average number of grid points per atom ... 1165 +UseSFitting ... on + +GRIDX 3 +------- +General Integration Accuracy IntAcc ... 4.338 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 3 (Lebedev-194) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-10 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... on +Rotationally invariant grid construction ... off + +Total number of grid points ... 132098 +Total number of batches ... 2090 +Average number of points per batch ... 63 +Average number of grid points per atom ... 2540 +UseSFitting ... on + +Time for X-Grid setup = 1.276 sec + +-------------- +SCF ITERATIONS +-------------- +ITER Energy Delta-E Max-DP RMS-DP [F,P] Damp + *** Starting incremental Fock matrix formation *** + 0 -7718.5652013167 0.000000000000 0.02406219 0.00015838 0.0913297 0.8500 + 1 -7718.7537397451 -0.188538428401 0.02020405 0.00015585 0.0647958 0.8500 + ***Turning on DIIS*** + 2 -7718.8637380911 -0.109998345984 0.01304625 0.00011654 0.0457493 0.8500 + 3 -7718.9321869834 -0.068448892275 0.00812446 0.00007291 0.0543336 0.8500 + 4 -7718.9850672443 -0.052880260962 0.00554954 0.00005173 0.0365569 0.8500 + 5 -7719.0259409652 -0.040873720895 0.03791379 0.00028164 0.0280224 0.0000 + 6 -7719.2401157969 -0.214174831638 0.01529020 0.00005311 0.0120665 0.0000 + 7 -7719.2410980947 -0.000982297839 0.00443888 0.00002609 0.0145723 0.0000 + 8 -7719.2421734895 -0.001075394822 0.00637749 0.00001919 0.0060287 0.0000 + 9 -7719.2424646398 -0.000291150297 0.00335002 0.00001113 0.0010634 0.0000 + 10 -7719.2425697761 -0.000105136259 0.00113999 0.00000606 0.0006381 0.0000 + *** Restarting incremental Fock matrix formation *** + *** Resetting DIIS *** + 11 -7719.2426085404 -0.000038764321 0.00059356 0.00000360 0.0004361 0.0000 + 12 -7719.2426209873 -0.000012446871 0.00059169 0.00000237 0.0007841 0.0000 + 13 -7719.2426295861 -0.000008598804 0.00047990 0.00000178 0.0003571 0.0000 + 14 -7719.2426339042 -0.000004318120 0.00051279 0.00000174 0.0004240 0.0000 + 15 -7719.2426379942 -0.000004089995 0.00047078 0.00000129 0.0002957 0.0000 + 16 -7719.2426407845 -0.000002790280 0.00043037 0.00000108 0.0002615 0.0000 + 17 -7719.2426421973 -0.000001412795 0.00045539 0.00000113 0.0002300 0.0000 + 18 -7719.2426440459 -0.000001848627 0.00039360 0.00000096 0.0002024 0.0000 + 19 -7719.2426453767 -0.000001330855 0.00040629 0.00000101 0.0001735 0.0000 + 20 -7719.2426460758 -0.000000699079 0.00025091 0.00000063 0.0001475 0.0000 + 21 -7719.2426468403 -0.000000764503 0.00042540 0.00000109 0.0001226 0.0000 + **** Energy Check signals convergence **** + + ***************************************************** + * SUCCESS * + * SCF CONVERGED AFTER 22 CYCLES * + ***************************************************** + +Old exchange energy = -37.096589473 Eh +New exchange energy = -37.096503369 Eh +Exchange energy change after final integration = 0.000086104 Eh +Total energy after final integration = -7719.242561165 Eh +Final COS-X integration done in = 4.774 sec + +---------------- +TOTAL SCF ENERGY +---------------- + +Total Energy : -7719.24256116 Eh -210051.26889 eV + +Components: +Nuclear Repulsion : 4054.69625412 Eh 110333.89434 eV +Electronic Energy : -11773.93881529 Eh -320385.16323 eV +One Electron Energy: -18788.83887919 Eh -511270.29838 eV +Two Electron Energy: 7014.90006390 Eh 190885.13515 eV +Max COSX asymmetry : 0.00000557 Eh 0.00015 eV + +Virial components: +Potential Energy : -15424.12364839 Eh -419711.74221 eV +Kinetic Energy : 7704.88108723 Eh 209660.47332 eV +Virial Ratio : 2.00186394 + + +DFT components: +N(Alpha) : 127.000133372245 electrons +N(Beta) : 123.000132953228 electrons +N(Total) : 250.000266325473 electrons +E(X) : -334.530291261352 Eh +E(C) : -9.848139111591 Eh +E(XC) : -344.378430372944 Eh +DFET-embed. en. : 0.000000000000 Eh + +--------------- +SCF CONVERGENCE +--------------- + + Last Energy change ... -4.2840e-07 Tolerance : 1.0000e-06 + Last MAX-Density change ... 0.0000e+00 Tolerance : 1.0000e-05 + Last RMS-Density change ... 0.0000e+00 Tolerance : 1.0000e-06 + Last DIIS Error ... 1.6257e-04 Tolerance : 1.0000e-06 + + **** THE GBW FILE WAS UPDATED (AJALIH_5_SPE.gbw) **** + **** DENSITY AJALIH_5_SPE.scfp WAS UPDATED **** + **** ENERGY FILE WAS UPDATED (AJALIH_5_SPE.en.tmp) **** +---------------------- +UHF SPIN CONTAMINATION +---------------------- + +Warning: in a DFT calculation there is little theoretical justification to + calculate as in Hartree-Fock theory. We will do it anyways + but you should keep in mind that the values have only limited relevance + +Expectation value of : 6.021928 +Ideal value S*(S+1) for S=2.0 : 6.000000 +Deviation : 0.021928 + + **** THE GBW FILE WAS UPDATED (AJALIH_5_SPE.gbw) **** + **** DENSITY AJALIH_5_SPE.scfp WAS UPDATED **** +---------------- +ORBITAL ENERGIES +---------------- + SPIN UP ORBITALS + NO OCC E(Eh) E(eV) + 0 1.0000 -482.493316 -13129.3106 + 1 1.0000 -482.493208 -13129.3077 + 2 1.0000 -255.860724 -6962.3243 + 3 1.0000 -76.959615 -2094.1776 + 4 1.0000 -76.957632 -2094.1236 + 5 1.0000 -62.206891 -1692.7355 + 6 1.0000 -62.206833 -1692.7340 + 7 1.0000 -55.991450 -1523.6048 + 8 1.0000 -55.991401 -1523.6035 + 9 1.0000 -55.990833 -1523.5880 + 10 1.0000 -55.990807 -1523.5873 + 11 1.0000 -55.990789 -1523.5868 + 12 1.0000 -55.990655 -1523.5832 + 13 1.0000 -29.908759 -813.8587 + 14 1.0000 -25.755240 -700.8357 + 15 1.0000 -25.734477 -700.2707 + 16 1.0000 -25.729548 -700.1366 + 17 1.0000 -14.301180 -389.1549 + 18 1.0000 -14.296308 -389.0223 + 19 1.0000 -10.165791 -276.6252 + 20 1.0000 -10.148957 -276.1672 + 21 1.0000 -10.140970 -275.9498 + 22 1.0000 -10.138231 -275.8753 + 23 1.0000 -10.135427 -275.7990 + 24 1.0000 -10.129816 -275.6463 + 25 1.0000 -10.126919 -275.5675 + 26 1.0000 -10.119285 -275.3597 + 27 1.0000 -10.117260 -275.3046 + 28 1.0000 -10.117146 -275.3015 + 29 1.0000 -10.114918 -275.2409 + 30 1.0000 -10.113652 -275.2065 + 31 1.0000 -10.112597 -275.1778 + 32 1.0000 -8.553721 -232.7586 + 33 1.0000 -8.553618 -232.7558 + 34 1.0000 -6.513128 -177.2312 + 35 1.0000 -6.510569 -177.1616 + 36 1.0000 -6.369317 -173.3179 + 37 1.0000 -6.369262 -173.3164 + 38 1.0000 -6.367371 -173.2650 + 39 1.0000 -6.367185 -173.2599 + 40 1.0000 -6.367167 -173.2594 + 41 1.0000 -6.367142 -173.2587 + 42 1.0000 -4.663185 -126.8917 + 43 1.0000 -4.661224 -126.8384 + 44 1.0000 -4.660567 -126.8205 + 45 1.0000 -4.659445 -126.7900 + 46 1.0000 -4.658683 -126.7692 + 47 1.0000 -4.657138 -126.7272 + 48 1.0000 -3.486967 -94.8852 + 49 1.0000 -2.494126 -67.8686 + 50 1.0000 -2.494059 -67.8668 + 51 1.0000 -2.493574 -67.8536 + 52 1.0000 -2.493441 -67.8500 + 53 1.0000 -2.493380 -67.8483 + 54 1.0000 -2.493368 -67.8480 + 55 1.0000 -2.491708 -67.8028 + 56 1.0000 -2.491648 -67.8012 + 57 1.0000 -2.491572 -67.7991 + 58 1.0000 -2.491515 -67.7976 + 59 1.0000 -2.294169 -62.4275 + 60 1.0000 -2.251162 -61.2572 + 61 1.0000 -2.238802 -60.9209 + 62 1.0000 -0.981592 -26.7105 + 63 1.0000 -0.830052 -22.5869 + 64 1.0000 -0.802953 -21.8495 + 65 1.0000 -0.784281 -21.3414 + 66 1.0000 -0.780453 -21.2372 + 67 1.0000 -0.776427 -21.1276 + 68 1.0000 -0.690985 -18.8027 + 69 1.0000 -0.686084 -18.6693 + 70 1.0000 -0.683639 -18.6028 + 71 1.0000 -0.682656 -18.5760 + 72 1.0000 -0.680234 -18.5101 + 73 1.0000 -0.675544 -18.3825 + 74 1.0000 -0.672708 -18.3053 + 75 1.0000 -0.648173 -17.6377 + 76 1.0000 -0.612450 -16.6656 + 77 1.0000 -0.585460 -15.9312 + 78 1.0000 -0.580840 -15.8054 + 79 1.0000 -0.551055 -14.9950 + 80 1.0000 -0.538528 -14.6541 + 81 1.0000 -0.498061 -13.5529 + 82 1.0000 -0.479782 -13.0555 + 83 1.0000 -0.475115 -12.9285 + 84 1.0000 -0.465521 -12.6675 + 85 1.0000 -0.455893 -12.4055 + 86 1.0000 -0.453849 -12.3499 + 87 1.0000 -0.446961 -12.1624 + 88 1.0000 -0.433392 -11.7932 + 89 1.0000 -0.428074 -11.6485 + 90 1.0000 -0.425090 -11.5673 + 91 1.0000 -0.413398 -11.2491 + 92 1.0000 -0.407955 -11.1010 + 93 1.0000 -0.407065 -11.0768 + 94 1.0000 -0.397434 -10.8147 + 95 1.0000 -0.392177 -10.6717 + 96 1.0000 -0.386459 -10.5161 + 97 1.0000 -0.385958 -10.5025 + 98 1.0000 -0.380185 -10.3454 + 99 1.0000 -0.376628 -10.2486 + 100 1.0000 -0.372693 -10.1415 + 101 1.0000 -0.367397 -9.9974 + 102 1.0000 -0.358983 -9.7684 + 103 1.0000 -0.349970 -9.5232 + 104 1.0000 -0.347976 -9.4689 + 105 1.0000 -0.347580 -9.4581 + 106 1.0000 -0.343495 -9.3470 + 107 1.0000 -0.340821 -9.2742 + 108 1.0000 -0.337746 -9.1905 + 109 1.0000 -0.337430 -9.1819 + 110 1.0000 -0.335708 -9.1351 + 111 1.0000 -0.334183 -9.0936 + 112 1.0000 -0.327960 -8.9242 + 113 1.0000 -0.323305 -8.7976 + 114 1.0000 -0.317785 -8.6474 + 115 1.0000 -0.314919 -8.5694 + 116 1.0000 -0.302616 -8.2346 + 117 1.0000 -0.285851 -7.7784 + 118 1.0000 -0.278089 -7.5672 + 119 1.0000 -0.255032 -6.9398 + 120 1.0000 -0.252318 -6.8659 + 121 1.0000 -0.251045 -6.8313 + 122 1.0000 -0.230404 -6.2696 + 123 1.0000 -0.228958 -6.2303 + 124 1.0000 -0.219544 -5.9741 + 125 1.0000 -0.209452 -5.6995 + 126 1.0000 -0.193629 -5.2689 + 127 0.0000 -0.014142 -0.3848 + 128 0.0000 -0.009754 -0.2654 + 129 0.0000 0.002396 0.0652 + 130 0.0000 0.014895 0.4053 + 131 0.0000 0.023651 0.6436 + 132 0.0000 0.034174 0.9299 + 133 0.0000 0.035424 0.9639 + 134 0.0000 0.039517 1.0753 + 135 0.0000 0.048714 1.3256 + 136 0.0000 0.052901 1.4395 + 137 0.0000 0.056760 1.5445 + 138 0.0000 0.064022 1.7421 + 139 0.0000 0.065275 1.7762 + 140 0.0000 0.067207 1.8288 + 141 0.0000 0.072574 1.9748 + 142 0.0000 0.076122 2.0714 + 143 0.0000 0.078590 2.1386 + 144 0.0000 0.083431 2.2703 + 145 0.0000 0.087349 2.3769 + 146 0.0000 0.090622 2.4660 + 147 0.0000 0.095094 2.5876 + 148 0.0000 0.099121 2.6972 + 149 0.0000 0.101903 2.7729 + 150 0.0000 0.106110 2.8874 + 151 0.0000 0.110309 3.0017 + 152 0.0000 0.113497 3.0884 + 153 0.0000 0.115813 3.1514 + 154 0.0000 0.118011 3.2113 + 155 0.0000 0.122434 3.3316 + 156 0.0000 0.125566 3.4168 + 157 0.0000 0.126853 3.4518 + 158 0.0000 0.130716 3.5570 + 159 0.0000 0.135573 3.6891 + 160 0.0000 0.137963 3.7542 + 161 0.0000 0.141217 3.8427 + 162 0.0000 0.142492 3.8774 + 163 0.0000 0.146074 3.9749 + 164 0.0000 0.151096 4.1115 + 165 0.0000 0.152886 4.1602 + 166 0.0000 0.155294 4.2258 + 167 0.0000 0.163006 4.4356 + 168 0.0000 0.164841 4.4856 + 169 0.0000 0.168444 4.5836 + 170 0.0000 0.170867 4.6495 + 171 0.0000 0.175786 4.7834 + 172 0.0000 0.178299 4.8518 + 173 0.0000 0.184332 5.0159 + 174 0.0000 0.186816 5.0835 + 175 0.0000 0.191027 5.1981 + 176 0.0000 0.192927 5.2498 + 177 0.0000 0.195954 5.3322 + 178 0.0000 0.198892 5.4121 + 179 0.0000 0.201015 5.4699 + 180 0.0000 0.205784 5.5997 + 181 0.0000 0.211269 5.7489 + 182 0.0000 0.213260 5.8031 + 183 0.0000 0.216077 5.8798 + 184 0.0000 0.222802 6.0628 + 185 0.0000 0.225916 6.1475 + 186 0.0000 0.229162 6.2358 + 187 0.0000 0.234655 6.3853 + 188 0.0000 0.241809 6.5800 + 189 0.0000 0.242383 6.5956 + 190 0.0000 0.247732 6.7411 + 191 0.0000 0.248652 6.7662 + 192 0.0000 0.255096 6.9415 + 193 0.0000 0.263207 7.1622 + 194 0.0000 0.269546 7.3347 + 195 0.0000 0.274503 7.4696 + 196 0.0000 0.277015 7.5380 + 197 0.0000 0.280095 7.6218 + 198 0.0000 0.287048 7.8110 + 199 0.0000 0.289255 7.8710 + 200 0.0000 0.290838 7.9141 + 201 0.0000 0.301849 8.2137 + 202 0.0000 0.303846 8.2681 + 203 0.0000 0.307477 8.3669 + 204 0.0000 0.311414 8.4740 + 205 0.0000 0.316226 8.6049 + 206 0.0000 0.320827 8.7302 + 207 0.0000 0.323729 8.8091 + 208 0.0000 0.327027 8.8989 + 209 0.0000 0.334677 9.1070 + 210 0.0000 0.337745 9.1905 + 211 0.0000 0.338933 9.2228 + 212 0.0000 0.351097 9.5538 + 213 0.0000 0.353328 9.6145 + 214 0.0000 0.356731 9.7071 + 215 0.0000 0.361378 9.8336 + 216 0.0000 0.366778 9.9805 + 217 0.0000 0.368975 10.0403 + 218 0.0000 0.376809 10.2535 + 219 0.0000 0.384055 10.4507 + 220 0.0000 0.386650 10.5213 + 221 0.0000 0.392057 10.6684 + 222 0.0000 0.395322 10.7573 + 223 0.0000 0.396401 10.7866 + 224 0.0000 0.400870 10.9082 + 225 0.0000 0.405817 11.0428 + 226 0.0000 0.406818 11.0701 + 227 0.0000 0.411033 11.1848 + 228 0.0000 0.412781 11.2324 + 229 0.0000 0.414562 11.2808 + 230 0.0000 0.417737 11.3672 + 231 0.0000 0.420609 11.4453 + 232 0.0000 0.425413 11.5761 + 233 0.0000 0.428509 11.6603 + 234 0.0000 0.431021 11.7287 + 235 0.0000 0.434064 11.8115 + 236 0.0000 0.436304 11.8724 + 237 0.0000 0.441091 12.0027 + 238 0.0000 0.441987 12.0271 + 239 0.0000 0.444722 12.1015 + 240 0.0000 0.449564 12.2333 + 241 0.0000 0.452823 12.3219 + 242 0.0000 0.453991 12.3537 + 243 0.0000 0.456443 12.4205 + 244 0.0000 0.458892 12.4871 + 245 0.0000 0.461289 12.5523 + 246 0.0000 0.462638 12.5890 + 247 0.0000 0.466357 12.6902 + 248 0.0000 0.471750 12.8370 + 249 0.0000 0.472222 12.8498 + 250 0.0000 0.474934 12.9236 + 251 0.0000 0.477808 13.0018 + 252 0.0000 0.485205 13.2031 + 253 0.0000 0.487302 13.2602 + 254 0.0000 0.490041 13.3347 + 255 0.0000 0.490911 13.3584 + 256 0.0000 0.496993 13.5239 + 257 0.0000 0.503633 13.7045 + 258 0.0000 0.508047 13.8247 + 259 0.0000 0.515168 14.0184 + 260 0.0000 0.518765 14.1163 + 261 0.0000 0.522930 14.2296 + 262 0.0000 0.525003 14.2861 + 263 0.0000 0.531346 14.4586 + 264 0.0000 0.533532 14.5181 + 265 0.0000 0.534132 14.5345 + 266 0.0000 0.541306 14.7297 + 267 0.0000 0.541687 14.7400 + 268 0.0000 0.548762 14.9326 + 269 0.0000 0.552694 15.0396 + 270 0.0000 0.555346 15.1117 + 271 0.0000 0.559626 15.2282 + 272 0.0000 0.559953 15.2371 + 273 0.0000 0.567085 15.4312 + 274 0.0000 0.571520 15.5518 + 275 0.0000 0.572769 15.5858 + 276 0.0000 0.578688 15.7469 + 277 0.0000 0.586957 15.9719 + 278 0.0000 0.591001 16.0819 + 279 0.0000 0.593322 16.1451 + 280 0.0000 0.602786 16.4026 + 281 0.0000 0.608061 16.5462 + 282 0.0000 0.621727 16.9181 + 283 0.0000 0.626599 17.0506 + 284 0.0000 0.629422 17.1274 + 285 0.0000 0.638088 17.3632 + 286 0.0000 0.639854 17.4113 + 287 0.0000 0.651133 17.7182 + 288 0.0000 0.653283 17.7767 + 289 0.0000 0.658772 17.9261 + 290 0.0000 0.663635 18.0584 + 291 0.0000 0.670491 18.2450 + 292 0.0000 0.678079 18.4515 + 293 0.0000 0.693575 18.8731 + 294 0.0000 0.696764 18.9599 + 295 0.0000 0.701404 19.0862 + 296 0.0000 0.706525 19.2255 + 297 0.0000 0.710767 19.3410 + 298 0.0000 0.712559 19.3897 + 299 0.0000 0.723233 19.6802 + 300 0.0000 0.737334 20.0639 + 301 0.0000 0.739985 20.1360 + 302 0.0000 0.745991 20.2995 + 303 0.0000 0.746647 20.3173 + 304 0.0000 0.754753 20.5379 + 305 0.0000 0.766237 20.8504 + 306 0.0000 0.777271 21.1506 + 307 0.0000 0.779415 21.2090 + 308 0.0000 0.789437 21.4817 + 309 0.0000 0.802119 21.8268 + 310 0.0000 0.802489 21.8368 + 311 0.0000 0.816552 22.2195 + 312 0.0000 0.817496 22.2452 + 313 0.0000 0.829925 22.5834 + 314 0.0000 0.838547 22.8180 + 315 0.0000 0.842667 22.9301 + 316 0.0000 0.852225 23.1902 + 317 0.0000 0.857811 23.3422 + 318 0.0000 0.861587 23.4450 + 319 0.0000 0.863923 23.5085 + 320 0.0000 0.871132 23.7047 + 321 0.0000 0.876360 23.8470 + 322 0.0000 0.881915 23.9981 + 323 0.0000 0.883783 24.0490 + 324 0.0000 0.893475 24.3127 + 325 0.0000 0.899130 24.4666 + 326 0.0000 0.906736 24.6735 + 327 0.0000 0.919626 25.0243 + 328 0.0000 0.927076 25.2270 + 329 0.0000 0.931766 25.3546 + 330 0.0000 0.943812 25.6824 + 331 0.0000 0.953759 25.9531 + 332 0.0000 0.958236 26.0749 + 333 0.0000 0.965298 26.2671 + 334 0.0000 0.969479 26.3809 + 335 0.0000 0.975196 26.5364 + 336 0.0000 0.983134 26.7524 + 337 0.0000 0.995099 27.0780 + 338 0.0000 1.000991 27.2383 + 339 0.0000 1.004701 27.3393 + 340 0.0000 1.010759 27.5041 + 341 0.0000 1.018734 27.7212 + 342 0.0000 1.026706 27.9381 + 343 0.0000 1.031409 28.0661 + 344 0.0000 1.032859 28.1055 + 345 0.0000 1.038510 28.2593 + 346 0.0000 1.043107 28.3844 + 347 0.0000 1.046955 28.4891 + 348 0.0000 1.056053 28.7367 + 349 0.0000 1.059697 28.8358 + 350 0.0000 1.067392 29.0452 + 351 0.0000 1.077395 29.3174 + 352 0.0000 1.084205 29.5027 + 353 0.0000 1.091232 29.6939 + 354 0.0000 1.095811 29.8185 + 355 0.0000 1.097462 29.8635 + 356 0.0000 1.105891 30.0928 + 357 0.0000 1.109566 30.1928 + 358 0.0000 1.120479 30.4898 + 359 0.0000 1.124178 30.5904 + 360 0.0000 1.139635 31.0111 + 361 0.0000 1.141149 31.0522 + 362 0.0000 1.147373 31.2216 + 363 0.0000 1.159422 31.5495 + 364 0.0000 1.173622 31.9359 + 365 0.0000 1.177686 32.0465 + 366 0.0000 1.190229 32.3878 + 367 0.0000 1.193600 32.4795 + 368 0.0000 1.199559 32.6417 + 369 0.0000 1.207121 32.8474 + 370 0.0000 1.213247 33.0141 + 371 0.0000 1.215885 33.0859 + 372 0.0000 1.228000 33.4156 + 373 0.0000 1.230384 33.4805 + 374 0.0000 1.237853 33.6837 + 375 0.0000 1.251472 34.0543 + 376 0.0000 1.256124 34.1809 + 377 0.0000 1.260613 34.3030 + 378 0.0000 1.273525 34.6544 + 379 0.0000 1.280352 34.8401 + 380 0.0000 1.291758 35.1505 + 381 0.0000 1.299716 35.3671 + 382 0.0000 1.301003 35.4021 + 383 0.0000 1.329571 36.1795 + 384 0.0000 1.341968 36.5168 + 385 0.0000 1.349560 36.7234 + 386 0.0000 1.371419 37.3182 + 387 0.0000 1.377136 37.4738 + 388 0.0000 1.391999 37.8782 + 389 0.0000 1.404451 38.2171 + 390 0.0000 1.416974 38.5578 + 391 0.0000 1.427442 38.8427 + 392 0.0000 1.427613 38.8473 + 393 0.0000 1.436410 39.0867 + 394 0.0000 1.445247 39.3272 + 395 0.0000 1.456992 39.6468 + 396 0.0000 1.462475 39.7960 + 397 0.0000 1.464773 39.8585 + 398 0.0000 1.469791 39.9951 + 399 0.0000 1.472828 40.0777 + 400 0.0000 1.476349 40.1735 + 401 0.0000 1.482355 40.3369 + 402 0.0000 1.483679 40.3730 + 403 0.0000 1.487740 40.4835 + 404 0.0000 1.495292 40.6890 + 405 0.0000 1.499601 40.8062 + 406 0.0000 1.507230 41.0138 + 407 0.0000 1.509028 41.0627 + 408 0.0000 1.517692 41.2985 + 409 0.0000 1.519006 41.3342 + 410 0.0000 1.523958 41.4690 + 411 0.0000 1.529770 41.6271 + 412 0.0000 1.533769 41.7360 + 413 0.0000 1.535062 41.7712 + 414 0.0000 1.541771 41.9537 + 415 0.0000 1.544169 42.0190 + 416 0.0000 1.546594 42.0850 + 417 0.0000 1.551335 42.2140 + 418 0.0000 1.554392 42.2972 + 419 0.0000 1.558095 42.3979 + 420 0.0000 1.560130 42.4533 + 421 0.0000 1.564373 42.5688 + 422 0.0000 1.567139 42.6440 + 423 0.0000 1.573872 42.8272 + 424 0.0000 1.574689 42.8495 + 425 0.0000 1.576700 42.9042 + 426 0.0000 1.578920 42.9646 + 427 0.0000 1.581087 43.0236 + 428 0.0000 1.584778 43.1240 + 429 0.0000 1.587607 43.2010 + 430 0.0000 1.589202 43.2444 + 431 0.0000 1.590633 43.2833 + 432 0.0000 1.595289 43.4100 + 433 0.0000 1.598157 43.4881 + 434 0.0000 1.599555 43.5261 + 435 0.0000 1.604382 43.6575 + 436 0.0000 1.605721 43.6939 + 437 0.0000 1.609634 43.8004 + 438 0.0000 1.612870 43.8884 + 439 0.0000 1.617149 44.0049 + 440 0.0000 1.620310 44.0909 + 441 0.0000 1.624661 44.2093 + 442 0.0000 1.626574 44.2613 + 443 0.0000 1.630837 44.3773 + 444 0.0000 1.637494 44.5585 + 445 0.0000 1.641706 44.6731 + 446 0.0000 1.646394 44.8007 + 447 0.0000 1.656024 45.0627 + 448 0.0000 1.658829 45.1390 + 449 0.0000 1.661086 45.2004 + 450 0.0000 1.666979 45.3608 + 451 0.0000 1.668048 45.3899 + 452 0.0000 1.674732 45.5718 + 453 0.0000 1.679927 45.7132 + 454 0.0000 1.683630 45.8139 + 455 0.0000 1.692249 46.0484 + 456 0.0000 1.692788 46.0631 + 457 0.0000 1.698079 46.2071 + 458 0.0000 1.708556 46.4922 + 459 0.0000 1.711392 46.5693 + 460 0.0000 1.715046 46.6688 + 461 0.0000 1.726579 46.9826 + 462 0.0000 1.735535 47.2263 + 463 0.0000 1.740393 47.3585 + 464 0.0000 1.746699 47.5301 + 465 0.0000 1.750133 47.6236 + 466 0.0000 1.756294 47.7912 + 467 0.0000 1.758547 47.8525 + 468 0.0000 1.763919 47.9987 + 469 0.0000 1.768129 48.1132 + 470 0.0000 1.776465 48.3401 + 471 0.0000 1.781988 48.4904 + 472 0.0000 1.785142 48.5762 + 473 0.0000 1.789660 48.6991 + 474 0.0000 1.798661 48.9440 + 475 0.0000 1.805126 49.1200 + 476 0.0000 1.807470 49.1838 + 477 0.0000 1.816901 49.4404 + 478 0.0000 1.820555 49.5398 + 479 0.0000 1.832733 49.8712 + 480 0.0000 1.835671 49.9511 + 481 0.0000 1.842981 50.1501 + 482 0.0000 1.848453 50.2990 + 483 0.0000 1.853680 50.4412 + 484 0.0000 1.863350 50.7043 + 485 0.0000 1.869581 50.8739 + 486 0.0000 1.885367 51.3034 + 487 0.0000 1.891873 51.4805 + 488 0.0000 1.897484 51.6332 + 489 0.0000 1.903553 51.7983 + 490 0.0000 1.911445 52.0131 + 491 0.0000 1.919197 52.2240 + 492 0.0000 1.926239 52.4156 + 493 0.0000 1.929241 52.4973 + 494 0.0000 1.934613 52.6435 + 495 0.0000 1.944975 52.9255 + 496 0.0000 1.951204 53.0950 + 497 0.0000 1.955701 53.2173 + 498 0.0000 1.965953 53.4963 + 499 0.0000 1.970197 53.6118 + 500 0.0000 1.975716 53.7620 + 501 0.0000 1.996986 54.3408 + 502 0.0000 1.997372 54.3512 + 503 0.0000 2.007623 54.6302 + 504 0.0000 2.014513 54.8177 + 505 0.0000 2.023827 55.0711 + 506 0.0000 2.028386 55.1952 + 507 0.0000 2.042716 55.5851 + 508 0.0000 2.051622 55.8275 + 509 0.0000 2.052714 55.8572 + 510 0.0000 2.065194 56.1968 + 511 0.0000 2.068908 56.2978 + 512 0.0000 2.072441 56.3940 + 513 0.0000 2.091885 56.9231 + 514 0.0000 2.096669 57.0533 + 515 0.0000 2.097930 57.0876 + 516 0.0000 2.121242 57.7219 + 517 0.0000 2.125847 57.8472 + 518 0.0000 2.127218 57.8846 + 519 0.0000 2.140841 58.2552 + 520 0.0000 2.152441 58.5709 + 521 0.0000 2.160918 58.8016 + 522 0.0000 2.166267 58.9471 + 523 0.0000 2.175506 59.1985 + 524 0.0000 2.176349 59.2215 + 525 0.0000 2.191516 59.6342 + 526 0.0000 2.192494 59.6608 + 527 0.0000 2.195645 59.7465 + 528 0.0000 2.203813 59.9688 + 529 0.0000 2.204994 60.0009 + 530 0.0000 2.213115 60.2219 + 531 0.0000 2.217091 60.3301 + 532 0.0000 2.225560 60.5606 + 533 0.0000 2.242243 61.0145 + 534 0.0000 2.245597 61.1058 + 535 0.0000 2.252447 61.2922 + 536 0.0000 2.264143 61.6105 + 537 0.0000 2.268741 61.7356 + 538 0.0000 2.281154 62.0734 + 539 0.0000 2.293087 62.3981 + 540 0.0000 2.296090 62.4798 + 541 0.0000 2.299570 62.5745 + 542 0.0000 2.306657 62.7673 + 543 0.0000 2.314211 62.9729 + 544 0.0000 2.331570 63.4452 + 545 0.0000 2.345183 63.8157 + 546 0.0000 2.346656 63.8558 + 547 0.0000 2.357643 64.1547 + 548 0.0000 2.364728 64.3475 + 549 0.0000 2.367996 64.4364 + 550 0.0000 2.370324 64.4998 + 551 0.0000 2.373840 64.5955 + 552 0.0000 2.380939 64.7887 + 553 0.0000 2.387971 64.9800 + 554 0.0000 2.389940 65.0336 + 555 0.0000 2.394387 65.1546 + 556 0.0000 2.403828 65.4115 + 557 0.0000 2.423165 65.9377 + 558 0.0000 2.431571 66.1664 + 559 0.0000 2.434665 66.2506 + 560 0.0000 2.440608 66.4123 + 561 0.0000 2.443289 66.4853 + 562 0.0000 2.445866 66.5554 + 563 0.0000 2.449315 66.6492 + 564 0.0000 2.473567 67.3092 + 565 0.0000 2.475238 67.3546 + 566 0.0000 2.478386 67.4403 + 567 0.0000 2.483191 67.5711 + 568 0.0000 2.487896 67.6991 + 569 0.0000 2.495061 67.8941 + 570 0.0000 2.503194 68.1154 + 571 0.0000 2.506708 68.2110 + 572 0.0000 2.515471 68.4494 + 573 0.0000 2.519634 68.5627 + 574 0.0000 2.521906 68.6245 + 575 0.0000 2.525357 68.7184 + 576 0.0000 2.531267 68.8793 + 577 0.0000 2.538091 69.0650 + 578 0.0000 2.540453 69.1293 + 579 0.0000 2.548944 69.3603 + 580 0.0000 2.553651 69.4884 + 581 0.0000 2.562848 69.7386 + 582 0.0000 2.568504 69.8925 + 583 0.0000 2.570893 69.9576 + 584 0.0000 2.575308 70.0777 + 585 0.0000 2.577196 70.1291 + 586 0.0000 2.588994 70.4501 + 587 0.0000 2.589559 70.4655 + 588 0.0000 2.595731 70.6334 + 589 0.0000 2.602739 70.8241 + 590 0.0000 2.604346 70.8679 + 591 0.0000 2.609943 71.0202 + 592 0.0000 2.613730 71.1232 + 593 0.0000 2.618669 71.2576 + 594 0.0000 2.627945 71.5100 + 595 0.0000 2.632683 71.6390 + 596 0.0000 2.636481 71.7423 + 597 0.0000 2.640514 71.8520 + 598 0.0000 2.651366 72.1473 + 599 0.0000 2.653574 72.2074 + 600 0.0000 2.657762 72.3214 + 601 0.0000 2.664450 72.5034 + 602 0.0000 2.670319 72.6631 + 603 0.0000 2.677878 72.8688 + 604 0.0000 2.678594 72.8883 + 605 0.0000 2.681026 72.9544 + 606 0.0000 2.691738 73.2459 + 607 0.0000 2.697914 73.4140 + 608 0.0000 2.703831 73.5750 + 609 0.0000 2.713875 73.8483 + 610 0.0000 2.717224 73.9394 + 611 0.0000 2.727057 74.2070 + 612 0.0000 2.743235 74.6472 + 613 0.0000 2.747349 74.7592 + 614 0.0000 2.755453 74.9797 + 615 0.0000 2.767492 75.3073 + 616 0.0000 2.774328 75.4933 + 617 0.0000 2.786414 75.8222 + 618 0.0000 2.796712 76.1024 + 619 0.0000 2.798961 76.1636 + 620 0.0000 2.807471 76.3952 + 621 0.0000 2.810120 76.4673 + 622 0.0000 2.816069 76.6291 + 623 0.0000 2.834117 77.1202 + 624 0.0000 2.848977 77.5246 + 625 0.0000 2.856301 77.7239 + 626 0.0000 2.876711 78.2793 + 627 0.0000 2.891180 78.6730 + 628 0.0000 2.895848 78.8000 + 629 0.0000 2.904639 79.0393 + 630 0.0000 2.913097 79.2694 + 631 0.0000 2.918501 79.4164 + 632 0.0000 2.929692 79.7210 + 633 0.0000 2.941233 80.0350 + 634 0.0000 2.943901 80.1076 + 635 0.0000 2.951833 80.3235 + 636 0.0000 2.969726 80.8104 + 637 0.0000 2.977737 81.0283 + 638 0.0000 2.990471 81.3749 + 639 0.0000 3.006779 81.8186 + 640 0.0000 3.025024 82.3151 + 641 0.0000 3.056460 83.1705 + 642 0.0000 3.060618 83.2836 + 643 0.0000 3.078095 83.7592 + 644 0.0000 3.079663 83.8019 + 645 0.0000 3.087256 84.0085 + 646 0.0000 3.100234 84.3616 + 647 0.0000 3.105651 84.5091 + 648 0.0000 3.106746 84.5389 + 649 0.0000 3.126637 85.0801 + 650 0.0000 3.139308 85.4249 + 651 0.0000 3.148532 85.6759 + 652 0.0000 3.152402 85.7812 + 653 0.0000 3.161347 86.0246 + 654 0.0000 3.168319 86.2144 + 655 0.0000 3.175056 86.3977 + 656 0.0000 3.180154 86.5364 + 657 0.0000 3.187456 86.7351 + 658 0.0000 3.195789 86.9618 + 659 0.0000 3.209018 87.3218 + 660 0.0000 3.214926 87.4826 + 661 0.0000 3.217403 87.5500 + 662 0.0000 3.224726 87.7492 + 663 0.0000 3.236723 88.0757 + 664 0.0000 3.245649 88.3186 + 665 0.0000 3.247614 88.3721 + 666 0.0000 3.262371 88.7736 + 667 0.0000 3.266389 88.8830 + 668 0.0000 3.271684 89.0270 + 669 0.0000 3.283299 89.3431 + 670 0.0000 3.285971 89.4158 + 671 0.0000 3.293272 89.6145 + 672 0.0000 3.300825 89.8200 + 673 0.0000 3.307372 89.9982 + 674 0.0000 3.313355 90.1610 + 675 0.0000 3.319550 90.3295 + 676 0.0000 3.325325 90.4867 + 677 0.0000 3.328685 90.5781 + 678 0.0000 3.334905 90.7474 + 679 0.0000 3.346319 91.0580 + 680 0.0000 3.352759 91.2332 + 681 0.0000 3.362602 91.5011 + 682 0.0000 3.369984 91.7019 + 683 0.0000 3.377873 91.9166 + 684 0.0000 3.382961 92.0551 + 685 0.0000 3.394076 92.3575 + 686 0.0000 3.398596 92.4805 + 687 0.0000 3.402283 92.5808 + 688 0.0000 3.410296 92.7989 + 689 0.0000 3.413497 92.8860 + 690 0.0000 3.423897 93.1690 + 691 0.0000 3.427888 93.2776 + 692 0.0000 3.436897 93.5227 + 693 0.0000 3.446937 93.7959 + 694 0.0000 3.457796 94.0914 + 695 0.0000 3.459567 94.1396 + 696 0.0000 3.465038 94.2885 + 697 0.0000 3.471895 94.4751 + 698 0.0000 3.474640 94.5498 + 699 0.0000 3.485828 94.8542 + 700 0.0000 3.489446 94.9527 + 701 0.0000 3.499470 95.2254 + 702 0.0000 3.506820 95.4254 + 703 0.0000 3.516039 95.6763 + 704 0.0000 3.520980 95.8107 + 705 0.0000 3.526191 95.9525 + 706 0.0000 3.544041 96.4383 + 707 0.0000 3.552742 96.6750 + 708 0.0000 3.556419 96.7751 + 709 0.0000 3.572267 97.2063 + 710 0.0000 3.575994 97.3077 + 711 0.0000 3.587379 97.6175 + 712 0.0000 3.600197 97.9664 + 713 0.0000 3.606478 98.1373 + 714 0.0000 3.610941 98.2587 + 715 0.0000 3.617446 98.4357 + 716 0.0000 3.621552 98.5474 + 717 0.0000 3.624268 98.6214 + 718 0.0000 3.632854 98.8550 + 719 0.0000 3.637107 98.9707 + 720 0.0000 3.647075 99.2420 + 721 0.0000 3.655206 99.4632 + 722 0.0000 3.661306 99.6292 + 723 0.0000 3.668097 99.8140 + 724 0.0000 3.669601 99.8549 + 725 0.0000 3.683571 100.2351 + 726 0.0000 3.686448 100.3134 + 727 0.0000 3.693760 100.5123 + 728 0.0000 3.701522 100.7235 + 729 0.0000 3.717038 101.1457 + 730 0.0000 3.721085 101.2559 + 731 0.0000 3.737859 101.7123 + 732 0.0000 3.739318 101.7520 + 733 0.0000 3.748750 102.0087 + 734 0.0000 3.753221 102.1303 + 735 0.0000 3.780900 102.8835 + 736 0.0000 3.785474 103.0080 + 737 0.0000 3.816846 103.8617 + 738 0.0000 3.840864 104.5152 + 739 0.0000 3.863004 105.1177 + 740 0.0000 3.867026 105.2271 + 741 0.0000 3.872678 105.3809 + 742 0.0000 3.897400 106.0537 + 743 0.0000 3.913019 106.4787 + 744 0.0000 3.913964 106.5044 + 745 0.0000 3.934236 107.0560 + 746 0.0000 3.940578 107.2286 + 747 0.0000 3.977499 108.2332 + 748 0.0000 3.991999 108.6278 + 749 0.0000 4.001032 108.8736 + 750 0.0000 4.006749 109.0292 + 751 0.0000 4.018893 109.3596 + 752 0.0000 4.022845 109.4672 + 753 0.0000 4.023549 109.4863 + 754 0.0000 4.031383 109.6995 + 755 0.0000 4.037922 109.8775 + 756 0.0000 4.041520 109.9754 + 757 0.0000 4.050214 110.2119 + 758 0.0000 4.055174 110.3469 + 759 0.0000 4.064030 110.5879 + 760 0.0000 4.067741 110.6889 + 761 0.0000 4.070344 110.7597 + 762 0.0000 4.072647 110.8224 + 763 0.0000 4.075529 110.9008 + 764 0.0000 4.082973 111.1034 + 765 0.0000 4.089512 111.2813 + 766 0.0000 4.100195 111.5720 + 767 0.0000 4.105022 111.7033 + 768 0.0000 4.113467 111.9331 + 769 0.0000 4.125605 112.2634 + 770 0.0000 4.132820 112.4598 + 771 0.0000 4.149035 112.9010 + 772 0.0000 4.150919 112.9522 + 773 0.0000 4.162515 113.2678 + 774 0.0000 4.168749 113.4374 + 775 0.0000 4.174011 113.5806 + 776 0.0000 4.187097 113.9367 + 777 0.0000 4.187379 113.9444 + 778 0.0000 4.199115 114.2637 + 779 0.0000 4.204504 114.4104 + 780 0.0000 4.215228 114.7022 + 781 0.0000 4.230406 115.1152 + 782 0.0000 4.236067 115.2692 + 783 0.0000 4.249187 115.6262 + 784 0.0000 4.262022 115.9755 + 785 0.0000 4.275524 116.3429 + 786 0.0000 4.327262 117.7508 + 787 0.0000 4.333145 117.9109 + 788 0.0000 4.349476 118.3553 + 789 0.0000 4.353999 118.4783 + 790 0.0000 4.361630 118.6860 + 791 0.0000 4.384346 119.3041 + 792 0.0000 4.406264 119.9005 + 793 0.0000 4.414471 120.1239 + 794 0.0000 4.426382 120.4480 + 795 0.0000 4.431679 120.5921 + 796 0.0000 4.438713 120.7835 + 797 0.0000 4.444804 120.9493 + 798 0.0000 4.446899 121.0063 + 799 0.0000 4.461487 121.4032 + 800 0.0000 4.470098 121.6375 + 801 0.0000 4.471776 121.6832 + 802 0.0000 4.474986 121.7705 + 803 0.0000 4.483571 122.0042 + 804 0.0000 4.486129 122.0738 + 805 0.0000 4.489251 122.1587 + 806 0.0000 4.503867 122.5564 + 807 0.0000 4.516710 122.9059 + 808 0.0000 4.519790 122.9897 + 809 0.0000 4.579573 124.6165 + 810 0.0000 4.586204 124.7970 + 811 0.0000 4.594659 125.0270 + 812 0.0000 4.611498 125.4852 + 813 0.0000 4.646612 126.4407 + 814 0.0000 4.662157 126.8637 + 815 0.0000 4.670409 127.0883 + 816 0.0000 4.680757 127.3699 + 817 0.0000 4.684348 127.4676 + 818 0.0000 4.688655 127.5848 + 819 0.0000 4.705894 128.0539 + 820 0.0000 4.720495 128.4512 + 821 0.0000 4.732584 128.7802 + 822 0.0000 4.784104 130.1821 + 823 0.0000 4.820116 131.1620 + 824 0.0000 4.863626 132.3460 + 825 0.0000 4.871194 132.5519 + 826 0.0000 4.882718 132.8655 + 827 0.0000 4.899865 133.3321 + 828 0.0000 4.915053 133.7454 + 829 0.0000 4.926659 134.0612 + 830 0.0000 4.936607 134.3319 + 831 0.0000 4.947340 134.6240 + 832 0.0000 4.961718 135.0152 + 833 0.0000 5.004591 136.1818 + 834 0.0000 5.029182 136.8510 + 835 0.0000 5.042833 137.2225 + 836 0.0000 5.120066 139.3241 + 837 0.0000 5.149358 140.1212 + 838 0.0000 5.254955 142.9946 + 839 0.0000 5.313133 144.5777 + 840 0.0000 5.367124 146.0469 + 841 0.0000 5.416618 147.3937 + 842 0.0000 5.508010 149.8806 + 843 0.0000 5.716722 155.5599 + 844 0.0000 5.804542 157.9496 + 845 0.0000 5.875530 159.8813 + 846 0.0000 6.817107 185.5029 + 847 0.0000 7.516909 204.5455 + 848 0.0000 7.544838 205.3055 + 849 0.0000 7.674144 208.8241 + 850 0.0000 7.765851 211.3195 + 851 0.0000 7.840754 213.3578 + 852 0.0000 7.887513 214.6301 + 853 0.0000 7.916949 215.4311 + 854 0.0000 7.949282 216.3110 + 855 0.0000 15.732812 428.1116 + 856 0.0000 15.812728 430.2862 + 857 0.0000 22.372511 608.7870 + 858 0.0000 22.380280 608.9984 + 859 0.0000 22.385187 609.1319 + 860 0.0000 22.401913 609.5870 + 861 0.0000 22.419677 610.0704 + 862 0.0000 22.432756 610.4263 + 863 0.0000 22.453213 610.9830 + 864 0.0000 22.461330 611.2039 + 865 0.0000 22.528670 613.0363 + 866 0.0000 22.593066 614.7886 + 867 0.0000 22.619109 615.4972 + 868 0.0000 22.639521 616.0527 + 869 0.0000 22.679181 617.1319 + 870 0.0000 32.251353 877.6039 + 871 0.0000 32.602287 887.1533 + + SPIN DOWN ORBITALS + NO OCC E(Eh) E(eV) + 0 1.0000 -482.492908 -13129.2995 + 1 1.0000 -482.492775 -13129.2959 + 2 1.0000 -255.859582 -6962.2932 + 3 1.0000 -76.959356 -2094.1705 + 4 1.0000 -76.957370 -2094.1165 + 5 1.0000 -62.206716 -1692.7308 + 6 1.0000 -62.206669 -1692.7295 + 7 1.0000 -55.991122 -1523.5959 + 8 1.0000 -55.991110 -1523.5956 + 9 1.0000 -55.990423 -1523.5769 + 10 1.0000 -55.990414 -1523.5766 + 11 1.0000 -55.990356 -1523.5751 + 12 1.0000 -55.990234 -1523.5717 + 13 1.0000 -29.845661 -812.1417 + 14 1.0000 -25.694063 -699.1710 + 15 1.0000 -25.683928 -698.8952 + 16 1.0000 -25.681979 -698.8422 + 17 1.0000 -14.301182 -389.1550 + 18 1.0000 -14.296404 -389.0249 + 19 1.0000 -10.165785 -276.6251 + 20 1.0000 -10.148851 -276.1643 + 21 1.0000 -10.140921 -275.9485 + 22 1.0000 -10.138080 -275.8712 + 23 1.0000 -10.135200 -275.7928 + 24 1.0000 -10.129748 -275.6445 + 25 1.0000 -10.126844 -275.5654 + 26 1.0000 -10.119302 -275.3602 + 27 1.0000 -10.117262 -275.3047 + 28 1.0000 -10.117147 -275.3016 + 29 1.0000 -10.114932 -275.2413 + 30 1.0000 -10.113662 -275.2067 + 31 1.0000 -10.112609 -275.1781 + 32 1.0000 -8.553095 -232.7416 + 33 1.0000 -8.553029 -232.7398 + 34 1.0000 -6.512830 -177.2231 + 35 1.0000 -6.510272 -177.1535 + 36 1.0000 -6.368757 -173.3027 + 37 1.0000 -6.368744 -173.3023 + 38 1.0000 -6.366514 -173.2417 + 39 1.0000 -6.366406 -173.2387 + 40 1.0000 -6.366387 -173.2382 + 41 1.0000 -6.366345 -173.2370 + 42 1.0000 -4.662903 -126.8840 + 43 1.0000 -4.661002 -126.8323 + 44 1.0000 -4.660318 -126.8137 + 45 1.0000 -4.658892 -126.7749 + 46 1.0000 -4.658454 -126.7630 + 47 1.0000 -4.656544 -126.7110 + 48 1.0000 -3.323875 -90.4472 + 49 1.0000 -2.493447 -67.8501 + 50 1.0000 -2.493439 -67.8499 + 51 1.0000 -2.492809 -67.8328 + 52 1.0000 -2.492756 -67.8313 + 53 1.0000 -2.492673 -67.8291 + 54 1.0000 -2.492655 -67.8286 + 55 1.0000 -2.490791 -67.7779 + 56 1.0000 -2.490730 -67.7762 + 57 1.0000 -2.490683 -67.7749 + 58 1.0000 -2.490626 -67.7734 + 59 1.0000 -2.097637 -57.0796 + 60 1.0000 -2.091975 -56.9255 + 61 1.0000 -2.088265 -56.8246 + 62 1.0000 -0.981563 -26.7097 + 63 1.0000 -0.829696 -22.5772 + 64 1.0000 -0.802538 -21.8382 + 65 1.0000 -0.784109 -21.3367 + 66 1.0000 -0.780237 -21.2313 + 67 1.0000 -0.776329 -21.1250 + 68 1.0000 -0.690397 -18.7867 + 69 1.0000 -0.683520 -18.5995 + 70 1.0000 -0.682428 -18.5698 + 71 1.0000 -0.679035 -18.4775 + 72 1.0000 -0.675848 -18.3908 + 73 1.0000 -0.674676 -18.3589 + 74 1.0000 -0.672674 -18.3044 + 75 1.0000 -0.647339 -17.6150 + 76 1.0000 -0.611899 -16.6506 + 77 1.0000 -0.585178 -15.9235 + 78 1.0000 -0.580628 -15.7997 + 79 1.0000 -0.550628 -14.9833 + 80 1.0000 -0.538098 -14.6424 + 81 1.0000 -0.497245 -13.5307 + 82 1.0000 -0.479088 -13.0367 + 83 1.0000 -0.474464 -12.9108 + 84 1.0000 -0.465066 -12.6551 + 85 1.0000 -0.455630 -12.3983 + 86 1.0000 -0.453577 -12.3425 + 87 1.0000 -0.446414 -12.1475 + 88 1.0000 -0.433181 -11.7875 + 89 1.0000 -0.427915 -11.6442 + 90 1.0000 -0.424656 -11.5555 + 91 1.0000 -0.412653 -11.2288 + 92 1.0000 -0.407560 -11.0903 + 93 1.0000 -0.406688 -11.0665 + 94 1.0000 -0.397169 -10.8075 + 95 1.0000 -0.391939 -10.6652 + 96 1.0000 -0.386229 -10.5098 + 97 1.0000 -0.385711 -10.4957 + 98 1.0000 -0.379719 -10.3327 + 99 1.0000 -0.374787 -10.1985 + 100 1.0000 -0.372264 -10.1298 + 101 1.0000 -0.365381 -9.9425 + 102 1.0000 -0.358421 -9.7531 + 103 1.0000 -0.349157 -9.5011 + 104 1.0000 -0.347063 -9.4441 + 105 1.0000 -0.346752 -9.4356 + 106 1.0000 -0.342491 -9.3197 + 107 1.0000 -0.338972 -9.2239 + 108 1.0000 -0.335680 -9.1343 + 109 1.0000 -0.332797 -9.0559 + 110 1.0000 -0.321200 -8.7403 + 111 1.0000 -0.316158 -8.6031 + 112 1.0000 -0.302956 -8.2438 + 113 1.0000 -0.290675 -7.9097 + 114 1.0000 -0.276708 -7.5296 + 115 1.0000 -0.272079 -7.4036 + 116 1.0000 -0.252159 -6.8616 + 117 1.0000 -0.249714 -6.7951 + 118 1.0000 -0.239802 -6.5253 + 119 1.0000 -0.237707 -6.4683 + 120 1.0000 -0.231819 -6.3081 + 121 1.0000 -0.222870 -6.0646 + 122 1.0000 -0.191208 -5.2030 + 123 0.0000 -0.099033 -2.6948 + 124 0.0000 -0.084114 -2.2889 + 125 0.0000 -0.083178 -2.2634 + 126 0.0000 -0.043549 -1.1850 + 127 0.0000 -0.007674 -0.2088 + 128 0.0000 0.004367 0.1188 + 129 0.0000 0.011000 0.2993 + 130 0.0000 0.018737 0.5099 + 131 0.0000 0.028182 0.7669 + 132 0.0000 0.036256 0.9866 + 133 0.0000 0.038279 1.0416 + 134 0.0000 0.043197 1.1754 + 135 0.0000 0.051469 1.4005 + 136 0.0000 0.055130 1.5002 + 137 0.0000 0.061700 1.6790 + 138 0.0000 0.064855 1.7648 + 139 0.0000 0.066495 1.8094 + 140 0.0000 0.069724 1.8973 + 141 0.0000 0.075398 2.0517 + 142 0.0000 0.078696 2.1414 + 143 0.0000 0.080513 2.1909 + 144 0.0000 0.085199 2.3184 + 145 0.0000 0.089492 2.4352 + 146 0.0000 0.091794 2.4978 + 147 0.0000 0.096403 2.6233 + 148 0.0000 0.101634 2.7656 + 149 0.0000 0.102528 2.7899 + 150 0.0000 0.107505 2.9253 + 151 0.0000 0.113534 3.0894 + 152 0.0000 0.116172 3.1612 + 153 0.0000 0.118358 3.2207 + 154 0.0000 0.122332 3.3288 + 155 0.0000 0.125484 3.4146 + 156 0.0000 0.126666 3.4468 + 157 0.0000 0.130334 3.5466 + 158 0.0000 0.133067 3.6209 + 159 0.0000 0.138744 3.7754 + 160 0.0000 0.139277 3.7899 + 161 0.0000 0.143825 3.9137 + 162 0.0000 0.144327 3.9273 + 163 0.0000 0.147531 4.0145 + 164 0.0000 0.152504 4.1499 + 165 0.0000 0.154327 4.1994 + 166 0.0000 0.157414 4.2835 + 167 0.0000 0.164135 4.4663 + 168 0.0000 0.167842 4.5672 + 169 0.0000 0.169248 4.6055 + 170 0.0000 0.173102 4.7104 + 171 0.0000 0.177626 4.8334 + 172 0.0000 0.181448 4.9375 + 173 0.0000 0.187610 5.1051 + 174 0.0000 0.190413 5.1814 + 175 0.0000 0.193542 5.2666 + 176 0.0000 0.196031 5.3343 + 177 0.0000 0.198902 5.4124 + 178 0.0000 0.200936 5.4678 + 179 0.0000 0.204112 5.5542 + 180 0.0000 0.208304 5.6682 + 181 0.0000 0.213047 5.7973 + 182 0.0000 0.215817 5.8727 + 183 0.0000 0.219069 5.9612 + 184 0.0000 0.224411 6.1065 + 185 0.0000 0.230515 6.2726 + 186 0.0000 0.231781 6.3071 + 187 0.0000 0.235706 6.4139 + 188 0.0000 0.244321 6.6483 + 189 0.0000 0.246690 6.7128 + 190 0.0000 0.250886 6.8270 + 191 0.0000 0.252214 6.8631 + 192 0.0000 0.257579 7.0091 + 193 0.0000 0.265982 7.2377 + 194 0.0000 0.271476 7.3872 + 195 0.0000 0.276703 7.5295 + 196 0.0000 0.279428 7.6036 + 197 0.0000 0.281315 7.6550 + 198 0.0000 0.288680 7.8554 + 199 0.0000 0.290486 7.9045 + 200 0.0000 0.293549 7.9879 + 201 0.0000 0.303659 8.2630 + 202 0.0000 0.305856 8.3228 + 203 0.0000 0.308796 8.4028 + 204 0.0000 0.313243 8.5238 + 205 0.0000 0.318074 8.6552 + 206 0.0000 0.324733 8.8364 + 207 0.0000 0.326929 8.8962 + 208 0.0000 0.329759 8.9732 + 209 0.0000 0.336350 9.1525 + 210 0.0000 0.339418 9.2360 + 211 0.0000 0.341282 9.2868 + 212 0.0000 0.352869 9.6021 + 213 0.0000 0.354697 9.6518 + 214 0.0000 0.360546 9.8109 + 215 0.0000 0.362341 9.8598 + 216 0.0000 0.368317 10.0224 + 217 0.0000 0.372220 10.1286 + 218 0.0000 0.379256 10.3201 + 219 0.0000 0.386825 10.5261 + 220 0.0000 0.388426 10.5696 + 221 0.0000 0.393042 10.6952 + 222 0.0000 0.396713 10.7951 + 223 0.0000 0.397558 10.8181 + 224 0.0000 0.403270 10.9735 + 225 0.0000 0.406959 11.0739 + 226 0.0000 0.407655 11.0929 + 227 0.0000 0.412568 11.2265 + 228 0.0000 0.413476 11.2513 + 229 0.0000 0.415392 11.3034 + 230 0.0000 0.419485 11.4148 + 231 0.0000 0.421209 11.4617 + 232 0.0000 0.427075 11.6213 + 233 0.0000 0.429555 11.6888 + 234 0.0000 0.431919 11.7531 + 235 0.0000 0.435200 11.8424 + 236 0.0000 0.437880 11.9153 + 237 0.0000 0.441725 12.0200 + 238 0.0000 0.443045 12.0559 + 239 0.0000 0.445982 12.1358 + 240 0.0000 0.450351 12.2547 + 241 0.0000 0.454076 12.3560 + 242 0.0000 0.455662 12.3992 + 243 0.0000 0.457855 12.4589 + 244 0.0000 0.460731 12.5371 + 245 0.0000 0.462481 12.5848 + 246 0.0000 0.463613 12.6156 + 247 0.0000 0.467975 12.7343 + 248 0.0000 0.472748 12.8641 + 249 0.0000 0.475728 12.9452 + 250 0.0000 0.477230 12.9861 + 251 0.0000 0.479293 13.0422 + 252 0.0000 0.487719 13.2715 + 253 0.0000 0.489109 13.3093 + 254 0.0000 0.491820 13.3831 + 255 0.0000 0.493112 13.4183 + 256 0.0000 0.498299 13.5594 + 257 0.0000 0.505043 13.7429 + 258 0.0000 0.510135 13.8815 + 259 0.0000 0.516824 14.0635 + 260 0.0000 0.521392 14.1878 + 261 0.0000 0.525550 14.3010 + 262 0.0000 0.529844 14.4178 + 263 0.0000 0.534087 14.5332 + 264 0.0000 0.535217 14.5640 + 265 0.0000 0.535992 14.5851 + 266 0.0000 0.542457 14.7610 + 267 0.0000 0.543872 14.7995 + 268 0.0000 0.550356 14.9759 + 269 0.0000 0.556630 15.1467 + 270 0.0000 0.559525 15.2255 + 271 0.0000 0.562224 15.2989 + 272 0.0000 0.564170 15.3518 + 273 0.0000 0.572239 15.5714 + 274 0.0000 0.573006 15.5923 + 275 0.0000 0.574298 15.6275 + 276 0.0000 0.582124 15.8404 + 277 0.0000 0.588806 16.0222 + 278 0.0000 0.594080 16.1657 + 279 0.0000 0.596736 16.2380 + 280 0.0000 0.603980 16.4351 + 281 0.0000 0.611295 16.6342 + 282 0.0000 0.623723 16.9724 + 283 0.0000 0.628497 17.1023 + 284 0.0000 0.631719 17.1900 + 285 0.0000 0.641646 17.4601 + 286 0.0000 0.642197 17.4751 + 287 0.0000 0.655834 17.8462 + 288 0.0000 0.655990 17.8504 + 289 0.0000 0.660329 17.9685 + 290 0.0000 0.667486 18.1632 + 291 0.0000 0.674030 18.3413 + 292 0.0000 0.679994 18.5036 + 293 0.0000 0.696585 18.9551 + 294 0.0000 0.699328 19.0297 + 295 0.0000 0.705008 19.1843 + 296 0.0000 0.711092 19.3498 + 297 0.0000 0.712994 19.4016 + 298 0.0000 0.714509 19.4428 + 299 0.0000 0.727757 19.8033 + 300 0.0000 0.741155 20.1679 + 301 0.0000 0.742519 20.2050 + 302 0.0000 0.748888 20.3783 + 303 0.0000 0.750552 20.4236 + 304 0.0000 0.756848 20.5949 + 305 0.0000 0.768564 20.9137 + 306 0.0000 0.779897 21.2221 + 307 0.0000 0.782702 21.2984 + 308 0.0000 0.791995 21.5513 + 309 0.0000 0.804789 21.8994 + 310 0.0000 0.806162 21.9368 + 311 0.0000 0.817848 22.2548 + 312 0.0000 0.821843 22.3635 + 313 0.0000 0.831461 22.6252 + 314 0.0000 0.840116 22.8607 + 315 0.0000 0.845396 23.0044 + 316 0.0000 0.855329 23.2747 + 317 0.0000 0.860224 23.4079 + 318 0.0000 0.863507 23.4972 + 319 0.0000 0.866597 23.5813 + 320 0.0000 0.874219 23.7887 + 321 0.0000 0.878866 23.9152 + 322 0.0000 0.884792 24.0764 + 323 0.0000 0.886056 24.1108 + 324 0.0000 0.895636 24.3715 + 325 0.0000 0.901942 24.5431 + 326 0.0000 0.909309 24.7435 + 327 0.0000 0.920897 25.0589 + 328 0.0000 0.930075 25.3086 + 329 0.0000 0.934908 25.4401 + 330 0.0000 0.946802 25.7638 + 331 0.0000 0.958444 26.0806 + 332 0.0000 0.961399 26.1610 + 333 0.0000 0.967211 26.3191 + 334 0.0000 0.974752 26.5243 + 335 0.0000 0.977522 26.5997 + 336 0.0000 0.988708 26.9041 + 337 0.0000 0.999856 27.2075 + 338 0.0000 1.001610 27.2552 + 339 0.0000 1.012259 27.5450 + 340 0.0000 1.016245 27.6534 + 341 0.0000 1.023750 27.8577 + 342 0.0000 1.028811 27.9954 + 343 0.0000 1.033790 28.1308 + 344 0.0000 1.036445 28.2031 + 345 0.0000 1.041056 28.3286 + 346 0.0000 1.046204 28.4687 + 347 0.0000 1.050926 28.5972 + 348 0.0000 1.062326 28.9074 + 349 0.0000 1.066569 29.0228 + 350 0.0000 1.073503 29.2115 + 351 0.0000 1.080209 29.3940 + 352 0.0000 1.088315 29.6145 + 353 0.0000 1.096503 29.8374 + 354 0.0000 1.096759 29.8443 + 355 0.0000 1.102269 29.9943 + 356 0.0000 1.109992 30.2044 + 357 0.0000 1.113384 30.2967 + 358 0.0000 1.124764 30.6064 + 359 0.0000 1.125509 30.6267 + 360 0.0000 1.145665 31.1751 + 361 0.0000 1.147093 31.2140 + 362 0.0000 1.156327 31.4653 + 363 0.0000 1.168118 31.7861 + 364 0.0000 1.176126 32.0040 + 365 0.0000 1.181549 32.1516 + 366 0.0000 1.193376 32.4734 + 367 0.0000 1.196604 32.5612 + 368 0.0000 1.204522 32.7767 + 369 0.0000 1.214029 33.0354 + 370 0.0000 1.217067 33.1181 + 371 0.0000 1.219234 33.1770 + 372 0.0000 1.233898 33.5761 + 373 0.0000 1.236326 33.6422 + 374 0.0000 1.242811 33.8186 + 375 0.0000 1.253421 34.1073 + 376 0.0000 1.257237 34.2112 + 377 0.0000 1.266880 34.4736 + 378 0.0000 1.276702 34.7408 + 379 0.0000 1.285207 34.9722 + 380 0.0000 1.294050 35.2129 + 381 0.0000 1.301484 35.4152 + 382 0.0000 1.305930 35.5362 + 383 0.0000 1.331347 36.2278 + 384 0.0000 1.343353 36.5545 + 385 0.0000 1.351317 36.7712 + 386 0.0000 1.374547 37.4033 + 387 0.0000 1.379034 37.5254 + 388 0.0000 1.393566 37.9209 + 389 0.0000 1.407153 38.2906 + 390 0.0000 1.420178 38.6450 + 391 0.0000 1.429656 38.9029 + 392 0.0000 1.430241 38.9188 + 393 0.0000 1.439120 39.1604 + 394 0.0000 1.449020 39.4299 + 395 0.0000 1.460557 39.7438 + 396 0.0000 1.466125 39.8953 + 397 0.0000 1.468549 39.9613 + 398 0.0000 1.474163 40.1140 + 399 0.0000 1.476458 40.1765 + 400 0.0000 1.478339 40.2277 + 401 0.0000 1.484857 40.4050 + 402 0.0000 1.487926 40.4885 + 403 0.0000 1.491157 40.5764 + 404 0.0000 1.497151 40.7396 + 405 0.0000 1.502531 40.8859 + 406 0.0000 1.510466 41.1019 + 407 0.0000 1.512495 41.1571 + 408 0.0000 1.519870 41.3578 + 409 0.0000 1.521237 41.3950 + 410 0.0000 1.525530 41.5118 + 411 0.0000 1.532145 41.6918 + 412 0.0000 1.535637 41.7868 + 413 0.0000 1.537125 41.8273 + 414 0.0000 1.544486 42.0276 + 415 0.0000 1.546670 42.0870 + 416 0.0000 1.550022 42.1782 + 417 0.0000 1.555225 42.3198 + 418 0.0000 1.557172 42.3728 + 419 0.0000 1.560427 42.4614 + 420 0.0000 1.561730 42.4968 + 421 0.0000 1.565966 42.6121 + 422 0.0000 1.570931 42.7472 + 423 0.0000 1.576244 42.8918 + 424 0.0000 1.577306 42.9207 + 425 0.0000 1.580917 43.0190 + 426 0.0000 1.583317 43.0842 + 427 0.0000 1.583717 43.0951 + 428 0.0000 1.587971 43.2109 + 429 0.0000 1.590221 43.2721 + 430 0.0000 1.591572 43.3089 + 431 0.0000 1.594098 43.3776 + 432 0.0000 1.598545 43.4986 + 433 0.0000 1.600355 43.5479 + 434 0.0000 1.601138 43.5692 + 435 0.0000 1.605770 43.6952 + 436 0.0000 1.607720 43.7483 + 437 0.0000 1.611428 43.8492 + 438 0.0000 1.616121 43.9769 + 439 0.0000 1.619619 44.0721 + 440 0.0000 1.622577 44.1526 + 441 0.0000 1.627357 44.2826 + 442 0.0000 1.630415 44.3658 + 443 0.0000 1.634207 44.4690 + 444 0.0000 1.639986 44.6263 + 445 0.0000 1.645315 44.7713 + 446 0.0000 1.649221 44.8776 + 447 0.0000 1.658091 45.1190 + 448 0.0000 1.663311 45.2610 + 449 0.0000 1.663749 45.2729 + 450 0.0000 1.669839 45.4386 + 451 0.0000 1.672038 45.4985 + 452 0.0000 1.677985 45.6603 + 453 0.0000 1.683093 45.7993 + 454 0.0000 1.687976 45.9322 + 455 0.0000 1.695500 46.1369 + 456 0.0000 1.696478 46.1635 + 457 0.0000 1.705473 46.4083 + 458 0.0000 1.712117 46.5891 + 459 0.0000 1.716342 46.7040 + 460 0.0000 1.717933 46.7473 + 461 0.0000 1.728601 47.0376 + 462 0.0000 1.737974 47.2927 + 463 0.0000 1.742774 47.4233 + 464 0.0000 1.749272 47.6001 + 465 0.0000 1.752407 47.6854 + 466 0.0000 1.757444 47.8225 + 467 0.0000 1.760163 47.8965 + 468 0.0000 1.769030 48.1378 + 469 0.0000 1.769951 48.1628 + 470 0.0000 1.778878 48.4057 + 471 0.0000 1.785094 48.5749 + 472 0.0000 1.788408 48.6650 + 473 0.0000 1.792791 48.7843 + 474 0.0000 1.801706 49.0269 + 475 0.0000 1.807635 49.1883 + 476 0.0000 1.809839 49.2482 + 477 0.0000 1.820108 49.5276 + 478 0.0000 1.823422 49.6178 + 479 0.0000 1.836142 49.9640 + 480 0.0000 1.838483 50.0277 + 481 0.0000 1.847771 50.2804 + 482 0.0000 1.851967 50.3946 + 483 0.0000 1.856578 50.5200 + 484 0.0000 1.867600 50.8200 + 485 0.0000 1.874969 51.0205 + 486 0.0000 1.888547 51.3900 + 487 0.0000 1.894721 51.5580 + 488 0.0000 1.900231 51.7079 + 489 0.0000 1.905912 51.8625 + 490 0.0000 1.913933 52.0808 + 491 0.0000 1.920925 52.2710 + 492 0.0000 1.928883 52.4876 + 493 0.0000 1.933384 52.6101 + 494 0.0000 1.937093 52.7110 + 495 0.0000 1.951994 53.1165 + 496 0.0000 1.955867 53.2219 + 497 0.0000 1.959035 53.3080 + 498 0.0000 1.969412 53.5904 + 499 0.0000 1.976152 53.7738 + 500 0.0000 1.978050 53.8255 + 501 0.0000 1.998855 54.3916 + 502 0.0000 2.000921 54.4478 + 503 0.0000 2.009683 54.6863 + 504 0.0000 2.017095 54.8880 + 505 0.0000 2.025120 55.1063 + 506 0.0000 2.031137 55.2700 + 507 0.0000 2.043974 55.6194 + 508 0.0000 2.053062 55.8667 + 509 0.0000 2.056329 55.9556 + 510 0.0000 2.068081 56.2753 + 511 0.0000 2.071926 56.3800 + 512 0.0000 2.074342 56.4457 + 513 0.0000 2.095963 57.0341 + 514 0.0000 2.098666 57.1076 + 515 0.0000 2.100978 57.1705 + 516 0.0000 2.126319 57.8601 + 517 0.0000 2.128886 57.9299 + 518 0.0000 2.133031 58.0427 + 519 0.0000 2.141898 58.2840 + 520 0.0000 2.156567 58.6832 + 521 0.0000 2.162988 58.8579 + 522 0.0000 2.173965 59.1566 + 523 0.0000 2.183046 59.4037 + 524 0.0000 2.187621 59.5282 + 525 0.0000 2.197124 59.7868 + 526 0.0000 2.202710 59.9388 + 527 0.0000 2.204916 59.9988 + 528 0.0000 2.207130 60.0591 + 529 0.0000 2.212445 60.2037 + 530 0.0000 2.219475 60.3950 + 531 0.0000 2.228299 60.6351 + 532 0.0000 2.232512 60.7497 + 533 0.0000 2.243625 61.0521 + 534 0.0000 2.254123 61.3378 + 535 0.0000 2.256028 61.3896 + 536 0.0000 2.269378 61.7529 + 537 0.0000 2.278203 61.9931 + 538 0.0000 2.290426 62.3257 + 539 0.0000 2.294734 62.4429 + 540 0.0000 2.300807 62.6081 + 541 0.0000 2.312026 62.9134 + 542 0.0000 2.313912 62.9647 + 543 0.0000 2.324040 63.2404 + 544 0.0000 2.337263 63.6001 + 545 0.0000 2.346178 63.8428 + 546 0.0000 2.348198 63.8977 + 547 0.0000 2.359281 64.1993 + 548 0.0000 2.366747 64.4025 + 549 0.0000 2.370916 64.5159 + 550 0.0000 2.371716 64.5377 + 551 0.0000 2.376578 64.6700 + 552 0.0000 2.385636 64.9165 + 553 0.0000 2.388958 65.0068 + 554 0.0000 2.390719 65.0548 + 555 0.0000 2.397102 65.2284 + 556 0.0000 2.407335 65.5069 + 557 0.0000 2.424188 65.9655 + 558 0.0000 2.432319 66.1868 + 559 0.0000 2.435352 66.2693 + 560 0.0000 2.442774 66.4712 + 561 0.0000 2.443929 66.5027 + 562 0.0000 2.447117 66.5894 + 563 0.0000 2.450992 66.6949 + 564 0.0000 2.475849 67.3713 + 565 0.0000 2.476889 67.3996 + 566 0.0000 2.480014 67.4846 + 567 0.0000 2.483957 67.5919 + 568 0.0000 2.488610 67.7185 + 569 0.0000 2.496385 67.9301 + 570 0.0000 2.504992 68.1643 + 571 0.0000 2.509250 68.2802 + 572 0.0000 2.517641 68.5085 + 573 0.0000 2.520375 68.5829 + 574 0.0000 2.524360 68.6913 + 575 0.0000 2.526807 68.7579 + 576 0.0000 2.532005 68.8994 + 577 0.0000 2.540529 69.1313 + 578 0.0000 2.543938 69.2241 + 579 0.0000 2.551260 69.4233 + 580 0.0000 2.554194 69.5032 + 581 0.0000 2.563344 69.7521 + 582 0.0000 2.570368 69.9433 + 583 0.0000 2.572175 69.9925 + 584 0.0000 2.576048 70.0978 + 585 0.0000 2.577842 70.1466 + 586 0.0000 2.589703 70.4694 + 587 0.0000 2.590113 70.4805 + 588 0.0000 2.596350 70.6503 + 589 0.0000 2.603345 70.8406 + 590 0.0000 2.605635 70.9029 + 591 0.0000 2.610533 71.0362 + 592 0.0000 2.615122 71.1611 + 593 0.0000 2.619911 71.2914 + 594 0.0000 2.628678 71.5300 + 595 0.0000 2.633483 71.6607 + 596 0.0000 2.637874 71.7802 + 597 0.0000 2.641326 71.8741 + 598 0.0000 2.652269 72.1719 + 599 0.0000 2.654511 72.2329 + 600 0.0000 2.658573 72.3435 + 601 0.0000 2.665254 72.5252 + 602 0.0000 2.671570 72.6971 + 603 0.0000 2.678964 72.8983 + 604 0.0000 2.679347 72.9087 + 605 0.0000 2.682089 72.9833 + 606 0.0000 2.692889 73.2772 + 607 0.0000 2.699101 73.4463 + 608 0.0000 2.704653 73.5974 + 609 0.0000 2.714506 73.8655 + 610 0.0000 2.718664 73.9786 + 611 0.0000 2.727511 74.2193 + 612 0.0000 2.743849 74.6639 + 613 0.0000 2.747882 74.7737 + 614 0.0000 2.756155 74.9988 + 615 0.0000 2.768780 75.3423 + 616 0.0000 2.775233 75.5179 + 617 0.0000 2.787375 75.8483 + 618 0.0000 2.797247 76.1170 + 619 0.0000 2.799751 76.1851 + 620 0.0000 2.808107 76.4125 + 621 0.0000 2.810814 76.4861 + 622 0.0000 2.816930 76.6526 + 623 0.0000 2.835280 77.1519 + 624 0.0000 2.850218 77.5584 + 625 0.0000 2.856741 77.7359 + 626 0.0000 2.877536 78.3017 + 627 0.0000 2.892158 78.6996 + 628 0.0000 2.897117 78.8346 + 629 0.0000 2.905231 79.0553 + 630 0.0000 2.913968 79.2931 + 631 0.0000 2.919340 79.4393 + 632 0.0000 2.930505 79.7431 + 633 0.0000 2.942042 80.0570 + 634 0.0000 2.944887 80.1345 + 635 0.0000 2.952240 80.3345 + 636 0.0000 2.971445 80.8571 + 637 0.0000 2.978435 81.0473 + 638 0.0000 2.991849 81.4123 + 639 0.0000 3.007519 81.8388 + 640 0.0000 3.026107 82.3446 + 641 0.0000 3.057318 83.1939 + 642 0.0000 3.062090 83.3237 + 643 0.0000 3.078794 83.7782 + 644 0.0000 3.081142 83.8421 + 645 0.0000 3.089573 84.0715 + 646 0.0000 3.101114 84.3856 + 647 0.0000 3.106678 84.5370 + 648 0.0000 3.107565 84.5611 + 649 0.0000 3.127245 85.0967 + 650 0.0000 3.139753 85.4370 + 651 0.0000 3.149566 85.7041 + 652 0.0000 3.152771 85.7913 + 653 0.0000 3.161782 86.0365 + 654 0.0000 3.168822 86.2280 + 655 0.0000 3.180034 86.5331 + 656 0.0000 3.180696 86.5511 + 657 0.0000 3.187931 86.7480 + 658 0.0000 3.196580 86.9834 + 659 0.0000 3.209536 87.3359 + 660 0.0000 3.215862 87.5080 + 661 0.0000 3.217900 87.5635 + 662 0.0000 3.225445 87.7688 + 663 0.0000 3.237467 88.0959 + 664 0.0000 3.246423 88.3396 + 665 0.0000 3.248543 88.3974 + 666 0.0000 3.263375 88.8010 + 667 0.0000 3.266754 88.8929 + 668 0.0000 3.276107 89.1474 + 669 0.0000 3.284365 89.3721 + 670 0.0000 3.287535 89.4584 + 671 0.0000 3.293942 89.6327 + 672 0.0000 3.301573 89.8404 + 673 0.0000 3.307982 90.0148 + 674 0.0000 3.314013 90.1789 + 675 0.0000 3.320019 90.3423 + 676 0.0000 3.326089 90.5075 + 677 0.0000 3.329436 90.5986 + 678 0.0000 3.335327 90.7589 + 679 0.0000 3.348638 91.1211 + 680 0.0000 3.354361 91.2768 + 681 0.0000 3.363451 91.5242 + 682 0.0000 3.372771 91.7778 + 683 0.0000 3.383591 92.0722 + 684 0.0000 3.385514 92.1245 + 685 0.0000 3.399454 92.5039 + 686 0.0000 3.400174 92.5234 + 687 0.0000 3.404731 92.6474 + 688 0.0000 3.413194 92.8777 + 689 0.0000 3.415112 92.9299 + 690 0.0000 3.429265 93.3151 + 691 0.0000 3.435245 93.4778 + 692 0.0000 3.438742 93.5729 + 693 0.0000 3.449354 93.8617 + 694 0.0000 3.459289 94.1320 + 695 0.0000 3.462932 94.2312 + 696 0.0000 3.466140 94.3185 + 697 0.0000 3.473543 94.5199 + 698 0.0000 3.479270 94.6758 + 699 0.0000 3.490929 94.9930 + 700 0.0000 3.493258 95.0564 + 701 0.0000 3.502474 95.3072 + 702 0.0000 3.511853 95.5624 + 703 0.0000 3.518178 95.7345 + 704 0.0000 3.524738 95.9130 + 705 0.0000 3.532189 96.1157 + 706 0.0000 3.545833 96.4870 + 707 0.0000 3.554036 96.7102 + 708 0.0000 3.558052 96.8195 + 709 0.0000 3.574765 97.2743 + 710 0.0000 3.579042 97.3907 + 711 0.0000 3.591781 97.7373 + 712 0.0000 3.607778 98.1726 + 713 0.0000 3.613401 98.3256 + 714 0.0000 3.616760 98.4170 + 715 0.0000 3.622141 98.5635 + 716 0.0000 3.626846 98.6915 + 717 0.0000 3.634265 98.8934 + 718 0.0000 3.641428 99.0883 + 719 0.0000 3.642256 99.1108 + 720 0.0000 3.655015 99.4580 + 721 0.0000 3.659389 99.5770 + 722 0.0000 3.668218 99.8173 + 723 0.0000 3.673985 99.9742 + 724 0.0000 3.681832 100.1877 + 725 0.0000 3.692935 100.4899 + 726 0.0000 3.696910 100.5980 + 727 0.0000 3.699624 100.6719 + 728 0.0000 3.712360 101.0185 + 729 0.0000 3.720160 101.2307 + 730 0.0000 3.740308 101.7789 + 731 0.0000 3.750288 102.0505 + 732 0.0000 3.756705 102.2251 + 733 0.0000 3.781501 102.8999 + 734 0.0000 3.806802 103.5883 + 735 0.0000 3.819086 103.9226 + 736 0.0000 3.831134 104.2505 + 737 0.0000 3.845506 104.6415 + 738 0.0000 3.859372 105.0189 + 739 0.0000 3.866240 105.2057 + 740 0.0000 3.878485 105.5390 + 741 0.0000 3.886937 105.7689 + 742 0.0000 3.903172 106.2107 + 743 0.0000 3.915748 106.5529 + 744 0.0000 3.934527 107.0639 + 745 0.0000 3.942031 107.2681 + 746 0.0000 3.955784 107.6424 + 747 0.0000 3.989811 108.5683 + 748 0.0000 4.002728 108.9198 + 749 0.0000 4.004585 108.9703 + 750 0.0000 4.021252 109.4238 + 751 0.0000 4.025830 109.5484 + 752 0.0000 4.034649 109.7884 + 753 0.0000 4.038934 109.9050 + 754 0.0000 4.045425 110.0816 + 755 0.0000 4.048126 110.1551 + 756 0.0000 4.059887 110.4751 + 757 0.0000 4.067348 110.6782 + 758 0.0000 4.070093 110.7528 + 759 0.0000 4.077954 110.9668 + 760 0.0000 4.083076 111.1061 + 761 0.0000 4.091827 111.3443 + 762 0.0000 4.104491 111.6889 + 763 0.0000 4.110785 111.8602 + 764 0.0000 4.120585 112.1268 + 765 0.0000 4.130890 112.4072 + 766 0.0000 4.134412 112.5031 + 767 0.0000 4.140923 112.6802 + 768 0.0000 4.145713 112.8106 + 769 0.0000 4.147556 112.8607 + 770 0.0000 4.158957 113.1710 + 771 0.0000 4.164800 113.3300 + 772 0.0000 4.166268 113.3699 + 773 0.0000 4.179661 113.7344 + 774 0.0000 4.186519 113.9210 + 775 0.0000 4.196542 114.1937 + 776 0.0000 4.200281 114.2955 + 777 0.0000 4.205810 114.4459 + 778 0.0000 4.217820 114.7727 + 779 0.0000 4.225292 114.9760 + 780 0.0000 4.248767 115.6148 + 781 0.0000 4.259784 115.9146 + 782 0.0000 4.270059 116.1942 + 783 0.0000 4.280631 116.4819 + 784 0.0000 4.319929 117.5512 + 785 0.0000 4.330676 117.8437 + 786 0.0000 4.343378 118.1893 + 787 0.0000 4.352141 118.4278 + 788 0.0000 4.359475 118.6274 + 789 0.0000 4.360479 118.6547 + 790 0.0000 4.373858 119.0187 + 791 0.0000 4.386034 119.3500 + 792 0.0000 4.408482 119.9609 + 793 0.0000 4.416494 120.1789 + 794 0.0000 4.427399 120.4756 + 795 0.0000 4.433232 120.6344 + 796 0.0000 4.440116 120.8217 + 797 0.0000 4.445310 120.9630 + 798 0.0000 4.447748 121.0294 + 799 0.0000 4.462171 121.4218 + 800 0.0000 4.471267 121.6694 + 801 0.0000 4.472160 121.6936 + 802 0.0000 4.475514 121.7849 + 803 0.0000 4.484085 122.0181 + 804 0.0000 4.487245 122.1041 + 805 0.0000 4.489634 122.1691 + 806 0.0000 4.504954 122.5860 + 807 0.0000 4.517565 122.9292 + 808 0.0000 4.520169 123.0001 + 809 0.0000 4.580103 124.6309 + 810 0.0000 4.587059 124.8202 + 811 0.0000 4.595095 125.0389 + 812 0.0000 4.611896 125.4961 + 813 0.0000 4.647149 126.4554 + 814 0.0000 4.662504 126.8732 + 815 0.0000 4.670865 127.1007 + 816 0.0000 4.681270 127.3838 + 817 0.0000 4.684899 127.4826 + 818 0.0000 4.689118 127.5974 + 819 0.0000 4.706417 128.0681 + 820 0.0000 4.721472 128.4778 + 821 0.0000 4.733769 128.8124 + 822 0.0000 4.784940 130.2048 + 823 0.0000 4.820773 131.1799 + 824 0.0000 4.864097 132.3588 + 825 0.0000 4.871765 132.5675 + 826 0.0000 4.883174 132.8779 + 827 0.0000 4.900276 133.3433 + 828 0.0000 4.915484 133.7571 + 829 0.0000 4.927064 134.0722 + 830 0.0000 4.937154 134.3468 + 831 0.0000 4.947737 134.6348 + 832 0.0000 4.962007 135.0231 + 833 0.0000 5.004973 136.1922 + 834 0.0000 5.029532 136.8605 + 835 0.0000 5.043246 137.2337 + 836 0.0000 5.120303 139.3305 + 837 0.0000 5.149670 140.1297 + 838 0.0000 5.255164 143.0003 + 839 0.0000 5.313417 144.5854 + 840 0.0000 5.367371 146.0536 + 841 0.0000 5.417039 147.4051 + 842 0.0000 5.508369 149.8904 + 843 0.0000 5.716865 155.5638 + 844 0.0000 5.804781 157.9561 + 845 0.0000 5.875796 159.8885 + 846 0.0000 6.817348 185.5095 + 847 0.0000 7.519764 204.6232 + 848 0.0000 7.547963 205.3905 + 849 0.0000 7.678332 208.9380 + 850 0.0000 7.769843 211.4282 + 851 0.0000 7.842256 213.3986 + 852 0.0000 7.888831 214.6660 + 853 0.0000 7.918428 215.4714 + 854 0.0000 7.950439 216.3424 + 855 0.0000 15.734199 428.1493 + 856 0.0000 15.814157 430.3251 + 857 0.0000 22.372607 608.7896 + 858 0.0000 22.380363 609.0006 + 859 0.0000 22.385200 609.1323 + 860 0.0000 22.401921 609.5873 + 861 0.0000 22.419676 610.0704 + 862 0.0000 22.432778 610.4269 + 863 0.0000 22.453217 610.9831 + 864 0.0000 22.461335 611.2040 + 865 0.0000 22.528707 613.0373 + 866 0.0000 22.593273 614.7942 + 867 0.0000 22.619317 615.5029 + 868 0.0000 22.639691 616.0573 + 869 0.0000 22.679415 617.1382 + 870 0.0000 32.251282 877.6020 + 871 0.0000 32.602310 887.1540 + + ******************************** + * MULLIKEN POPULATION ANALYSIS * + ******************************** + +-------------------------------------------- +MULLIKEN ATOMIC CHARGES AND SPIN POPULATIONS +-------------------------------------------- + 0 Fe: 0.283625 3.600842 + 1 Br: -0.469242 0.152498 + 2 Br: -0.470486 0.161275 + 3 P : 0.297075 0.024122 + 4 P : 0.319160 0.020933 + 5 N : -0.153274 -0.000556 + 6 N : -0.336799 -0.003061 + 7 H : 0.218730 -0.000298 + 8 C : -0.044319 0.008793 + 9 H : 0.108002 -0.000443 + 10 C : -0.389991 0.001329 + 11 H : 0.121191 -0.000375 + 12 H : 0.086873 -0.000129 + 13 H : 0.168207 -0.000575 + 14 C : -0.379361 0.001956 + 15 H : 0.124084 0.001739 + 16 H : 0.134847 -0.000146 + 17 H : 0.118293 -0.000028 + 18 C : -0.132048 0.002330 + 19 H : 0.092078 0.004285 + 20 C : -0.335719 0.000055 + 21 H : 0.116375 -0.000335 + 22 H : 0.148067 -0.000248 + 23 H : 0.119847 0.000029 + 24 C : -0.375043 0.002409 + 25 H : 0.116622 0.000137 + 26 H : 0.124796 -0.000235 + 27 H : 0.165907 -0.000690 + 28 C : -0.285701 -0.001202 + 29 H : 0.134194 0.000387 + 30 H : 0.111671 0.000674 + 31 H : 0.146095 0.000016 + 32 C : -0.117849 0.004857 + 33 H : 0.096522 -0.000401 + 34 C : -0.360354 0.001974 + 35 H : 0.115128 0.000019 + 36 H : 0.102812 -0.000189 + 37 H : 0.174113 -0.000459 + 38 C : -0.352384 0.002187 + 39 H : 0.126472 0.001318 + 40 H : 0.131743 -0.000150 + 41 H : 0.124057 -0.000136 + 42 C : -0.022437 0.010797 + 43 H : 0.082102 0.004017 + 44 C : -0.375257 0.001521 + 45 H : 0.114949 -0.000118 + 46 H : 0.161575 -0.000275 + 47 H : 0.107388 -0.000201 + 48 C : -0.372584 0.000876 + 49 H : 0.117088 -0.000408 + 50 H : 0.116577 -0.000085 + 51 H : 0.146586 -0.000632 +Sum of atomic charges : -0.0000000 +Sum of atomic spin populations: 4.0000000 + +----------------------------------------------------- +MULLIKEN REDUCED ORBITAL CHARGES AND SPIN POPULATIONS +----------------------------------------------------- +CHARGE + 0 Fes : 6.541691 s : 6.541691 + pz : 4.246727 p : 12.716457 + px : 4.216162 + py : 4.253567 + dz2 : 1.213354 d : 6.457762 + dxz : 1.124780 + dyz : 1.148282 + dx2y2 : 1.798037 + dxy : 1.173308 + f0 : 0.000078 f : 0.000465 + f+1 : 0.000068 + f-1 : 0.000090 + f+2 : 0.000056 + f-2 : 0.000041 + f+3 : 0.000074 + f-3 : 0.000059 + 1 Brs : 7.976303 s : 7.976303 + pz : 5.817632 p : 17.465150 + px : 5.895758 + py : 5.751761 + dz2 : 2.005753 d : 10.025581 + dxz : 2.003222 + dyz : 2.007049 + dx2y2 : 2.004458 + dxy : 2.005100 + f0 : 0.000280 f : 0.002207 + f+1 : 0.000080 + f-1 : 0.000597 + f+2 : 0.000523 + f-2 : 0.000332 + f+3 : 0.000177 + f-3 : 0.000217 + 2 Brs : 7.973744 s : 7.973744 + pz : 5.717863 p : 17.469371 + px : 5.895801 + py : 5.855707 + dz2 : 2.008522 d : 10.025184 + dxz : 2.005922 + dyz : 2.006325 + dx2y2 : 2.002239 + dxy : 2.002177 + f0 : 0.000738 f : 0.002187 + f+1 : 0.000437 + f-1 : 0.000588 + f+2 : 0.000183 + f-2 : 0.000174 + f+3 : 0.000039 + f-3 : 0.000027 + 3 P s : 5.567140 s : 5.567140 + pz : 2.794629 p : 8.651321 + px : 2.940226 + py : 2.916466 + dz2 : 0.092070 d : 0.438635 + dxz : 0.126422 + dyz : 0.070499 + dx2y2 : 0.076048 + dxy : 0.073596 + f0 : 0.005250 f : 0.045829 + f+1 : 0.006232 + f-1 : 0.008833 + f+2 : 0.006938 + f-2 : 0.007444 + f+3 : 0.005250 + f-3 : 0.005884 + 4 P s : 5.584613 s : 5.584613 + pz : 2.875430 p : 8.638076 + px : 2.805776 + py : 2.956869 + dz2 : 0.085420 d : 0.412722 + dxz : 0.099465 + dyz : 0.065314 + dx2y2 : 0.068831 + dxy : 0.093691 + f0 : 0.007962 f : 0.045429 + f+1 : 0.005809 + f-1 : 0.005279 + f+2 : 0.004277 + f-2 : 0.008982 + f+3 : 0.006316 + f-3 : 0.006803 + 5 N s : 3.428097 s : 3.428097 + pz : 1.513621 p : 3.626703 + px : 0.921442 + py : 1.191640 + dz2 : 0.010525 d : 0.093167 + dxz : 0.020259 + dyz : 0.011175 + dx2y2 : 0.024621 + dxy : 0.026588 + f0 : 0.000635 f : 0.005307 + f+1 : 0.000710 + f-1 : 0.000643 + f+2 : 0.000880 + f-2 : 0.000565 + f+3 : 0.000784 + f-3 : 0.001091 + 6 N s : 3.486092 s : 3.486092 + pz : 1.393404 p : 3.772928 + px : 1.021127 + py : 1.358397 + dz2 : 0.013161 d : 0.073486 + dxz : 0.015153 + dyz : 0.009606 + dx2y2 : 0.017457 + dxy : 0.018109 + f0 : 0.000429 f : 0.004293 + f+1 : 0.000550 + f-1 : 0.000613 + f+2 : 0.000584 + f-2 : 0.000477 + f+3 : 0.000902 + f-3 : 0.000737 + 7 H s : 0.745183 s : 0.745183 + pz : 0.016390 p : 0.036087 + px : 0.006154 + py : 0.013543 + 8 C s : 3.072804 s : 3.072804 + pz : 0.946111 p : 2.831227 + px : 0.939866 + py : 0.945250 + dz2 : 0.027993 d : 0.133326 + dxz : 0.031025 + dyz : 0.017596 + dx2y2 : 0.030547 + dxy : 0.026165 + f0 : 0.001096 f : 0.006961 + f+1 : 0.001100 + f-1 : 0.000523 + f+2 : 0.000681 + f-2 : 0.001350 + f+3 : 0.001263 + f-3 : 0.000948 + 9 H s : 0.870340 s : 0.870340 + pz : 0.005553 p : 0.021658 + px : 0.005192 + py : 0.010914 + 10 C s : 3.261258 s : 3.261258 + pz : 1.005040 p : 3.059821 + px : 1.033046 + py : 1.021735 + dz2 : 0.020947 d : 0.064371 + dxz : 0.009820 + dyz : 0.006796 + dx2y2 : 0.010020 + dxy : 0.016787 + f0 : 0.000571 f : 0.004541 + f+1 : 0.001232 + f-1 : 0.000333 + f+2 : 0.000614 + f-2 : 0.000628 + f+3 : 0.000596 + f-3 : 0.000567 + 11 H s : 0.859098 s : 0.859098 + pz : 0.010061 p : 0.019711 + px : 0.005223 + py : 0.004427 + 12 H s : 0.893540 s : 0.893540 + pz : 0.004552 p : 0.019587 + px : 0.005274 + py : 0.009761 + 13 H s : 0.809950 s : 0.809950 + pz : 0.004400 p : 0.021843 + px : 0.009328 + py : 0.008115 + 14 C s : 3.254840 s : 3.254840 + pz : 1.075163 p : 3.053489 + px : 0.985446 + py : 0.992880 + dz2 : 0.007514 d : 0.066528 + dxz : 0.019874 + dyz : 0.010155 + dx2y2 : 0.019289 + dxy : 0.009695 + f0 : 0.000694 f : 0.004504 + f+1 : 0.000747 + f-1 : 0.000205 + f+2 : 0.000263 + f-2 : 0.000904 + f+3 : 0.000920 + f-3 : 0.000770 + 15 H s : 0.856186 s : 0.856186 + pz : 0.009406 p : 0.019730 + px : 0.005773 + py : 0.004552 + 16 H s : 0.845018 s : 0.845018 + pz : 0.007000 p : 0.020135 + px : 0.008192 + py : 0.004943 + 17 H s : 0.862024 s : 0.862024 + pz : 0.005186 p : 0.019684 + px : 0.004646 + py : 0.009852 + 18 C s : 3.129482 s : 3.129482 + pz : 0.948385 p : 2.864656 + px : 0.943693 + py : 0.972578 + dz2 : 0.027797 d : 0.131033 + dxz : 0.029919 + dyz : 0.026212 + dx2y2 : 0.018356 + dxy : 0.028750 + f0 : 0.001203 f : 0.006877 + f+1 : 0.001145 + f-1 : 0.001130 + f+2 : 0.000677 + f-2 : 0.000902 + f+3 : 0.000801 + f-3 : 0.001018 + 19 H s : 0.885713 s : 0.885713 + pz : 0.004873 p : 0.022209 + px : 0.008146 + py : 0.009190 + 20 C s : 3.228148 s : 3.228148 + pz : 0.923427 p : 3.041189 + px : 1.048954 + py : 1.068808 + dz2 : 0.013389 d : 0.061934 + dxz : 0.017100 + dyz : 0.011990 + dx2y2 : 0.004153 + dxy : 0.015302 + f0 : 0.001039 f : 0.004448 + f+1 : 0.000926 + f-1 : 0.000685 + f+2 : 0.000423 + f-2 : 0.000518 + f+3 : 0.000634 + f-3 : 0.000222 + 21 H s : 0.864024 s : 0.864024 + pz : 0.007295 p : 0.019601 + px : 0.007531 + py : 0.004775 + 22 H s : 0.830795 s : 0.830795 + pz : 0.004209 p : 0.021138 + px : 0.008048 + py : 0.008882 + 23 H s : 0.859962 s : 0.859962 + pz : 0.005209 p : 0.020191 + px : 0.006076 + py : 0.008907 + 24 C s : 3.253200 s : 3.253200 + pz : 1.039495 p : 3.053841 + px : 1.048339 + py : 0.966008 + dz2 : 0.011819 d : 0.063479 + dxz : 0.013496 + dyz : 0.008457 + dx2y2 : 0.012328 + dxy : 0.017379 + f0 : 0.000418 f : 0.004523 + f+1 : 0.000930 + f-1 : 0.000508 + f+2 : 0.000416 + f-2 : 0.000561 + f+3 : 0.000778 + f-3 : 0.000911 + 25 H s : 0.863645 s : 0.863645 + pz : 0.006865 p : 0.019733 + px : 0.007974 + py : 0.004894 + 26 H s : 0.855301 s : 0.855301 + pz : 0.009779 p : 0.019903 + px : 0.005803 + py : 0.004321 + 27 H s : 0.813917 s : 0.813917 + pz : 0.004194 p : 0.020176 + px : 0.007333 + py : 0.008650 + 28 C s : 3.233358 s : 3.233358 + pz : 1.045832 p : 2.951349 + px : 1.012248 + py : 0.893269 + dz2 : 0.015988 d : 0.093910 + dxz : 0.010309 + dyz : 0.031147 + dx2y2 : 0.022954 + dxy : 0.013511 + f0 : 0.000446 f : 0.007085 + f+1 : 0.000952 + f-1 : 0.001497 + f+2 : 0.001035 + f-2 : 0.001148 + f+3 : 0.000968 + f-3 : 0.001038 + 29 H s : 0.846458 s : 0.846458 + pz : 0.009241 p : 0.019347 + px : 0.005498 + py : 0.004608 + 30 H s : 0.869289 s : 0.869289 + pz : 0.006536 p : 0.019040 + px : 0.004032 + py : 0.008472 + 31 H s : 0.833669 s : 0.833669 + pz : 0.004932 p : 0.020236 + px : 0.011039 + py : 0.004265 + 32 C s : 3.116763 s : 3.116763 + pz : 0.962641 p : 2.861303 + px : 0.937605 + py : 0.961057 + dz2 : 0.014003 d : 0.132911 + dxz : 0.034022 + dyz : 0.023830 + dx2y2 : 0.032488 + dxy : 0.028569 + f0 : 0.000528 f : 0.006872 + f+1 : 0.000991 + f-1 : 0.000696 + f+2 : 0.000786 + f-2 : 0.001282 + f+3 : 0.001189 + f-3 : 0.001401 + 33 H s : 0.881958 s : 0.881958 + pz : 0.009448 p : 0.021520 + px : 0.007367 + py : 0.004706 + 34 C s : 3.240775 s : 3.240775 + pz : 1.033590 p : 3.052428 + px : 0.994286 + py : 1.024552 + dz2 : 0.006796 d : 0.062680 + dxz : 0.017938 + dyz : 0.009406 + dx2y2 : 0.015280 + dxy : 0.013260 + f0 : 0.000259 f : 0.004470 + f+1 : 0.000880 + f-1 : 0.000450 + f+2 : 0.000406 + f-2 : 0.001004 + f+3 : 0.000898 + f-3 : 0.000573 + 35 H s : 0.865261 s : 0.865261 + pz : 0.008702 p : 0.019611 + px : 0.006114 + py : 0.004795 + 36 H s : 0.876618 s : 0.876618 + pz : 0.007855 p : 0.020570 + px : 0.007940 + py : 0.004775 + 37 H s : 0.805301 s : 0.805301 + pz : 0.004870 p : 0.020586 + px : 0.005723 + py : 0.009993 + 38 C s : 3.234125 s : 3.234125 + pz : 1.058353 p : 3.048903 + px : 1.027308 + py : 0.963241 + dz2 : 0.006875 d : 0.064918 + dxz : 0.018384 + dyz : 0.012741 + dx2y2 : 0.009938 + dxy : 0.016979 + f0 : 0.000271 f : 0.004439 + f+1 : 0.000793 + f-1 : 0.000519 + f+2 : 0.000421 + f-2 : 0.000992 + f+3 : 0.000619 + f-3 : 0.000824 + 39 H s : 0.853799 s : 0.853799 + pz : 0.007907 p : 0.019729 + px : 0.006258 + py : 0.005564 + 40 H s : 0.848363 s : 0.848363 + pz : 0.005195 p : 0.019895 + px : 0.006907 + py : 0.007793 + 41 H s : 0.856102 s : 0.856102 + pz : 0.008111 p : 0.019841 + px : 0.007437 + py : 0.004294 + 42 C s : 3.069547 s : 3.069547 + pz : 0.931990 p : 2.813358 + px : 0.946373 + py : 0.934995 + dz2 : 0.031961 d : 0.132547 + dxz : 0.027800 + dyz : 0.017352 + dx2y2 : 0.027700 + dxy : 0.027734 + f0 : 0.001146 f : 0.006984 + f+1 : 0.001282 + f-1 : 0.000488 + f+2 : 0.000429 + f-2 : 0.001370 + f+3 : 0.001260 + f-3 : 0.001009 + 43 H s : 0.896267 s : 0.896267 + pz : 0.005054 p : 0.021631 + px : 0.005799 + py : 0.010777 + 44 C s : 3.246893 s : 3.246893 + pz : 1.058087 p : 3.061361 + px : 0.992250 + py : 1.011023 + dz2 : 0.009706 d : 0.062535 + dxz : 0.015476 + dyz : 0.007741 + dx2y2 : 0.019880 + dxy : 0.009732 + f0 : 0.000791 f : 0.004469 + f+1 : 0.000724 + f-1 : 0.000223 + f+2 : 0.000217 + f-2 : 0.000679 + f+3 : 0.001054 + f-3 : 0.000780 + 45 H s : 0.865251 s : 0.865251 + pz : 0.009963 p : 0.019801 + px : 0.005346 + py : 0.004491 + 46 H s : 0.818318 s : 0.818318 + pz : 0.004632 p : 0.020107 + px : 0.005332 + py : 0.010144 + 47 H s : 0.871820 s : 0.871820 + pz : 0.007230 p : 0.020793 + px : 0.009136 + py : 0.004426 + 48 C s : 3.243003 s : 3.243003 + pz : 0.987777 p : 3.058870 + px : 0.990242 + py : 1.080851 + dz2 : 0.022382 d : 0.066090 + dxz : 0.010119 + dyz : 0.005023 + dx2y2 : 0.006729 + dxy : 0.021838 + f0 : 0.000655 f : 0.004620 + f+1 : 0.001388 + f-1 : 0.000338 + f+2 : 0.000460 + f-2 : 0.000581 + f+3 : 0.000773 + f-3 : 0.000426 + 49 H s : 0.863388 s : 0.863388 + pz : 0.010061 p : 0.019524 + px : 0.005070 + py : 0.004394 + 50 H s : 0.863436 s : 0.863436 + pz : 0.004318 p : 0.019988 + px : 0.008190 + py : 0.007480 + 51 H s : 0.832736 s : 0.832736 + pz : 0.004326 p : 0.020678 + px : 0.005848 + py : 0.010504 + +SPIN + 0 Fes : 0.081068 s : 0.081068 + pz : 0.053539 p : 0.112028 + px : 0.029959 + py : 0.028529 + dz2 : 0.786789 d : 3.407755 + dxz : 0.879728 + dyz : 0.802523 + dx2y2 : 0.128080 + dxy : 0.810636 + f0 : 0.000005 f : -0.000008 + f+1 : 0.000018 + f-1 : 0.000000 + f+2 : 0.000001 + f-2 : 0.000001 + f+3 : -0.000010 + f-3 : -0.000023 + 1 Brs : 0.000270 s : 0.000270 + pz : 0.048345 p : 0.148734 + px : 0.054950 + py : 0.045439 + dz2 : 0.001179 d : 0.003174 + dxz : 0.001188 + dyz : -0.000417 + dx2y2 : 0.000137 + dxy : 0.001086 + f0 : 0.000028 f : 0.000320 + f+1 : 0.000026 + f-1 : 0.000072 + f+2 : 0.000013 + f-2 : 0.000105 + f+3 : 0.000057 + f-3 : 0.000020 + 2 Brs : 0.000235 s : 0.000235 + pz : 0.041116 p : 0.157674 + px : 0.053915 + py : 0.062643 + dz2 : 0.000139 d : 0.003049 + dxz : 0.001912 + dyz : 0.000891 + dx2y2 : -0.000005 + dxy : 0.000112 + f0 : 0.000058 f : 0.000317 + f+1 : 0.000117 + f-1 : 0.000055 + f+2 : 0.000040 + f-2 : 0.000042 + f+3 : 0.000003 + f-3 : 0.000002 + 3 P s : 0.009165 s : 0.009165 + pz : -0.002415 p : 0.016361 + px : 0.006961 + py : 0.011815 + dz2 : -0.001407 d : -0.001993 + dxz : 0.004814 + dyz : 0.000439 + dx2y2 : -0.005095 + dxy : -0.000743 + f0 : 0.000105 f : 0.000588 + f+1 : 0.000185 + f-1 : 0.000078 + f+2 : -0.000004 + f-2 : 0.000298 + f+3 : -0.000153 + f-3 : 0.000080 + 4 P s : 0.011197 s : 0.011197 + pz : -0.003747 p : 0.009760 + px : -0.005672 + py : 0.019179 + dz2 : -0.000205 d : -0.000555 + dxz : 0.004034 + dyz : 0.001929 + dx2y2 : -0.003910 + dxy : -0.002404 + f0 : 0.000235 f : 0.000531 + f+1 : 0.000231 + f-1 : 0.000084 + f+2 : -0.000004 + f-2 : 0.000132 + f+3 : 0.000071 + f-3 : -0.000216 + 5 N s : -0.000816 s : -0.000816 + pz : 0.001022 p : -0.000155 + px : 0.000645 + py : -0.001822 + dz2 : -0.000010 d : 0.000416 + dxz : -0.000002 + dyz : 0.000043 + dx2y2 : 0.000296 + dxy : 0.000089 + f0 : 0.000000 f : -0.000002 + f+1 : -0.000000 + f-1 : -0.000001 + f+2 : 0.000000 + f-2 : -0.000001 + f+3 : -0.000002 + f-3 : 0.000001 + 6 N s : -0.000182 s : -0.000182 + pz : 0.000983 p : -0.003054 + px : -0.000769 + py : -0.003268 + dz2 : 0.000008 d : 0.000172 + dxz : -0.000010 + dyz : -0.000030 + dx2y2 : 0.000221 + dxy : -0.000017 + f0 : -0.000000 f : 0.000004 + f+1 : -0.000001 + f-1 : 0.000001 + f+2 : 0.000000 + f-2 : -0.000000 + f+3 : 0.000000 + f-3 : 0.000003 + 7 H s : -0.000295 s : -0.000295 + pz : -0.000005 p : -0.000004 + px : 0.000000 + py : 0.000001 + 8 C s : 0.002021 s : 0.002021 + pz : 0.002922 p : 0.006367 + px : 0.001781 + py : 0.001664 + dz2 : 0.000195 d : 0.000390 + dxz : -0.000023 + dyz : 0.000074 + dx2y2 : -0.000033 + dxy : 0.000177 + f0 : 0.000016 f : 0.000014 + f+1 : 0.000000 + f-1 : 0.000001 + f+2 : -0.000003 + f-2 : -0.000001 + f+3 : -0.000001 + f-3 : 0.000002 + 9 H s : -0.000446 s : -0.000446 + pz : 0.000006 p : 0.000003 + px : 0.000002 + py : -0.000005 + 10 C s : 0.000585 s : 0.000585 + pz : 0.000654 p : 0.000685 + px : 0.000298 + py : -0.000267 + dz2 : -0.000021 d : 0.000051 + dxz : 0.000009 + dyz : 0.000017 + dx2y2 : 0.000023 + dxy : 0.000023 + f0 : 0.000002 f : 0.000009 + f+1 : 0.000007 + f-1 : -0.000000 + f+2 : 0.000000 + f-2 : 0.000001 + f+3 : -0.000000 + f-3 : -0.000000 + 11 H s : -0.000372 s : -0.000372 + pz : 0.000002 p : -0.000002 + px : -0.000002 + py : -0.000003 + 12 H s : -0.000131 s : -0.000131 + pz : 0.000001 p : 0.000003 + px : 0.000001 + py : 0.000001 + 13 H s : -0.000575 s : -0.000575 + pz : 0.000034 p : 0.000001 + px : -0.000022 + py : -0.000011 + 14 C s : -0.000186 s : -0.000186 + pz : -0.000347 p : 0.001985 + px : 0.001533 + py : 0.000800 + dz2 : -0.000003 d : 0.000150 + dxz : 0.000134 + dyz : 0.000039 + dx2y2 : -0.000009 + dxy : -0.000012 + f0 : 0.000001 f : 0.000008 + f+1 : -0.000000 + f-1 : 0.000000 + f+2 : 0.000001 + f-2 : 0.000006 + f+3 : 0.000000 + f-3 : 0.000000 + 15 H s : 0.001718 s : 0.001718 + pz : 0.000003 p : 0.000021 + px : 0.000009 + py : 0.000009 + 16 H s : -0.000150 s : -0.000150 + pz : -0.000000 p : 0.000004 + px : 0.000002 + py : 0.000003 + 17 H s : -0.000033 s : -0.000033 + pz : -0.000001 p : 0.000005 + px : -0.000000 + py : 0.000006 + 18 C s : 0.001234 s : 0.001234 + pz : 0.000320 p : 0.000361 + px : 0.000755 + py : -0.000713 + dz2 : 0.000038 d : 0.000713 + dxz : 0.000012 + dyz : 0.000101 + dx2y2 : 0.000069 + dxy : 0.000492 + f0 : -0.000001 f : 0.000022 + f+1 : -0.000002 + f-1 : 0.000005 + f+2 : 0.000002 + f-2 : 0.000012 + f+3 : 0.000005 + f-3 : 0.000002 + 19 H s : 0.004240 s : 0.004240 + pz : 0.000029 p : 0.000045 + px : 0.000002 + py : 0.000013 + 20 C s : -0.000079 s : -0.000079 + pz : -0.000113 p : 0.000130 + px : 0.000024 + py : 0.000220 + dz2 : -0.000035 d : -0.000002 + dxz : -0.000031 + dyz : -0.000002 + dx2y2 : 0.000051 + dxy : 0.000014 + f0 : 0.000000 f : 0.000006 + f+1 : -0.000000 + f-1 : 0.000001 + f+2 : 0.000002 + f-2 : 0.000001 + f+3 : 0.000000 + f-3 : 0.000001 + 21 H s : -0.000332 s : -0.000332 + pz : 0.000001 p : -0.000003 + px : -0.000001 + py : -0.000003 + 22 H s : -0.000245 s : -0.000245 + pz : 0.000003 p : -0.000003 + px : -0.000018 + py : 0.000012 + 23 H s : 0.000026 s : 0.000026 + pz : 0.000002 p : 0.000003 + px : 0.000001 + py : 0.000000 + 24 C s : 0.000828 s : 0.000828 + pz : 0.000548 p : 0.001513 + px : 0.001088 + py : -0.000123 + dz2 : 0.000003 d : 0.000062 + dxz : 0.000053 + dyz : 0.000001 + dx2y2 : 0.000023 + dxy : -0.000018 + f0 : 0.000000 f : 0.000005 + f+1 : 0.000000 + f-1 : -0.000000 + f+2 : 0.000001 + f-2 : 0.000000 + f+3 : 0.000004 + f-3 : -0.000000 + 25 H s : 0.000138 s : 0.000138 + pz : -0.000000 p : -0.000001 + px : 0.000001 + py : -0.000002 + 26 H s : -0.000238 s : -0.000238 + pz : 0.000001 p : 0.000003 + px : 0.000002 + py : 0.000001 + 27 H s : -0.000667 s : -0.000667 + pz : 0.000006 p : -0.000023 + px : -0.000025 + py : -0.000005 + 28 C s : -0.000559 s : -0.000559 + pz : -0.000246 p : -0.000731 + px : -0.000139 + py : -0.000346 + dz2 : -0.000005 d : 0.000081 + dxz : 0.000020 + dyz : 0.000035 + dx2y2 : 0.000002 + dxy : 0.000029 + f0 : 0.000000 f : 0.000008 + f+1 : 0.000001 + f-1 : 0.000002 + f+2 : -0.000001 + f-2 : 0.000004 + f+3 : 0.000002 + f-3 : -0.000000 + 29 H s : 0.000386 s : 0.000386 + pz : 0.000001 p : 0.000001 + px : -0.000001 + py : 0.000001 + 30 H s : 0.000670 s : 0.000670 + pz : -0.000002 p : 0.000004 + px : 0.000001 + py : 0.000005 + 31 H s : 0.000022 s : 0.000022 + pz : -0.000001 p : -0.000006 + px : -0.000001 + py : -0.000004 + 32 C s : 0.001416 s : 0.001416 + pz : 0.001206 p : 0.002894 + px : 0.000979 + py : 0.000709 + dz2 : 0.000089 d : 0.000525 + dxz : 0.000021 + dyz : 0.000032 + dx2y2 : 0.000036 + dxy : 0.000347 + f0 : 0.000007 f : 0.000022 + f+1 : 0.000008 + f-1 : -0.000000 + f+2 : 0.000004 + f-2 : -0.000002 + f+3 : 0.000005 + f-3 : 0.000001 + 33 H s : -0.000398 s : -0.000398 + pz : 0.000007 p : -0.000003 + px : -0.000008 + py : -0.000002 + 34 C s : 0.000611 s : 0.000611 + pz : 0.000570 p : 0.001276 + px : 0.000403 + py : 0.000302 + dz2 : 0.000011 d : 0.000081 + dxz : 0.000011 + dyz : 0.000035 + dx2y2 : 0.000004 + dxy : 0.000021 + f0 : 0.000000 f : 0.000007 + f+1 : 0.000000 + f-1 : 0.000001 + f+2 : 0.000000 + f-2 : 0.000003 + f+3 : 0.000000 + f-3 : 0.000001 + 35 H s : 0.000022 s : 0.000022 + pz : -0.000000 p : -0.000003 + px : -0.000000 + py : -0.000002 + 36 H s : -0.000191 s : -0.000191 + pz : -0.000001 p : 0.000002 + px : 0.000003 + py : 0.000000 + 37 H s : -0.000440 s : -0.000440 + pz : 0.000010 p : -0.000019 + px : -0.000016 + py : -0.000013 + 38 C s : 0.000058 s : 0.000058 + pz : -0.000112 p : 0.002010 + px : 0.000625 + py : 0.001498 + dz2 : -0.000013 d : 0.000113 + dxz : 0.000026 + dyz : 0.000082 + dx2y2 : 0.000001 + dxy : 0.000017 + f0 : 0.000002 f : 0.000006 + f+1 : -0.000002 + f-1 : 0.000000 + f+2 : 0.000002 + f-2 : 0.000004 + f+3 : -0.000001 + f-3 : 0.000000 + 39 H s : 0.001297 s : 0.001297 + pz : 0.000010 p : 0.000021 + px : 0.000001 + py : 0.000010 + 40 H s : -0.000151 s : -0.000151 + pz : -0.000001 p : 0.000001 + px : 0.000001 + py : 0.000000 + 41 H s : -0.000140 s : -0.000140 + pz : -0.000001 p : 0.000004 + px : 0.000002 + py : 0.000003 + 42 C s : 0.002540 s : 0.002540 + pz : 0.005346 p : 0.007606 + px : 0.002312 + py : -0.000051 + dz2 : 0.000041 d : 0.000633 + dxz : 0.000025 + dyz : 0.000324 + dx2y2 : -0.000013 + dxy : 0.000255 + f0 : 0.000003 f : 0.000018 + f+1 : -0.000001 + f-1 : 0.000015 + f+2 : -0.000002 + f-2 : 0.000005 + f+3 : -0.000002 + f-3 : -0.000000 + 43 H s : 0.003926 s : 0.003926 + pz : 0.000080 p : 0.000091 + px : 0.000010 + py : 0.000001 + 44 C s : 0.000586 s : 0.000586 + pz : 0.001028 p : 0.000839 + px : -0.000134 + py : -0.000055 + dz2 : 0.000014 d : 0.000085 + dxz : 0.000011 + dyz : 0.000072 + dx2y2 : -0.000010 + dxy : -0.000002 + f0 : 0.000003 f : 0.000011 + f+1 : 0.000001 + f-1 : 0.000000 + f+2 : 0.000003 + f-2 : 0.000003 + f+3 : 0.000000 + f-3 : 0.000001 + 45 H s : -0.000120 s : -0.000120 + pz : 0.000001 p : 0.000001 + px : -0.000000 + py : 0.000001 + 46 H s : -0.000259 s : -0.000259 + pz : 0.000006 p : -0.000016 + px : -0.000011 + py : -0.000012 + 47 H s : -0.000203 s : -0.000203 + pz : 0.000000 p : 0.000002 + px : 0.000003 + py : -0.000001 + 48 C s : 0.000110 s : 0.000110 + pz : 0.000493 p : 0.000685 + px : -0.000117 + py : 0.000310 + dz2 : -0.000031 d : 0.000068 + dxz : 0.000019 + dyz : 0.000017 + dx2y2 : 0.000042 + dxy : 0.000022 + f0 : -0.000000 f : 0.000012 + f+1 : 0.000008 + f-1 : 0.000004 + f+2 : 0.000000 + f-2 : -0.000000 + f+3 : 0.000000 + f-3 : 0.000000 + 49 H s : -0.000408 s : -0.000408 + pz : 0.000001 p : 0.000000 + px : 0.000001 + py : -0.000001 + 50 H s : -0.000088 s : -0.000088 + pz : 0.000002 p : 0.000004 + px : 0.000003 + py : -0.000001 + 51 H s : -0.000631 s : -0.000631 + pz : 0.000015 p : -0.000001 + px : -0.000005 + py : -0.000010 + + + ******************************* + * LOEWDIN POPULATION ANALYSIS * + ******************************* + +------------------------------------------- +LOEWDIN ATOMIC CHARGES AND SPIN POPULATIONS +------------------------------------------- + 0 Fe: -0.714297 3.498654 + 1 Br: -0.042005 0.176212 + 2 Br: -0.041525 0.184967 + 3 P : 0.688871 0.047923 + 4 P : 0.692060 0.048397 + 5 N : -0.098627 0.002490 + 6 N : -0.152299 -0.001170 + 7 H : 0.155635 -0.000182 + 8 C : -0.418516 0.007636 + 9 H : 0.159592 -0.000137 + 10 C : -0.308146 0.000189 + 11 H : 0.125770 -0.000174 + 12 H : 0.112667 -0.000033 + 13 H : 0.122827 -0.000348 + 14 C : -0.302536 0.003003 + 15 H : 0.125914 0.000907 + 16 H : 0.120113 0.000003 + 17 H : 0.121033 0.000015 + 18 C : -0.410152 0.005539 + 19 H : 0.139036 0.002471 + 20 C : -0.294882 0.000090 + 21 H : 0.122975 -0.000161 + 22 H : 0.126008 -0.000221 + 23 H : 0.118089 -0.000011 + 24 C : -0.295387 0.000355 + 25 H : 0.124770 0.000040 + 26 H : 0.119085 0.000018 + 27 H : 0.133765 -0.000246 + 28 C : -0.339014 0.000504 + 29 H : 0.115280 0.000148 + 30 H : 0.105136 0.000336 + 31 H : 0.120350 0.000083 + 32 C : -0.412363 0.006421 + 33 H : 0.155357 -0.000212 + 34 C : -0.294426 0.000283 + 35 H : 0.124539 0.000017 + 36 H : 0.116157 -0.000016 + 37 H : 0.131003 -0.000257 + 38 C : -0.301974 0.002758 + 39 H : 0.125127 0.000721 + 40 H : 0.119203 0.000017 + 41 H : 0.123239 -0.000030 + 42 C : -0.412040 0.010155 + 43 H : 0.143841 0.002443 + 44 C : -0.295856 0.000447 + 45 H : 0.125874 -0.000054 + 46 H : 0.134485 -0.000223 + 47 H : 0.114201 0.000004 + 48 C : -0.301387 0.000638 + 49 H : 0.124223 -0.000184 + 50 H : 0.119974 0.000010 + 51 H : 0.129234 -0.000235 + +---------------------------------------------------- +LOEWDIN REDUCED ORBITAL CHARGES AND SPIN POPULATIONS +---------------------------------------------------- +CHARGE + 0 Fes : 6.466504 s : 6.466504 + pz : 4.305252 p : 12.896168 + px : 4.268419 + py : 4.322498 + dz2 : 1.447058 d : 7.350885 + dxz : 1.237587 + dyz : 1.405734 + dx2y2 : 1.889086 + dxy : 1.371420 + f0 : 0.000118 f : 0.000741 + f+1 : 0.000112 + f-1 : 0.000137 + f+2 : 0.000098 + f-2 : 0.000069 + f+3 : 0.000124 + f-3 : 0.000083 + 1 Brs : 7.697555 s : 7.697555 + pz : 5.757631 p : 17.292314 + px : 5.815952 + py : 5.718731 + dz2 : 2.009589 d : 10.048131 + dxz : 2.005748 + dyz : 2.016314 + dx2y2 : 2.009175 + dxy : 2.007305 + f0 : 0.000509 f : 0.004006 + f+1 : 0.000150 + f-1 : 0.001115 + f+2 : 0.000955 + f-2 : 0.000591 + f+3 : 0.000292 + f-3 : 0.000394 + 2 Brs : 7.697500 s : 7.697500 + pz : 5.689081 p : 17.292435 + px : 5.815206 + py : 5.788148 + dz2 : 2.017694 d : 10.047632 + dxz : 2.010261 + dyz : 2.013391 + dx2y2 : 2.003407 + dxy : 2.002878 + f0 : 0.001350 f : 0.003959 + f+1 : 0.000799 + f-1 : 0.001088 + f+2 : 0.000335 + f-2 : 0.000289 + f+3 : 0.000055 + f-3 : 0.000042 + 3 P s : 4.804303 s : 4.804303 + pz : 2.782936 p : 8.590817 + px : 2.929224 + py : 2.878657 + dz2 : 0.160549 d : 0.771070 + dxz : 0.208733 + dyz : 0.131023 + dx2y2 : 0.124807 + dxy : 0.145958 + f0 : 0.018073 f : 0.144939 + f+1 : 0.020505 + f-1 : 0.024416 + f+2 : 0.021729 + f-2 : 0.025202 + f+3 : 0.017479 + f-3 : 0.017536 + 4 P s : 4.821048 s : 4.821048 + pz : 2.812910 p : 8.600957 + px : 2.795534 + py : 2.992513 + dz2 : 0.153723 d : 0.739437 + dxz : 0.169011 + dyz : 0.113170 + dx2y2 : 0.124907 + dxy : 0.178625 + f0 : 0.023492 f : 0.146497 + f+1 : 0.019949 + f-1 : 0.017816 + f+2 : 0.012609 + f-2 : 0.027685 + f+3 : 0.023062 + f-3 : 0.021884 + 5 N s : 2.995604 s : 2.995604 + pz : 1.425641 p : 3.767429 + px : 1.060208 + py : 1.281580 + dz2 : 0.033142 d : 0.314094 + dxz : 0.058429 + dyz : 0.041541 + dx2y2 : 0.089322 + dxy : 0.091660 + f0 : 0.001936 f : 0.021501 + f+1 : 0.003179 + f-1 : 0.001660 + f+2 : 0.003772 + f-2 : 0.001858 + f+3 : 0.003243 + f-3 : 0.005854 + 6 N s : 3.081068 s : 3.081068 + pz : 1.344889 p : 3.814013 + px : 1.097884 + py : 1.371240 + dz2 : 0.038374 d : 0.239894 + dxz : 0.048771 + dyz : 0.029857 + dx2y2 : 0.061642 + dxy : 0.061250 + f0 : 0.001897 f : 0.017323 + f+1 : 0.002382 + f-1 : 0.001565 + f+2 : 0.002784 + f-2 : 0.001444 + f+3 : 0.003772 + f-3 : 0.003479 + 7 H s : 0.734930 s : 0.734930 + pz : 0.055978 p : 0.109435 + px : 0.016501 + py : 0.036956 + 8 C s : 2.787363 s : 2.787363 + pz : 1.045351 p : 3.099989 + px : 1.038322 + py : 1.016316 + dz2 : 0.099514 d : 0.487483 + dxz : 0.117315 + dyz : 0.068670 + dx2y2 : 0.098926 + dxy : 0.103058 + f0 : 0.006333 f : 0.043682 + f+1 : 0.006572 + f-1 : 0.004190 + f+2 : 0.005312 + f-2 : 0.007853 + f+3 : 0.008165 + f-3 : 0.005257 + 9 H s : 0.781421 s : 0.781421 + pz : 0.016036 p : 0.058987 + px : 0.014290 + py : 0.028660 + 10 C s : 2.836318 s : 2.836318 + pz : 1.045045 p : 3.163704 + px : 1.061692 + py : 1.056967 + dz2 : 0.085945 d : 0.281652 + dxz : 0.053204 + dyz : 0.030674 + dx2y2 : 0.041471 + dxy : 0.070359 + f0 : 0.003051 f : 0.026472 + f+1 : 0.006010 + f-1 : 0.002948 + f+2 : 0.004801 + f-2 : 0.003423 + f+3 : 0.003171 + f-3 : 0.003067 + 11 H s : 0.815080 s : 0.815080 + pz : 0.029718 p : 0.059150 + px : 0.016628 + py : 0.012803 + 12 H s : 0.829289 s : 0.829289 + pz : 0.013919 p : 0.058044 + px : 0.014969 + py : 0.029156 + 13 H s : 0.812936 s : 0.812936 + pz : 0.012249 p : 0.064237 + px : 0.027553 + py : 0.024435 + 14 C s : 2.836834 s : 2.836834 + pz : 1.067651 p : 3.160721 + px : 1.040338 + py : 1.052731 + dz2 : 0.032780 d : 0.279217 + dxz : 0.081743 + dyz : 0.038020 + dx2y2 : 0.073894 + dxy : 0.052779 + f0 : 0.003534 f : 0.025765 + f+1 : 0.003255 + f-1 : 0.002147 + f+2 : 0.002328 + f-2 : 0.004596 + f+3 : 0.005772 + f-3 : 0.004133 + 15 H s : 0.815002 s : 0.815002 + pz : 0.030299 p : 0.059084 + px : 0.015843 + py : 0.012941 + 16 H s : 0.820090 s : 0.820090 + pz : 0.021321 p : 0.059797 + px : 0.023321 + py : 0.015155 + 17 H s : 0.819933 s : 0.819933 + pz : 0.015314 p : 0.059034 + px : 0.014369 + py : 0.029351 + 18 C s : 2.789464 s : 2.789464 + pz : 1.038715 p : 3.095572 + px : 1.034917 + py : 1.021941 + dz2 : 0.103800 d : 0.482406 + dxz : 0.115450 + dyz : 0.085487 + dx2y2 : 0.066970 + dxy : 0.110700 + f0 : 0.006668 f : 0.042710 + f+1 : 0.005641 + f-1 : 0.008634 + f+2 : 0.006380 + f-2 : 0.004786 + f+3 : 0.004780 + f-3 : 0.005821 + 19 H s : 0.800852 s : 0.800852 + pz : 0.013308 p : 0.060112 + px : 0.022732 + py : 0.024073 + 20 C s : 2.839363 s : 2.839363 + pz : 1.017477 p : 3.163638 + px : 1.071568 + py : 1.074592 + dz2 : 0.064776 d : 0.266791 + dxz : 0.077179 + dyz : 0.051799 + dx2y2 : 0.015226 + dxy : 0.057812 + f0 : 0.005521 f : 0.025090 + f+1 : 0.004053 + f-1 : 0.005147 + f+2 : 0.004416 + f-2 : 0.002325 + f+3 : 0.002579 + f-3 : 0.001049 + 21 H s : 0.817845 s : 0.817845 + pz : 0.020226 p : 0.059181 + px : 0.024741 + py : 0.014214 + 22 H s : 0.810980 s : 0.810980 + pz : 0.011730 p : 0.063012 + px : 0.024049 + py : 0.027233 + 23 H s : 0.821263 s : 0.821263 + pz : 0.014224 p : 0.060648 + px : 0.017783 + py : 0.028641 + 24 C s : 2.837994 s : 2.837994 + pz : 1.057450 p : 3.159797 + px : 1.059590 + py : 1.042757 + dz2 : 0.050316 d : 0.272126 + dxz : 0.061841 + dyz : 0.036115 + dx2y2 : 0.047717 + dxy : 0.076138 + f0 : 0.002214 f : 0.025469 + f+1 : 0.003026 + f-1 : 0.004268 + f+2 : 0.004225 + f-2 : 0.002684 + f+3 : 0.003862 + f-3 : 0.005190 + 25 H s : 0.816025 s : 0.816025 + pz : 0.021986 p : 0.059205 + px : 0.023533 + py : 0.013686 + 26 H s : 0.821181 s : 0.821181 + pz : 0.030425 p : 0.059735 + px : 0.016714 + py : 0.012596 + 27 H s : 0.804846 s : 0.804846 + pz : 0.012264 p : 0.061389 + px : 0.023416 + py : 0.025709 + 28 C s : 2.857346 s : 2.857346 + pz : 1.065740 p : 3.087859 + px : 1.050871 + py : 0.971248 + dz2 : 0.054725 d : 0.353639 + dxz : 0.042374 + dyz : 0.108760 + dx2y2 : 0.087455 + dxy : 0.060326 + f0 : 0.003463 f : 0.040170 + f+1 : 0.005624 + f-1 : 0.007818 + f+2 : 0.004046 + f-2 : 0.006029 + f+3 : 0.006506 + f-3 : 0.006684 + 29 H s : 0.825327 s : 0.825327 + pz : 0.028644 p : 0.059393 + px : 0.017718 + py : 0.013031 + 30 H s : 0.836115 s : 0.836115 + pz : 0.021590 p : 0.058749 + px : 0.011960 + py : 0.025199 + 31 H s : 0.818902 s : 0.818902 + pz : 0.014310 p : 0.060748 + px : 0.033823 + py : 0.012615 + 32 C s : 2.791377 s : 2.791377 + pz : 1.020821 p : 3.096622 + px : 1.034608 + py : 1.041193 + dz2 : 0.056992 d : 0.482081 + dxz : 0.124398 + dyz : 0.082458 + dx2y2 : 0.100883 + dxy : 0.117349 + f0 : 0.003749 f : 0.042283 + f+1 : 0.005341 + f-1 : 0.005733 + f+2 : 0.004986 + f-2 : 0.006291 + f+3 : 0.006925 + f-3 : 0.009258 + 33 H s : 0.785865 s : 0.785865 + pz : 0.026098 p : 0.058777 + px : 0.019598 + py : 0.013082 + 34 C s : 2.839005 s : 2.839005 + pz : 1.060239 p : 3.161227 + px : 1.046700 + py : 1.054288 + dz2 : 0.030613 d : 0.268784 + dxz : 0.082139 + dyz : 0.038226 + dx2y2 : 0.058302 + dxy : 0.059503 + f0 : 0.002140 f : 0.025410 + f+1 : 0.003691 + f-1 : 0.003836 + f+2 : 0.002745 + f-2 : 0.003686 + f+3 : 0.005346 + f-3 : 0.003965 + 35 H s : 0.816314 s : 0.816314 + pz : 0.026418 p : 0.059148 + px : 0.017533 + py : 0.015196 + 36 H s : 0.823346 s : 0.823346 + pz : 0.024501 p : 0.060497 + px : 0.022481 + py : 0.013516 + 37 H s : 0.806976 s : 0.806976 + pz : 0.014027 p : 0.062021 + px : 0.017725 + py : 0.030269 + 38 C s : 2.840519 s : 2.840519 + pz : 1.070572 p : 3.163278 + px : 1.059550 + py : 1.033155 + dz2 : 0.028324 d : 0.273055 + dxz : 0.070702 + dyz : 0.054427 + dx2y2 : 0.044454 + dxy : 0.075148 + f0 : 0.002240 f : 0.025121 + f+1 : 0.002998 + f-1 : 0.004451 + f+2 : 0.003031 + f-2 : 0.003215 + f+3 : 0.003574 + f-3 : 0.005612 + 39 H s : 0.815560 s : 0.815560 + pz : 0.025686 p : 0.059313 + px : 0.018308 + py : 0.015319 + 40 H s : 0.820833 s : 0.820833 + pz : 0.015230 p : 0.059964 + px : 0.022432 + py : 0.022302 + 41 H s : 0.817408 s : 0.817408 + pz : 0.024551 p : 0.059353 + px : 0.022026 + py : 0.012775 + 42 C s : 2.786754 s : 2.786754 + pz : 1.043516 p : 3.089314 + px : 1.030149 + py : 1.015649 + dz2 : 0.119411 d : 0.491737 + dxz : 0.114109 + dyz : 0.059726 + dx2y2 : 0.091781 + dxy : 0.106710 + f0 : 0.006294 f : 0.044236 + f+1 : 0.006881 + f-1 : 0.004903 + f+2 : 0.004542 + f-2 : 0.008769 + f+3 : 0.007319 + f-3 : 0.005528 + 43 H s : 0.796839 s : 0.796839 + pz : 0.014114 p : 0.059320 + px : 0.016170 + py : 0.029035 + 44 C s : 2.835741 s : 2.835741 + pz : 1.062349 p : 3.158683 + px : 1.038341 + py : 1.057993 + dz2 : 0.042909 d : 0.275505 + dxz : 0.075544 + dyz : 0.029428 + dx2y2 : 0.073443 + dxy : 0.054181 + f0 : 0.003831 f : 0.025927 + f+1 : 0.002586 + f-1 : 0.002343 + f+2 : 0.002981 + f-2 : 0.004345 + f+3 : 0.005400 + f-3 : 0.004441 + 45 H s : 0.815065 s : 0.815065 + pz : 0.031655 p : 0.059062 + px : 0.014640 + py : 0.012767 + 46 H s : 0.804463 s : 0.804463 + pz : 0.013794 p : 0.061052 + px : 0.016566 + py : 0.030692 + 47 H s : 0.825254 s : 0.825254 + pz : 0.021799 p : 0.060546 + px : 0.025537 + py : 0.013209 + 48 C s : 2.834178 s : 2.834178 + pz : 1.037679 p : 3.159961 + px : 1.049371 + py : 1.072912 + dz2 : 0.096270 d : 0.280731 + dxz : 0.055515 + dyz : 0.019346 + dx2y2 : 0.028157 + dxy : 0.081443 + f0 : 0.003008 f : 0.026517 + f+1 : 0.006154 + f-1 : 0.003380 + f+2 : 0.004537 + f-2 : 0.003702 + f+3 : 0.003591 + f-3 : 0.002145 + 49 H s : 0.816948 s : 0.816948 + pz : 0.029539 p : 0.058829 + px : 0.016365 + py : 0.012925 + 50 H s : 0.820268 s : 0.820268 + pz : 0.012264 p : 0.059758 + px : 0.023647 + py : 0.023846 + 51 H s : 0.808827 s : 0.808827 + pz : 0.012502 p : 0.061939 + px : 0.016568 + py : 0.032869 + +SPIN + 0 Fes : 0.021646 s : 0.021646 + pz : 0.044960 p : 0.108967 + px : 0.035880 + py : 0.028128 + dz2 : 0.781000 d : 3.368054 + dxz : 0.875004 + dyz : 0.786952 + dx2y2 : 0.127207 + dxy : 0.797891 + f0 : 0.000001 f : -0.000013 + f+1 : 0.000022 + f-1 : -0.000006 + f+2 : 0.000003 + f-2 : 0.000003 + f+3 : -0.000011 + f-3 : -0.000025 + 1 Brs : 0.001434 s : 0.001434 + pz : 0.052200 p : 0.154470 + px : 0.053854 + py : 0.048416 + dz2 : 0.005087 d : 0.018341 + dxz : 0.003906 + dyz : 0.002496 + dx2y2 : 0.002882 + dxy : 0.003971 + f0 : 0.000228 f : 0.001967 + f+1 : 0.000101 + f-1 : 0.000506 + f+2 : 0.000358 + f-2 : 0.000410 + f+3 : 0.000199 + f-3 : 0.000166 + 2 Brs : 0.001564 s : 0.001564 + pz : 0.048902 p : 0.163246 + px : 0.053656 + py : 0.060688 + dz2 : 0.004123 d : 0.018196 + dxz : 0.006656 + dyz : 0.005829 + dx2y2 : 0.000812 + dxy : 0.000775 + f0 : 0.000535 f : 0.001961 + f+1 : 0.000504 + f-1 : 0.000530 + f+2 : 0.000194 + f-2 : 0.000173 + f+3 : 0.000014 + f-3 : 0.000010 + 3 P s : 0.007365 s : 0.007365 + pz : 0.002983 p : 0.030043 + px : 0.008770 + py : 0.018290 + dz2 : -0.000371 d : 0.007057 + dxz : 0.007599 + dyz : 0.002611 + dx2y2 : -0.004492 + dxy : 0.001710 + f0 : 0.000464 f : 0.003458 + f+1 : 0.000912 + f-1 : 0.000321 + f+2 : 0.000066 + f-2 : 0.001207 + f+3 : -0.000116 + f-3 : 0.000604 + 4 P s : 0.008088 s : 0.008088 + pz : 0.002813 p : 0.028362 + px : -0.000517 + py : 0.026066 + dz2 : 0.001379 d : 0.008584 + dxz : 0.006301 + dyz : 0.004845 + dx2y2 : -0.003311 + dxy : -0.000631 + f0 : 0.000813 f : 0.003363 + f+1 : 0.001079 + f-1 : 0.000381 + f+2 : 0.000104 + f-2 : 0.000677 + f+3 : 0.000808 + f-3 : -0.000499 + 5 N s : -0.000527 s : -0.000527 + pz : 0.001244 p : 0.001596 + px : 0.000382 + py : -0.000029 + dz2 : -0.000004 d : 0.001390 + dxz : 0.000026 + dyz : 0.000202 + dx2y2 : 0.000915 + dxy : 0.000252 + f0 : 0.000002 f : 0.000031 + f+1 : 0.000004 + f-1 : 0.000002 + f+2 : 0.000016 + f-2 : 0.000000 + f+3 : -0.000005 + f-3 : 0.000012 + 6 N s : -0.000332 s : -0.000332 + pz : 0.000665 p : -0.001913 + px : -0.000371 + py : -0.002207 + dz2 : 0.000045 d : 0.001035 + dxz : 0.000011 + dyz : -0.000044 + dx2y2 : 0.000959 + dxy : 0.000064 + f0 : 0.000002 f : 0.000040 + f+1 : 0.000002 + f-1 : 0.000001 + f+2 : 0.000006 + f-2 : 0.000001 + f+3 : 0.000018 + f-3 : 0.000010 + 7 H s : -0.000129 s : -0.000129 + pz : 0.000004 p : -0.000054 + px : -0.000006 + py : -0.000052 + 8 C s : 0.000640 s : 0.000640 + pz : 0.002174 p : 0.004106 + px : 0.001554 + py : 0.000378 + dz2 : 0.000722 d : 0.002694 + dxz : 0.000298 + dyz : 0.000454 + dx2y2 : 0.000108 + dxy : 0.001112 + f0 : 0.000095 f : 0.000196 + f+1 : 0.000015 + f-1 : 0.000039 + f+2 : -0.000013 + f-2 : 0.000052 + f+3 : 0.000004 + f-3 : 0.000005 + 9 H s : -0.000150 s : -0.000150 + pz : 0.000012 p : 0.000013 + px : 0.000008 + py : -0.000007 + 10 C s : -0.000187 s : -0.000187 + pz : 0.000420 p : 0.000203 + px : -0.000070 + py : -0.000146 + dz2 : -0.000019 d : 0.000128 + dxz : 0.000072 + dyz : -0.000038 + dx2y2 : 0.000106 + dxy : 0.000007 + f0 : 0.000009 f : 0.000045 + f+1 : 0.000022 + f-1 : 0.000000 + f+2 : 0.000000 + f-2 : 0.000012 + f+3 : 0.000002 + f-3 : -0.000001 + 11 H s : -0.000166 s : -0.000166 + pz : 0.000004 p : -0.000008 + px : -0.000008 + py : -0.000005 + 12 H s : -0.000021 s : -0.000021 + pz : 0.000002 p : -0.000011 + px : -0.000000 + py : -0.000013 + 13 H s : -0.000273 s : -0.000273 + pz : 0.000053 p : -0.000075 + px : -0.000071 + py : -0.000056 + 14 C s : 0.000433 s : 0.000433 + pz : -0.000076 p : 0.001560 + px : 0.001136 + py : 0.000500 + dz2 : 0.000002 d : 0.000968 + dxz : 0.000583 + dyz : 0.000178 + dx2y2 : 0.000050 + dxy : 0.000155 + f0 : 0.000018 f : 0.000042 + f+1 : 0.000008 + f-1 : 0.000002 + f+2 : 0.000001 + f-2 : 0.000016 + f+3 : -0.000000 + f-3 : -0.000000 + 15 H s : 0.000844 s : 0.000844 + pz : -0.000012 p : 0.000063 + px : 0.000053 + py : 0.000022 + 16 H s : -0.000027 s : -0.000027 + pz : 0.000005 p : 0.000030 + px : 0.000017 + py : 0.000008 + 17 H s : -0.000017 s : -0.000017 + pz : -0.000001 p : 0.000032 + px : 0.000007 + py : 0.000026 + 18 C s : 0.000462 s : 0.000462 + pz : 0.000374 p : 0.001236 + px : 0.001039 + py : -0.000177 + dz2 : 0.000184 d : 0.003634 + dxz : 0.000498 + dyz : 0.000509 + dx2y2 : 0.000818 + dxy : 0.001626 + f0 : -0.000001 f : 0.000207 + f+1 : 0.000009 + f-1 : 0.000035 + f+2 : 0.000060 + f-2 : 0.000041 + f+3 : 0.000058 + f-3 : 0.000005 + 19 H s : 0.002334 s : 0.002334 + pz : 0.000062 p : 0.000136 + px : 0.000088 + py : -0.000013 + 20 C s : -0.000106 s : -0.000106 + pz : 0.000075 p : 0.000172 + px : 0.000048 + py : 0.000049 + dz2 : -0.000001 d : 0.000006 + dxz : -0.000132 + dyz : -0.000004 + dx2y2 : 0.000110 + dxy : 0.000033 + f0 : 0.000013 f : 0.000018 + f+1 : -0.000001 + f-1 : -0.000000 + f+2 : 0.000006 + f-2 : 0.000001 + f+3 : -0.000001 + f-3 : 0.000000 + 21 H s : -0.000154 s : -0.000154 + pz : -0.000000 p : -0.000008 + px : -0.000004 + py : -0.000003 + 22 H s : -0.000173 s : -0.000173 + pz : -0.000002 p : -0.000048 + px : -0.000046 + py : 0.000000 + 23 H s : -0.000009 s : -0.000009 + pz : 0.000001 p : -0.000003 + px : -0.000001 + py : -0.000003 + 24 C s : 0.000041 s : 0.000041 + pz : 0.000155 p : 0.000164 + px : 0.000007 + py : 0.000002 + dz2 : -0.000010 d : 0.000138 + dxz : 0.000100 + dyz : 0.000053 + dx2y2 : -0.000041 + dxy : 0.000036 + f0 : 0.000000 f : 0.000013 + f+1 : -0.000001 + f-1 : 0.000001 + f+2 : 0.000004 + f-2 : -0.000000 + f+3 : 0.000009 + f-3 : 0.000000 + 25 H s : 0.000050 s : 0.000050 + pz : -0.000001 p : -0.000010 + px : -0.000002 + py : -0.000007 + 26 H s : 0.000018 s : 0.000018 + pz : -0.000000 p : -0.000000 + px : -0.000001 + py : 0.000001 + 27 H s : -0.000186 s : -0.000186 + pz : 0.000019 p : -0.000060 + px : -0.000064 + py : -0.000015 + 28 C s : 0.000183 s : 0.000183 + pz : -0.000087 p : -0.000215 + px : 0.000009 + py : -0.000136 + dz2 : 0.000103 d : 0.000493 + dxz : 0.000079 + dyz : 0.000125 + dx2y2 : 0.000107 + dxy : 0.000079 + f0 : 0.000002 f : 0.000042 + f+1 : 0.000007 + f-1 : 0.000024 + f+2 : -0.000003 + f-2 : 0.000008 + f+3 : 0.000005 + f-3 : -0.000000 + 29 H s : 0.000140 s : 0.000140 + pz : 0.000008 p : 0.000007 + px : -0.000005 + py : 0.000004 + 30 H s : 0.000324 s : 0.000324 + pz : -0.000008 p : 0.000012 + px : 0.000002 + py : 0.000018 + 31 H s : 0.000102 s : 0.000102 + pz : -0.000005 p : -0.000019 + px : -0.000004 + py : -0.000010 + 32 C s : 0.000431 s : 0.000431 + pz : 0.000824 p : 0.002920 + px : 0.001179 + py : 0.000918 + dz2 : 0.000625 d : 0.002847 + dxz : 0.000097 + dyz : 0.000292 + dx2y2 : 0.000268 + dxy : 0.001564 + f0 : 0.000079 f : 0.000222 + f+1 : 0.000021 + f-1 : 0.000002 + f+2 : 0.000026 + f-2 : 0.000070 + f+3 : 0.000012 + f-3 : 0.000013 + 33 H s : -0.000226 s : -0.000226 + pz : 0.000021 p : 0.000013 + px : -0.000007 + py : -0.000001 + 34 C s : -0.000017 s : -0.000017 + pz : 0.000304 p : 0.000153 + px : -0.000002 + py : -0.000149 + dz2 : 0.000037 d : 0.000123 + dxz : -0.000025 + dyz : 0.000049 + dx2y2 : 0.000037 + dxy : 0.000024 + f0 : -0.000000 f : 0.000024 + f+1 : -0.000000 + f-1 : 0.000001 + f+2 : 0.000001 + f-2 : 0.000009 + f+3 : -0.000000 + f-3 : 0.000013 + 35 H s : 0.000030 s : 0.000030 + pz : -0.000000 p : -0.000013 + px : -0.000002 + py : -0.000011 + 36 H s : -0.000013 s : -0.000013 + pz : -0.000001 p : -0.000003 + px : 0.000000 + py : -0.000002 + 37 H s : -0.000191 s : -0.000191 + pz : 0.000016 p : -0.000066 + px : -0.000045 + py : -0.000037 + 38 C s : 0.000339 s : 0.000339 + pz : -0.000009 p : 0.001542 + px : 0.000512 + py : 0.001039 + dz2 : 0.000042 d : 0.000846 + dxz : 0.000178 + dyz : 0.000247 + dx2y2 : -0.000002 + dxy : 0.000381 + f0 : 0.000003 f : 0.000030 + f+1 : 0.000007 + f-1 : 0.000011 + f+2 : 0.000004 + f-2 : 0.000003 + f+3 : -0.000001 + f-3 : 0.000002 + 39 H s : 0.000661 s : 0.000661 + pz : -0.000002 p : 0.000060 + px : 0.000014 + py : 0.000048 + 40 H s : -0.000003 s : -0.000003 + pz : -0.000000 p : 0.000020 + px : 0.000006 + py : 0.000014 + 41 H s : -0.000058 s : -0.000058 + pz : 0.000002 p : 0.000028 + px : 0.000009 + py : 0.000017 + 42 C s : 0.001280 s : 0.001280 + pz : 0.004018 p : 0.005671 + px : 0.001583 + py : 0.000070 + dz2 : 0.000019 d : 0.003048 + dxz : 0.000498 + dyz : 0.001687 + dx2y2 : 0.000012 + dxy : 0.000831 + f0 : 0.000001 f : 0.000156 + f+1 : 0.000008 + f-1 : 0.000111 + f+2 : 0.000001 + f-2 : 0.000021 + f+3 : 0.000011 + f-3 : 0.000002 + 43 H s : 0.002142 s : 0.002142 + pz : 0.000236 p : 0.000301 + px : 0.000068 + py : -0.000003 + 44 C s : -0.000029 s : -0.000029 + pz : 0.000247 p : 0.000052 + px : -0.000103 + py : -0.000092 + dz2 : -0.000003 d : 0.000368 + dxz : -0.000050 + dyz : 0.000346 + dx2y2 : -0.000006 + dxy : 0.000081 + f0 : 0.000010 f : 0.000056 + f+1 : 0.000004 + f-1 : 0.000000 + f+2 : 0.000002 + f-2 : 0.000026 + f+3 : 0.000001 + f-3 : 0.000013 + 45 H s : -0.000049 s : -0.000049 + pz : 0.000001 p : -0.000005 + px : -0.000006 + py : -0.000000 + 46 H s : -0.000181 s : -0.000181 + pz : 0.000021 p : -0.000042 + px : -0.000028 + py : -0.000035 + 47 H s : 0.000013 s : 0.000013 + pz : 0.000001 p : -0.000009 + px : -0.000005 + py : -0.000005 + 48 C s : -0.000047 s : -0.000047 + pz : 0.000280 p : 0.000352 + px : -0.000055 + py : 0.000127 + dz2 : -0.000030 d : 0.000270 + dxz : 0.000108 + dyz : 0.000060 + dx2y2 : 0.000049 + dxy : 0.000083 + f0 : 0.000009 f : 0.000063 + f+1 : 0.000042 + f-1 : 0.000006 + f+2 : 0.000001 + f-2 : 0.000000 + f+3 : 0.000001 + f-3 : 0.000003 + 49 H s : -0.000186 s : -0.000186 + pz : 0.000001 p : 0.000002 + px : 0.000000 + py : 0.000000 + 50 H s : 0.000013 s : 0.000013 + pz : -0.000001 p : -0.000004 + px : 0.000004 + py : -0.000007 + 51 H s : -0.000198 s : -0.000198 + pz : 0.000019 p : -0.000036 + px : -0.000006 + py : -0.000049 + + + ***************************** + * MAYER POPULATION ANALYSIS * + ***************************** + + NA - Mulliken gross atomic population + ZA - Total nuclear charge + QA - Mulliken gross atomic charge + VA - Mayer's total valence + BVA - Mayer's bonded valence + FA - Mayer's free valence + + ATOM NA ZA QA VA BVA FA + 0 Fe 25.7164 26.0000 0.2836 6.3337 3.2873 3.0464 + 1 Br 35.4692 35.0000 -0.4692 0.9745 0.9628 0.0117 + 2 Br 35.4705 35.0000 -0.4705 0.9698 0.9570 0.0128 + 3 P 14.7029 15.0000 0.2971 3.9513 3.9478 0.0036 + 4 P 14.6808 15.0000 0.3192 3.8971 3.8933 0.0038 + 5 N 7.1533 7.0000 -0.1533 3.0708 3.0708 0.0000 + 6 N 7.3368 7.0000 -0.3368 3.0249 3.0249 0.0000 + 7 H 0.7813 1.0000 0.2187 0.9541 0.9541 0.0000 + 8 C 6.0443 6.0000 -0.0443 3.8286 3.8285 0.0001 + 9 H 0.8920 1.0000 0.1080 0.9710 0.9710 0.0000 + 10 C 6.3900 6.0000 -0.3900 3.9517 3.9517 0.0000 + 11 H 0.8788 1.0000 0.1212 0.9742 0.9742 0.0000 + 12 H 0.9131 1.0000 0.0869 0.9746 0.9746 0.0000 + 13 H 0.8318 1.0000 0.1682 0.9995 0.9995 0.0000 + 14 C 6.3794 6.0000 -0.3794 3.9095 3.9095 0.0000 + 15 H 0.8759 1.0000 0.1241 0.9720 0.9720 0.0000 + 16 H 0.8652 1.0000 0.1348 0.9677 0.9677 0.0000 + 17 H 0.8817 1.0000 0.1183 0.9735 0.9735 0.0000 + 18 C 6.1320 6.0000 -0.1320 3.9221 3.9221 0.0000 + 19 H 0.9079 1.0000 0.0921 0.9577 0.9577 0.0000 + 20 C 6.3357 6.0000 -0.3357 3.9101 3.9101 -0.0000 + 21 H 0.8836 1.0000 0.1164 0.9704 0.9704 0.0000 + 22 H 0.8519 1.0000 0.1481 1.0016 1.0016 0.0000 + 23 H 0.8802 1.0000 0.1198 0.9740 0.9740 0.0000 + 24 C 6.3750 6.0000 -0.3750 3.9347 3.9347 0.0000 + 25 H 0.8834 1.0000 0.1166 0.9722 0.9722 0.0000 + 26 H 0.8752 1.0000 0.1248 0.9687 0.9687 0.0000 + 27 H 0.8341 1.0000 0.1659 0.9898 0.9898 0.0000 + 28 C 6.2857 6.0000 -0.2857 3.9182 3.9182 0.0000 + 29 H 0.8658 1.0000 0.1342 0.9770 0.9770 0.0000 + 30 H 0.8883 1.0000 0.1117 0.9672 0.9672 0.0000 + 31 H 0.8539 1.0000 0.1461 0.9630 0.9630 0.0000 + 32 C 6.1178 6.0000 -0.1178 3.9456 3.9455 0.0000 + 33 H 0.9035 1.0000 0.0965 0.9691 0.9691 0.0000 + 34 C 6.3604 6.0000 -0.3604 3.9414 3.9414 0.0000 + 35 H 0.8849 1.0000 0.1151 0.9711 0.9711 0.0000 + 36 H 0.8972 1.0000 0.1028 0.9856 0.9856 0.0000 + 37 H 0.8259 1.0000 0.1741 0.9886 0.9886 0.0000 + 38 C 6.3524 6.0000 -0.3524 3.8827 3.8827 0.0000 + 39 H 0.8735 1.0000 0.1265 0.9707 0.9707 0.0000 + 40 H 0.8683 1.0000 0.1317 0.9777 0.9777 0.0000 + 41 H 0.8759 1.0000 0.1241 0.9744 0.9744 0.0000 + 42 C 6.0224 6.0000 -0.0224 3.8714 3.8713 0.0001 + 43 H 0.9179 1.0000 0.0821 0.9685 0.9685 0.0000 + 44 C 6.3753 6.0000 -0.3753 3.9176 3.9176 0.0000 + 45 H 0.8851 1.0000 0.1149 0.9746 0.9746 0.0000 + 46 H 0.8384 1.0000 0.1616 0.9917 0.9917 0.0000 + 47 H 0.8926 1.0000 0.1074 0.9820 0.9820 0.0000 + 48 C 6.3726 6.0000 -0.3726 3.9676 3.9676 0.0000 + 49 H 0.8829 1.0000 0.1171 0.9694 0.9694 0.0000 + 50 H 0.8834 1.0000 0.1166 0.9745 0.9745 0.0000 + 51 H 0.8534 1.0000 0.1466 0.9954 0.9954 0.0000 + + Mayer bond orders larger than 0.100000 +B( 0-Fe, 1-Br) : 0.8843 B( 0-Fe, 2-Br) : 0.8938 B( 0-Fe, 3-P ) : 0.6636 +B( 0-Fe, 4-P ) : 0.6609 B( 3-P , 5-N ) : 1.1011 B( 3-P , 8-C ) : 0.9275 +B( 3-P , 18-C ) : 0.9517 B( 4-P , 6-N ) : 1.0542 B( 4-P , 32-C ) : 0.9424 +B( 4-P , 42-C ) : 0.9358 B( 5-N , 6-N ) : 0.9151 B( 5-N , 28-C ) : 0.9497 +B( 6-N , 7-H ) : 0.8939 B( 8-C , 9-H ) : 0.9136 B( 8-C , 10-C ) : 0.9831 +B( 8-C , 14-C ) : 0.9528 B( 10-C , 11-H ) : 0.9530 B( 10-C , 12-H ) : 0.9701 +B( 10-C , 13-H ) : 0.9440 B( 14-C , 15-H ) : 0.9574 B( 14-C , 16-H ) : 0.9673 +B( 14-C , 17-H ) : 0.9630 B( 18-C , 19-H ) : 0.9186 B( 18-C , 20-C ) : 0.9785 +B( 18-C , 24-C ) : 0.9752 B( 20-C , 21-H ) : 0.9512 B( 20-C , 22-H ) : 0.9521 +B( 20-C , 23-H ) : 0.9635 B( 24-C , 25-H ) : 0.9554 B( 24-C , 26-H ) : 0.9632 +B( 24-C , 27-H ) : 0.9528 B( 28-C , 29-H ) : 0.9594 B( 28-C , 30-H ) : 0.9567 +B( 28-C , 31-H ) : 0.9545 B( 32-C , 33-H ) : 0.9120 B( 32-C , 34-C ) : 1.0168 +B( 32-C , 38-C ) : 0.9602 B( 34-C , 35-H ) : 0.9543 B( 34-C , 36-H ) : 0.9607 +B( 34-C , 37-H ) : 0.9520 B( 38-C , 39-H ) : 0.9573 B( 38-C , 40-H ) : 0.9632 +B( 38-C , 41-H ) : 0.9628 B( 42-C , 43-H ) : 0.9165 B( 42-C , 44-C ) : 0.9760 +B( 42-C , 48-C ) : 0.9835 B( 44-C , 45-H ) : 0.9530 B( 44-C , 46-H ) : 0.9458 +B( 44-C , 47-H ) : 0.9675 B( 48-C , 49-H ) : 0.9478 B( 48-C , 50-H ) : 0.9664 +B( 48-C , 51-H ) : 0.9502 + + +------------------ +HIRSHFELD ANALYSIS +------------------ + +Total integrated alpha density = 127.000133384 +Total integrated beta density = 123.000132948 + + ATOM CHARGE SPIN + 0 Fe 0.075936 3.439948 + 1 Br -0.286666 0.192979 + 2 Br -0.294198 0.201236 + 3 P 0.205532 0.055551 + 4 P 0.217499 0.055607 + 5 N -0.093105 0.002519 + 6 N -0.140547 -0.000908 + 7 H 0.101159 -0.000102 + 8 C -0.036330 0.007057 + 9 H 0.041217 0.000060 + 10 C -0.066544 0.000585 + 11 H 0.031018 -0.000147 + 12 H 0.015626 0.000032 + 13 H 0.020505 0.001836 + 14 C -0.066166 0.003060 + 15 H 0.029374 0.001300 + 16 H 0.025314 0.000194 + 17 H 0.022225 0.000137 + 18 C -0.032483 0.004826 + 19 H 0.023574 0.003096 + 20 C -0.064966 0.000464 + 21 H 0.027412 -0.000141 + 22 H 0.025453 0.001189 + 23 H 0.021285 0.000053 + 24 C -0.060026 0.000472 + 25 H 0.030315 0.000043 + 26 H 0.026419 0.000022 + 27 H 0.033511 0.000341 + 28 C -0.009178 0.000518 + 29 H 0.032318 0.000153 + 30 H 0.022926 0.000389 + 31 H 0.037654 0.000266 + 32 C -0.026965 0.005739 + 33 H 0.035469 0.000055 + 34 C -0.060999 0.000449 + 35 H 0.030328 0.000010 + 36 H 0.025538 0.000017 + 37 H 0.031436 0.000533 + 38 C -0.064324 0.002768 + 39 H 0.030095 0.001081 + 40 H 0.024039 0.000144 + 41 H 0.028910 0.000130 + 42 C -0.035044 0.009832 + 43 H 0.028134 0.003303 + 44 C -0.062068 0.000549 + 45 H 0.030128 0.000006 + 46 H 0.033328 0.000460 + 47 H 0.023646 0.000056 + 48 C -0.064245 0.000853 + 49 H 0.028362 -0.000112 + 50 H 0.021353 0.000087 + 51 H 0.026549 0.001409 + + TOTAL -0.000266 4.000000 + +------- +TIMINGS +------- + +Total SCF time: 0 days 0 hours 1 min 39 sec + +Total time .... 99.587 sec +Sum of individual times .... 94.625 sec ( 95.0%) + +Fock matrix formation .... 67.030 sec ( 67.3%) + Split-RI-J .... 8.466 sec ( 12.6% of F) + Chain of spheres X .... 38.140 sec ( 56.9% of F) + XC integration .... 15.433 sec ( 23.0% of F) + Basis function eval. .... 0.558 sec ( 3.6% of XC) + Density eval. .... 4.875 sec ( 31.6% of XC) + XC-Functional eval. .... 0.144 sec ( 0.9% of XC) + XC-Potential eval. .... 2.759 sec ( 17.9% of XC) +Diagonalization .... 13.698 sec ( 13.8%) +Density matrix formation .... 0.621 sec ( 0.6%) +Population analysis .... 3.729 sec ( 3.7%) +Initial guess .... 0.607 sec ( 0.6%) +Orbital Transformation .... 0.000 sec ( 0.0%) +Orbital Orthonormalization .... 0.000 sec ( 0.0%) +DIIS solution .... 6.287 sec ( 6.3%) +Grid generation .... 2.653 sec ( 2.7%) + +Maximum memory used throughout the entire SCF-calculation: 240.8 MB + + +------------------------------------------------------------------------------- + DFT DISPERSION CORRECTION + + DFTD3 V3.1 Rev 1 + USING Becke-Johnson damping +------------------------------------------------------------------------------- +The TPSSH functional is recognized +Active option DFTDOPT ... 4 + +molecular C6(AA) [au] = 33739.620482 + + + DFT-D V3 + parameters + s6 scaling factor : 1.0000 + a1 scaling factor : 0.4529 + s8 scaling factor : 2.2382 + a2 scaling factor : 4.6550 + ad hoc parameters k1-k3 : 16.0000 1.3333 -4.0000 + + Edisp/kcal,au: -65.900079573664 -0.105018450347 + E6 /kcal : -29.845586504 + E8 /kcal : -36.054493070 + % E8 : 54.710849066 + +------------------------- ---------------- +Dispersion correction -0.105018450 +------------------------- ---------------- + + +------------------------- -------------------- +FINAL SINGLE POINT ENERGY -7719.347579614914 +------------------------- -------------------- + + + *************************************** + * ORCA property calculations * + *************************************** + + --------------------- + Active property flags + --------------------- + (+) Dipole Moment + + +------------------------------------------------------------------------------ + ORCA ELECTRIC PROPERTIES CALCULATION +------------------------------------------------------------------------------ + +Dipole Moment Calculation ... on +Quadrupole Moment Calculation ... off +Polarizability Calculation ... off +GBWName ... AJALIH_5_SPE.gbw +Electron density ... AJALIH_5_SPE.scfp +The origin for moment calculation is the CENTER OF MASS = ( 0.041640, -0.319388 0.086827) + +------------- +DIPOLE MOMENT +------------- + X Y Z +Electronic contribution: 9.86073 -76.33054 21.17886 +Nuclear contribution : -10.41005 79.84711 -21.70664 + ----------------------------------------- +Total Dipole Moment : -0.54932 3.51657 -0.52778 + ----------------------------------------- +Magnitude (a.u.) : 3.59813 +Magnitude (Debye) : 9.14573 + + + +-------------------- +Rotational spectrum +-------------------- + +Rotational constants in cm-1: 0.005923 0.005526 0.005116 +Rotational constants in MHz : 177.569312 165.677971 153.366179 + + Dipole components along the rotational axes: +x,y,z [a.u.] : 0.857349 3.482402 -0.290496 +x,y,z [Debye]: 2.179208 8.851563 -0.738382 + + + +Timings for individual modules: + +Sum of individual times ... 3064.505 sec (= 51.075 min) +GTO integral calculation ... 1539.515 sec (= 25.659 min) 50.2 % +SCF iterations ... 1524.990 sec (= 25.417 min) 49.8 % + ****ORCA TERMINATED NORMALLY**** +TOTAL RUN TIME: 0 days 1 hours 16 minutes 32 seconds 830 msec diff --git a/python/README.md b/python/README.md index e95f2fb..f3ad17b 100644 --- a/python/README.md +++ b/python/README.md @@ -10,6 +10,7 @@ Inspired by @aligfellow's [xyzrender](https://github.com/aligfellow/xyzrender). * X11 * numpy +* cclib (optional, to read formats without native support) ### For installation: * `libX11-devel libXpm-devel xproto-devel` (`libx11-dev libxpm-dev x11proto-dev` on Ubuntu) for C compilation @@ -115,7 +116,13 @@ vmol.run(['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10']) ``` The arguments are the same as the CLI ones and should be an array of strings. -### 2. Capture the output +### 2. Other formats +With `cclib` installed, it is also possible to load the formats which are not supported natively: +``` +vmol2 ../mol/CEHZOF_1_SPE.out +``` + +### 3. Capture the output See [example 1](examples/ex1.py). ```python @@ -145,7 +152,7 @@ Tell the viewer to automatically print the coordinates before exit: >>> print(out) ``` -### 3. Pass a structure +### 4. Pass a structure One can pass a structure (or several structures) as an argument. See [example 2](examples/ex2.py). diff --git a/python/vmol/vmol2.py b/python/vmol/vmol2.py new file mode 100755 index 0000000..a539f8e --- /dev/null +++ b/python/vmol/vmol2.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +"""Run the vmol viewer with molecular data parsed by cclib.""" + +import sys +import os +import warnings +from vmol import vmol, _paths + +try: + import cclib +except ModuleNotFoundError: + msg = "cclib not found. Install cclib to use this script." + raise ModuleNotFoundError(msg) from None + + +def read_mols_from_cclib(path): + """Read molecular data from a file using cclib. + + Arguments: + path (str): Path to the file to read. + + Returns: + list[dict]: Dictionaries containing atomic numbers ('q'), coordinates ('r'), + and a name for each molecule, i.e. suitable argument for vmol.run(). + + Raises: + FileNotFoundError: If the specified file is not found. + RuntimeError: If cclib cannot parse the file or if no coordinates are found in the parsed data. + """ + if not os.path.isfile(path): + msg = f"File {path} not found." + raise FileNotFoundError(msg) + + parser = cclib.io.ccopen(path) + if parser is None: + msg = f"Could not open {path} with cclib." + raise RuntimeError(msg) + + try: + data = parser.parse() + except Exception: + msg = f"Error parsing {path} with cclib. Using partial data." + warnings.warn(msg, RuntimeWarning, stacklevel=2) + data = parser + + if not (hasattr(data, "atomcoords") and hasattr(data, "atomnos") and len(data.atomcoords)): + msg = f"No coordinates found in {path}." + raise RuntimeError(msg) + + return [{'q': data.atomnos, 'r': r, 'name': str(parser)} for r in data.atomcoords] + + +def main(): + """Run the viewer with files parsed by cclib. + + Usage: + vmol2.py file [options] + + Returns: + int: Exit code (0 for success). + + Raises: + ImportError: If vmol shared library is not found. + """ + if vmol is None: + paths = '\n'.join(_paths) + msg = f"vmol shared library not found in paths. Check your installation.\nSearched paths:\n{paths}" + raise ImportError(msg) + + if len(sys.argv)==1: + vmol.run(args=sys.argv, with_arg0=True) + return 0 + + to_pop = [] + mols = [] + for i, arg in enumerate(sys.argv[1:], start=1): + if ':' in arg: + continue + to_pop.append(i) + try: + mols.extend(read_mols_from_cclib(arg)) + except (FileNotFoundError, RuntimeError) as e: + warnings.warn(str(e), RuntimeWarning, stacklevel=2) + if not mols: + pass + msg = f"No valid molecular data found in any provided files." + raise RuntimeError(msg) + + for i in reversed(to_pop): + sys.argv.pop(i) + return vmol.run(mols=mols, args=sys.argv, with_arg0=True) + + +if __name__ == "__main__": + main() diff --git a/src/v/headless.c b/src/v/headless.c index 104498b..0673d4d 100644 --- a/src/v/headless.c +++ b/src/v/headless.c @@ -48,11 +48,11 @@ void run_commands(FILE * f, char * command, drawpars * dp, void * ent){ } int headless(drawpars * dp, void * ent){ - atcoord * ac = ((atcoords *)ent)->m[dp->n]; - if(dp->b>0 && !ac->bond_flag){ - bonds_fill(dp->rl, dp->bmax, ac); - } - run_commands(stdin, dp->com, dp, ent); - ent_free(ent, dp); - return 0; + atcoord * ac = ((atcoords *)ent)->m[dp->n]; + if(dp->b>0 && !ac->bond_flag){ + bonds_fill(dp->rl, dp->bmax, ac); + } + run_commands(stdin, dp->com, dp, ent); + ent_free(ent, dp); + return 0; } From 6a2e5033724c6fbefbb8ee69830ce5a29c337f61 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sat, 7 Mar 2026 17:51:34 +0100 Subject: [PATCH 37/48] Fix memory bug --- python/vmol/main.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/python/vmol/main.py b/python/vmol/main.py index de2a694..d971bd9 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -80,14 +80,14 @@ def mol2struct(get_element, mol): msg = f"q must be a 1D array, but has shape {q_tmp.shape}" raise ValueError(msg) - r = np.ascontiguousarray(r, dtype=c_double) + r = np.require(r, dtype=c_double, requirements=['C_CONTIGUOUS', 'OWNDATA']) if r.shape != (n, 3): msg = f"r must be a 2D array with shape ({n}, 3), but has shape {r.shape}" raise ValueError(msg) r = r.flatten() try: - q = np.ascontiguousarray(q, dtype=c_int) + q = np.require(q, dtype=c_int, requirements=['C_CONTIGUOUS', 'OWNDATA']) except ValueError: q = q.copy() for i, qi in enumerate(q): @@ -95,15 +95,15 @@ def mol2struct(get_element, mol): q[i] = get_element(qi.encode('utf-8')) elif isinstance(qi, bytes): q[i] = get_element(qi) - q = np.ascontiguousarray(q, dtype=c_int) + q = np.require(q, dtype=c_int, requirements=['C_CONTIGUOUS', 'OWNDATA']) if not isinstance(name, bytes): name = str(name).encode('utf-8') - in_str = inp_mols_t(n=c_int(n), - q=q.ctypes.data_as(c_int_p), - r=r.ctypes.data_as(c_double_p), - name=name) + n = c_int(n) + q = q.ctypes.data_as(c_int_p) + r = r.ctypes.data_as(c_double_p) + in_str = inp_mols_t(n=n, q=q, r=r, name=name) in_str._keepalive = (n, q, r, name) # keep strong references return in_str @@ -301,7 +301,8 @@ def run(self, *, args=None, mols=None, with_arg0=False): if not isinstance(mols, list): mols = [mols] nmol = len(mols) - mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) + mols_keepalive = [mol2struct(self.f.get_element, mol) for mol in mols] + mols = (inp_mols_t * nmol)(*mols_keepalive) ret = self.f.main_in(args, nmol, mols) else: ret = self.f.main(args) @@ -337,7 +338,8 @@ def capture(self, *, mols=None, args=None, return_code=False): if not isinstance(mols, list): mols = [mols] nmol = len(mols) - mols = (inp_mols_t * nmol)(*(mol2struct(self.f.get_element, mol) for mol in mols)) + mols_keepalive = [mol2struct(self.f.get_element, mol) for mol in mols] + mols = (inp_mols_t * nmol)(*mols_keepalive) ret, out = self.f.main_in_out(args, nmol, mols) else: ret, out = self.f.main_out(args) From 1a3b95fffa2526dc275bfd65e3da3d986e9c8cd7 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 09:21:48 +0100 Subject: [PATCH 38/48] env var --- python/README.md | 1 + python/vmol/__init__.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/python/README.md b/python/README.md index f3ad17b..9c62d2a 100644 --- a/python/README.md +++ b/python/README.md @@ -78,6 +78,7 @@ To subsitute the `.so`, put in in the same directory or change manually: ``` >>> vmol.so='./v.so' ``` +or set the `VMOL_SO_PATH` environment variable. ## Usage diff --git a/python/vmol/__init__.py b/python/vmol/__init__.py index 0cb2288..10ab8f6 100644 --- a/python/vmol/__init__.py +++ b/python/vmol/__init__.py @@ -4,7 +4,13 @@ _v = 'v' _suffix = get_config_var('EXT_SUFFIX') -_paths = [ + +if os.environ.get('VMOL_SO_PATH', None): + _paths = [os.environ['VMOL_SO_PATH']] +else: + _paths = [] + +_paths.extend([ f'./{_v}.so', f'./{_v}{_suffix}', f'{__path__[0]}/{_v}.so', @@ -13,14 +19,10 @@ f"{get_path('platlib')}/{__package__}/{_v}{_suffix}", f"{get_path('purelib')}/{_v}{_suffix}", f"{get_path('platlib')}/{_v}{_suffix}", - ] + ]) _exists = [os.path.isfile(p) for p in _paths] _so = _paths[_exists.index(True)] if sum(_exists) else None vmol = Vmol(so=_so) - -del main -del _v, _suffix -del get_config_var, get_path, os From 1b1017ec9156d838ba46199f8da6046bfc2fa9ec Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 09:23:05 +0100 Subject: [PATCH 39/48] fixup 6dec364 --- python/vmol/vmol2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/vmol/vmol2.py b/python/vmol/vmol2.py index a539f8e..e650684 100755 --- a/python/vmol/vmol2.py +++ b/python/vmol/vmol2.py @@ -61,6 +61,7 @@ def main(): Raises: ImportError: If vmol shared library is not found. + RuntimeError: If no valid molecular data is found in any provided files. """ if vmol is None: paths = '\n'.join(_paths) @@ -82,8 +83,7 @@ def main(): except (FileNotFoundError, RuntimeError) as e: warnings.warn(str(e), RuntimeWarning, stacklevel=2) if not mols: - pass - msg = f"No valid molecular data found in any provided files." + msg = "No valid molecular data found in any provided files." raise RuntimeError(msg) for i in reversed(to_pop): From 191b81611f7ddcbdd132a6278ad647d8811799c8 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 10:12:52 +0100 Subject: [PATCH 40/48] Ruff --- python/ruff.toml | 33 ++++++++++++++++++++------------- python/vmol/main.py | 4 ++-- python/vmol/vmol2.py | 2 +- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/python/ruff.toml b/python/ruff.toml index 5ab7539..0abd357 100644 --- a/python/ruff.toml +++ b/python/ruff.toml @@ -13,34 +13,41 @@ line-ending = "auto" [lint] +preview = true + select = [ "A", "E", "F", "B", "S", "COM", "C4", "EXE", "ICN", "PIE", "PLR1714", "ARG", "PERF", "FURB", "PLE", "TRY", "W", "UP", "RUF", "SIM", "NPY", - "EM", "RET", "PLR", + "EM", "RET", "PLR", "BLE", "Q", "PLC", "FIX", "TD", - "D" -] -ignore = [ - "E501", # line-too-long - "D203", # incorrect-blank-line-before-class - "D213", # multi-line-summary-second-line - #"ANN", "Q000", "SLF001", "PLC0415", "N801", "I001", "CPY001" + "N", "D", "DOC", ] -preview = true - -extend-select = ["DOC"] - -extend-ignore = [ +ignore = [ "E201", # whitespace-after-open-bracket "E221", # multiple-spaces-before-operator "E222", # multiple-spaces-after-operator "E225", # missing-whitespace-around-operator "E241", # multiple-spaces-after-comma + "E501", # line-too-long + "D203", # incorrect-blank-line-before-class + "D213", # multi-line-summary-second-line "D413", # missing-blank-line-after-last-section + "Q000", # bad-quotes-inline-string ] +## uncomment to check if we break more interesting rules +#extend-select = ["ALL"] +#extend-ignore = [ +# "ANN", # flake8-annotations +# "SLF", # flake8-self +# "I", # isort +# "CPY", # flake8-copyright +# "PTH", # flake8-use-pathlib +# "C", # mccabe +#] + [lint.per-file-ignores] "vmol/__main__.py" = ["D"] "examples/ex*.py" = ["D"] diff --git a/python/vmol/main.py b/python/vmol/main.py index d971bd9..842f5c8 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -14,7 +14,7 @@ c_int_p = ctypes.POINTER(c_int) -class inp_mols_t(ctypes.Structure): +class inp_mols_t(ctypes.Structure): # noqa: N801 """C structure for the input molecule data, containing the number of atoms, charge array, coordinate array, and name.""" _fields_ = ( @@ -55,7 +55,7 @@ def mol2struct(get_element, mol): TypeError: If mol is not a dictionary. ValueError: If the required keys are missing or their values have wrong shapes. """ - import numpy as np + import numpy as np # noqa: PLC0415 if isinstance(mol, dict): q = mol.get('q') diff --git a/python/vmol/vmol2.py b/python/vmol/vmol2.py index e650684..5023935 100755 --- a/python/vmol/vmol2.py +++ b/python/vmol/vmol2.py @@ -38,7 +38,7 @@ def read_mols_from_cclib(path): try: data = parser.parse() - except Exception: + except Exception: # noqa: BLE001 msg = f"Error parsing {path} with cclib. Using partial data." warnings.warn(msg, RuntimeWarning, stacklevel=2) data = parser From 391e4453efe98ce54365fdfc49d99316cd80cc58 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 11:17:00 +0100 Subject: [PATCH 41/48] Simplify wrappers --- python/vmol/main.py | 208 ++++++++++++++++++++++++-------------------- src/api.c | 4 +- 2 files changed, 118 insertions(+), 94 deletions(-) diff --git a/python/vmol/main.py b/python/vmol/main.py index 842f5c8..821f930 100644 --- a/python/vmol/main.py +++ b/python/vmol/main.py @@ -108,68 +108,24 @@ def mol2struct(get_element, mol): return in_str -def convert_in(func): - """Decorate a function to convert Python arguments to the expected C types. - - The function is expected to take an integer and a pointer to an array of C strings as its first two arguments, - which represent the argument count and argument values, respectively, i.e., - ``` - void func(int argc, char ** argv, ...) - ``` - The decorator will convert a list of Python strings passed as the first argument - to the wrapped function into the appropriate C types before calling the original function, i.e., - ``` - def wrapped_func(argv: list[str], ...) - ``` - - If `func.ret_code_ptr_idx` is defined and equals to N>=2, the decorator also passes a pointer to an integer - as the Nth argument: - ``` - void func(int argc, char ** argv, ..., int * ret, ...) -> def wrapped_func(argv: list[str], ..., ...) - ^0th ^Nth - ``` - The `func.errcheck` function is supposed to take care of the return value. +def make_array(x, element_type, convert_func=lambda x: x): + """Convert a list of Python objects to a C array of the specified element type. Args: - func (callable): The function to wrap. + x (object or list[object]): An object or a list thereof to convert to a C array. + element_type (ctypes type): The type of the elements in the C array. + convert_func (callable, optional): A function that takes a Python object and converts it to the appropriate C type. + Defaults to the identity function. Returns: - callable: A wrapped function. - - Raises: - TypeError: If func is not a ctypes function. - ValueError: If its attributes are wrong. + tuple: A tuple containing the number of elements, the C array, and a list of the converted elements to keep alive. """ - if func is None: - return None - if not isinstance(func, ctypes._CFuncPtr): - msg = "function should be a ctypes function" - raise TypeError(msg) - - if func.argtypes is None or len(func.argtypes) < len(ARGS_T) or any(x!=y for x, y in zip(func.argtypes, ARGS_T, strict=False)): - msg = f"function must have a signature that starts with {ARGS_T} for the first arguments to convert the input list of strings" - raise ValueError(msg) - - if not hasattr(func, 'ret_code_ptr_idx'): - func.ret_code_ptr_idx = None - if func.ret_code_ptr_idx is not None: - if func.ret_code_ptr_idx < len(ARGS_T): - msg = f"return code argument index must be at least 2, but got {func.ret_code_ptr_idx}" - raise ValueError(msg) - if func.argtypes[func.ret_code_ptr_idx] != c_int_p: - msg = f"return code argument must be a pointer to an integer ({c_int_p}), but got {func.argtypes[func.ret_code_ptr_idx]}" - raise ValueError(msg) - - @functools.wraps(func) - def myinner(argv, *args): - argc = len(argv) - argv = (c_char_p * argc)(*[arg.encode('utf-8') for arg in argv]) - arguments = [c_int(argc), argv, *args] - if func.ret_code_ptr_idx is not None: - ret = c_int(0) - arguments.insert(func.ret_code_ptr_idx, ctypes.byref(ret)) - return func(*arguments) - return myinner + if not isinstance(x, list): + x = [x] + n = len(x) + x_keepalive = [convert_func(i) for i in x] + x = (element_type * n)(*x_keepalive) + return c_int(n), x, x_keepalive class Hooked: @@ -226,7 +182,7 @@ def _call_hook(self): def _reset_functions(self): self.f.__dict__.clear() - def _declare(self, name, *, argtypes, restype, errcheck=None, ret_code_ptr_idx=None): + def _declare(self, name, *, argtypes, restype, errcheck=None): """Declare a function from the shared library with the given argument and return types. Args: @@ -235,7 +191,6 @@ def _declare(self, name, *, argtypes, restype, errcheck=None, ret_code_ptr_idx=N restype (ctypes type): The return type of the function. errcheck (callable, optional): A function that takes the result, the function, and the arguments, and returns the processed result. - ret_code_ptr_idx (int, optional): Position of the `int *` argument to store the return value in. Returns: callable: The function with the specified arguments and return types. @@ -250,14 +205,12 @@ def _declare(self, name, *, argtypes, restype, errcheck=None, ret_code_ptr_idx=N func.restype = restype if errcheck: func.errcheck = errcheck - if ret_code_ptr_idx is not None: - func.ret_code_ptr_idx = ret_code_ptr_idx return func def _declare_functions(self): - def errcheck(result, func, args): - ret = args[func.ret_code_ptr_idx]._obj.value + def errcheck(result, _func, args): + ret = args[-1]._obj.value out = result.decode('utf-8').rstrip('\n') if result else None self.f.free() return ret, out @@ -267,15 +220,98 @@ def errcheck(result, func, args): self.f.main_raw = self._declare('main', argtypes=ARGS_T, restype=c_int) self.f.main_out_raw = self._declare('main_wrap_out', argtypes=[*ARGS_T, c_int_p], - restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) - self.f.main_in_out_raw = self._declare('main_wrap_in_out', argtypes=[*ARGS_T, c_int_p, *INP_MOLS_T], - restype=c_char_p, errcheck=errcheck, ret_code_ptr_idx=2) + restype=c_char_p, errcheck=errcheck) + self.f.main_in_out_raw = self._declare('main_wrap_in_out', argtypes=[*ARGS_T, *INP_MOLS_T, c_int_p], + restype=c_char_p, errcheck=errcheck) self.f.main_in_raw = self._declare('main_wrap_in', argtypes=[*ARGS_T, *INP_MOLS_T], restype=c_int) - self.f.main = convert_in(self.f.main_raw) - self.f.main_out = convert_in(self.f.main_out_raw) - self.f.main_in_out = convert_in(self.f.main_in_out_raw) - self.f.main_in = convert_in(self.f.main_in_raw) + self.f.main = self._convert_in(self.f.main_raw) + self.f.main_out = self._convert_in(self.f.main_out_raw, last_arg_ret_code=True) + self.f.main_in_out = self._convert_in(self.f.main_in_out_raw, add_molecules=True, last_arg_ret_code=True) + self.f.main_in = self._convert_in(self.f.main_in_raw, add_molecules=True) + + def _convert_in(self, func, add_molecules=False, last_arg_ret_code=False): + """Decorate a function to convert Python arguments to the expected C types. + + The function is expected to take an integer and a pointer to an array of C strings as its first two arguments, + which represent the argument count and argument values, respectively, i.e., + ``` + void func(int argc, char ** argv, ...) + ``` + The decorator will convert a list of Python strings passed as the first argument + to the wrapped function into the appropriate C types before calling the original function, i.e., + ``` + def wrapped_func(argv: list[str], ...) + ``` + + If `add_molecules` is True, the function is also expected to take an integer + and a pointer to an array of `inp_mols_t` structures as additional arguments after the first two, + which represent the number of molecules and the molecule data, respectively, i.e., + ``` + void func(int argc, char ** argv, int nmol, inp_mols_t * mols, ...) -> def wrapped_func(argv: list[str], mols: object or list[object], ...) + ``` + The decorator will convert a molecule or a list of molecules passed as the last argument to the wrapped function. + + If `last_arg_ret_code` is True, the decorator also passes a pointer to an integer + as the last argument to the original function to store the return code, i.e., + ``` + void func(int argc, char ** argv, ..., int * ret) -> def wrapped_func(argv: list[str], ...) + ``` + The `func.errcheck` function is supposed to take care of the return value. + + Args: + func (callable): The function to wrap. + add_molecules (bool, optional): Whether the function also takes molecule data as additional arguments after the first two. + last_arg_ret_code (bool, optional): If the last argument is `int *` to store the return value in. + + Returns: + callable: A wrapped function. + + Raises: + TypeError: If func is not a ctypes function. + ValueError: If its attributes are wrong. + """ + def begin_differently(x, y): + if x is None: + return y is not None + if len(x) < len(y): + return True + return any(xi!=yi for xi, yi in zip(x[:len(y)], y, strict=True)) + + if func is None: + return None + if not isinstance(func, ctypes._CFuncPtr): + msg = "function should be a ctypes function" + raise TypeError(msg) + + if begin_differently(func.argtypes, ARGS_T): + msg = f"function must have a signature that starts with {ARGS_T} to convert the input list of strings" + raise ValueError(msg) + + if add_molecules and begin_differently(func.argtypes[len(ARGS_T):], INP_MOLS_T): + msg = f"function must have a signature that starts with {ARGS_T + INP_MOLS_T} to convert the input list of strings and molecule data" + raise ValueError(msg) + + if last_arg_ret_code and func.argtypes[-1] != c_int_p: + msg = f"return code argument must be a pointer to an integer ({c_int_p}), but got {func.argtypes[-1]}" + raise ValueError(msg) + + @functools.wraps(func) + def myinner(*args): + args = list(args) + argv = args[0] + argc, argv, _argv = make_array(args[0], c_char_p, convert_func=lambda x: x.encode('utf-8')) + args.pop(0) + if add_molecules: + nmol, mols, _mols = make_array(args[0], inp_mols_t, convert_func=lambda x: mol2struct(self.f.get_element, x)) + args.pop(0) + args = [nmol, mols, *args] + args = [argc, argv, *args] + if last_arg_ret_code: + ret = c_int(0) + args.append(ctypes.byref(ret)) + return func(*args) + return myinner class Vmol(VmolFunctions): @@ -284,6 +320,13 @@ class Vmol(VmolFunctions): def run(self, *, args=None, mols=None, with_arg0=False): """Run the viewer with the given command-line arguments. + If `args` is provided, it will be passed as command-line arguments to the main function. + It can contain any arguments that the main function accepts, including the paths to the molecule files to read. + If `with_arg0` is True, the first argument in `args` is treated as the program name. + + If `mols` is provided, the molecules(s) will be converted to the appropriate input structure(s) + and passed to the main function, and the paths to the molecule files in `args` will be ignored. + Args: args (list of str, optional): The command-line arguments to pass to the main function. mols (object or list[object], optional): An object or a list thereof representing the molecule(s). @@ -297,28 +340,17 @@ def run(self, *, args=None, mols=None, with_arg0=False): """ self._check_so() args = (args if with_arg0 else [self.so, *args]) if args else [self.so] - if mols: - if not isinstance(mols, list): - mols = [mols] - nmol = len(mols) - mols_keepalive = [mol2struct(self.f.get_element, mol) for mol in mols] - mols = (inp_mols_t * nmol)(*mols_keepalive) - ret = self.f.main_in(args, nmol, mols) - else: - ret = self.f.main(args) - return ret + return self.f.main_in(args, mols) if mols else self.f.main(args) def capture(self, *, mols=None, args=None, return_code=False): """Run the viewer with the given structure and/or command-line arguments and capture the output. If `args` is provided, it will be passed as command-line arguments to the main function. It can contain any arguments that the main function accepts, except for the program name, - includiing the paths to the molecule files to read. + including the paths to the molecule files to read. If `mols` is provided, the molecules(s) will be converted to the appropriate input structure(s) and passed to the main function, and the paths to the molecule files in `args` will be ignored. - The `mols` dictionaries must contain 'q' and 'r' keys for the charge and coordinate arrays, respectively, - and can optionally contain a 'name' key for the molecule name. Args: mols (object or list[object], optional): An object or a list thereof representing the molecule(s). @@ -334,13 +366,5 @@ def capture(self, *, mols=None, args=None, return_code=False): """ self._check_so() args = [self.so, *args] if args else [self.so] - if mols: - if not isinstance(mols, list): - mols = [mols] - nmol = len(mols) - mols_keepalive = [mol2struct(self.f.get_element, mol) for mol in mols] - mols = (inp_mols_t * nmol)(*mols_keepalive) - ret, out = self.f.main_in_out(args, nmol, mols) - else: - ret, out = self.f.main_out(args) + ret, out = self.f.main_in_out(args, mols) if mols else self.f.main_out(args) return (ret, out) if return_code else out diff --git a/src/api.c b/src/api.c index 9a298c1..9eb9cbf 100644 --- a/src/api.c +++ b/src/api.c @@ -26,8 +26,8 @@ int main_wrap_in(int argc, char * argv[], int n_inp_mols, inp_mols_t * inp_mols) } char * main_wrap_in_out(int argc, char * argv[], - int * ret, - int n_inp_mols, inp_mols_t * inp_mols) { + int n_inp_mols, inp_mols_t * inp_mols, + int * ret){ globals.out_str = calloc(PRINTBUFLEN, 1); *ret = main_wrap_in(argc, argv, n_inp_mols, inp_mols); return globals.out_str; From df2a207c5d4b665c045b664e616728e5e88998aa Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 11:19:12 +0100 Subject: [PATCH 42/48] Update pyproject and readme --- README.md | 6 +++++- python/pyproject.toml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c6e543..f1d7694 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,11 @@ A simple X11 molecular viewer. ## Python package (wrapper / API) available -[see python package page](python/README.md) +See python package page +[here.](python/README.md) + +Provides wrapper scripts with a simple installation and +allows to open unsupported file formats with `cclib`. ## Download [↑](#download) ``` diff --git a/python/pyproject.toml b/python/pyproject.toml index 4d77871..2801108 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -33,6 +33,7 @@ dependencies = [ [project.scripts] vmol = "vmol.__main__:main" +vmol2 = "vmol.vmol2:main" [project.urls] Repository = "https://github.com/briling/v.git" From be2d7aa3535f9d17ee20c903d76a76e37fc78404 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 12:25:15 +0100 Subject: [PATCH 43/48] Try to build wheels with cibuildwheel --- .github/workflows/wheels.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..4ed9b7f --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,31 @@ +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + + - uses: actions/setup-python@v6 + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==3.4.0 + + - name: Build wheels + working-directory: ./python + run: python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v6 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl From 773b3daa9f12d31a49186d016d781848cb52954d Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 12:43:26 +0100 Subject: [PATCH 44/48] Install X11 dependencies --- .github/workflows/wheels.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 4ed9b7f..3107595 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -11,6 +11,7 @@ jobs: os: [ubuntu-latest] steps: + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -24,8 +25,15 @@ jobs: - name: Build wheels working-directory: ./python run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BEFORE_ALL_LINUX: | + if [ -f /etc/alpine-release ]; then # musllinux (Alpine) + apk add --no-cache libx11-dev libxpm-dev pkgconf + else # manylinux (AlmaLinux) + /usr/bin/dnf -y install libX11-devel libXpm-devel pkgconf-pkg-config + fi - uses: actions/upload-artifact@v6 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl + path: ./python/wheelhouse/*.whl From b95896159b0666042234565348a6f98cad1de953 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 15:14:09 +0100 Subject: [PATCH 45/48] Use env variables when cannot call git --- .github/workflows/wheels.yml | 11 ++++++ python/setup.py | 73 ++++++++++++++++++------------------ 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3107595..07bb89b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -17,6 +17,17 @@ jobs: fetch-depth: 0 persist-credentials: false + - name: Export git metadata + shell: bash + run: | + set -euo pipefail + echo "VMOL_GIT_HASH=$(git rev-parse HEAD)" >> "$GITHUB_ENV" + echo "VMOL_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_ENV" + DESC="$(git describe --tags --dirty 2>/dev/null || true)" + echo "VMOL_GIT_DESCRIBE=${DESC}" >> "$GITHUB_ENV" + # ${{ github.sha }} (commit hash) + # ${{ github.ref_name }} (branch or tag name for the workflow run) + - uses: actions/setup-python@v6 - name: Install cibuildwheel diff --git a/python/setup.py b/python/setup.py index 1b8b2b8..5d5f88f 100644 --- a/python/setup.py +++ b/python/setup.py @@ -8,51 +8,50 @@ VERSION="3.0rc3" +def run_git(args): + try: + r = subprocess.run( ["git", *args], check=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True) + return r.stdout.strip() or None + except Exception: + return None + + def get_git_version_hash(): """Get tag/hash of the latest commit. Thanks to https://gist.github.com/nloadholtes/07a1716a89b53119021592a1d2b56db8 """ - try: - p = subprocess.Popen(["git", "describe", "--tags", "--dirty"], stdout=subprocess.PIPE) - except OSError: - return VERSION + "+unknown" - version = p.communicate()[0] - if not version.strip(): - return VERSION + "+unknown" - print(version) - return version.strip().decode().replace('+', '-').replace('-', '+', 1) + version = os.getenv("VMOL_GIT_DESCRIBE") or run_git(["describe", "--tags", "--dirty"]) or f"{VERSION}+unknown" + return version.replace('+', '-').replace('-', '+', 1) -if __name__ == '__main__': +def rel_posix(path): + return os.path.relpath(path, start=setup_dir).replace(os.sep, "/") - setup_dir = Path(__file__).parent - src_dir = setup_dir.parent / "src" - def rel_posix(path): - return os.path.relpath(path, start=setup_dir).replace(os.sep, "/") +setup_dir = Path(__file__).parent +src_dir = setup_dir.parent / "src" - c_files = [rel_posix(p) for p in src_dir.rglob("*.c")] - include_dirs = sorted({ rel_posix(h.parent) for h in src_dir.rglob("*.h") }) +c_files = [rel_posix(p) for p in src_dir.rglob("*.c")] +include_dirs = sorted({ rel_posix(h.parent) for h in src_dir.rglob("*.h") }) +if not c_files: + raise RuntimeError(f"No C sources found under {src_dir}") - try: - GIT_HASH = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode() - GIT_BRANCH = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip().decode() - except subprocess.CalledProcessError: - GIT_HASH = "unknown" - GIT_BRANCH = "unknown" - VERSION_FLAGS = [f'-DGIT_HASH="{GIT_HASH}"', - f'-DGIT_BRANCH="{GIT_BRANCH}"', - f'-DBUILD_USER="{os.getenv("USER")}@{os.getenv("HOSTNAME")}"', - f'-DBUILD_DIRECTORY="{os.getcwd()}"'] - - setup( - version=get_git_version_hash(), - ext_modules=[Extension('vmol.v', - sources=c_files, - include_dirs=include_dirs, - libraries = ['X11', 'Xpm'], - extra_compile_args=['-std=gnu11', '-O2', ] + VERSION_FLAGS, - extra_link_args=[]), - ], - ) +GIT_HASH = os.getenv("VMOL_GIT_HASH") or run_git(["rev-parse", "HEAD"]) or "unknown" +GIT_BRANCH = os.getenv("VMOL_GIT_BRANCH") or run_git(["rev-parse", "--abbrev-ref", "HEAD"]) or "unknown" + +VERSION_FLAGS = [f'-DGIT_HASH="{GIT_HASH}"', + f'-DGIT_BRANCH="{GIT_BRANCH}"', + f'-DBUILD_USER="{os.getenv("USER")}@{os.getenv("HOSTNAME")}"', + f'-DBUILD_DIRECTORY="{os.getcwd()}"'] + +setup( + version=get_git_version_hash(), + ext_modules=[Extension('vmol.v', + sources=c_files, + include_dirs=include_dirs, + libraries = ['X11', 'Xpm'], + extra_compile_args=['-std=gnu11', '-O2', ] + VERSION_FLAGS, + extra_link_args=[]), + ], +) From 9ed79c4a09b0af73df63c84f4f726d3d0e6f3d52 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 15:26:05 +0100 Subject: [PATCH 46/48] Fix build --- .github/workflows/wheels.yml | 6 +++--- .gitignore | 1 + python/MANIFEST.in | 2 ++ python/makefile | 2 +- python/setup.py | 2 ++ 5 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 python/MANIFEST.in diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 07bb89b..0de4feb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -34,8 +34,7 @@ jobs: run: python -m pip install cibuildwheel==3.4.0 - name: Build wheels - working-directory: ./python - run: python -m cibuildwheel --output-dir wheelhouse + run: python -m cibuildwheel ./python --output-dir wheelhouse env: CIBW_BEFORE_ALL_LINUX: | if [ -f /etc/alpine-release ]; then # musllinux (Alpine) @@ -47,4 +46,5 @@ jobs: - uses: actions/upload-artifact@v6 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./python/wheelhouse/*.whl + path: ./wheelhouse/*.whl + if-no-files-found: error diff --git a/.gitignore b/.gitignore index 9299e9e..9c6ac0f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ vmol.egg-info/ python/build python/dist +python/src diff --git a/python/MANIFEST.in b/python/MANIFEST.in new file mode 100644 index 0000000..c708c1c --- /dev/null +++ b/python/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include ../src *.c *.h +recursive-include ./src *.c *.h diff --git a/python/makefile b/python/makefile index 3b1a1be..daf0aca 100644 --- a/python/makefile +++ b/python/makefile @@ -2,4 +2,4 @@ all: clean python setup.py bdist_wheel clean: - rm build/ dist/ vmol.egg-info/ __pycache__/ -rf + rm src/ build/ dist/ vmol.egg-info/ __pycache__/ -rf diff --git a/python/setup.py b/python/setup.py index 5d5f88f..f2320cd 100644 --- a/python/setup.py +++ b/python/setup.py @@ -47,9 +47,11 @@ def rel_posix(path): setup( version=get_git_version_hash(), + include_package_data=True, ext_modules=[Extension('vmol.v', sources=c_files, include_dirs=include_dirs, + libraries = ['X11', 'Xpm'], extra_compile_args=['-std=gnu11', '-O2', ] + VERSION_FLAGS, extra_link_args=[]), From 018322d5cc7e28a871313f24f7aba13a1e5a5fb1 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 19:37:47 +0100 Subject: [PATCH 47/48] Move wheels to separate file --- .github/workflows/manual-build.yml | 8 +++++ .github/workflows/release.yml | 46 ++---------------------- .github/workflows/wheels.yml | 56 +++++++++++++++++++++--------- 3 files changed, 50 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/manual-build.yml diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml new file mode 100644 index 0000000..da016eb --- /dev/null +++ b/.github/workflows/manual-build.yml @@ -0,0 +1,8 @@ +name: build + +on: + workflow_dispatch: + +jobs: + wheels: + uses: ./.github/workflows/wheels.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc92dfb..d89a6f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ name: release -on: # triggered by push tagged commits to main +on: # triggered by push tagged commits push: tags: - 'v*' @@ -12,44 +12,7 @@ permissions: jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} for python ${{ matrix.py }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - py: ['3.11', '3.12', '3.13'] - - steps: - - - name: install X11 dependencies - if: ${{ runner.os == 'Linux' }} - run: | - sudo apt-get update - sudo apt install -y libx11-dev libxpm-dev x11proto-dev - - - uses: actions/checkout@v6 - with: - persist-credentials: false - - - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.py }} - - - name: install python - run: pip install setuptools - - - name: build wheels - working-directory: ./python - run: python setup.py bdist_wheel - ## we don't need the wheel name actually, the artifact name just has to be unique - #run: python setup.py bdist_wheel | grep "creating 'dist" | sed -n "s/^creating 'dist\//WHEEL_NAME='/;s/\s.*$//p" >> "$GITHUB_ENV" - - - uses: actions/upload-artifact@v6 - with: - path: ./python/dist/*.whl - name: ${{ matrix.os }}.${{ matrix.py }} - + uses: ./.github/workflows/wheels.yml build_exe: name: Build the executable file and shared library for ${{ matrix.os }} @@ -79,6 +42,7 @@ jobs: ./v ./v.so name: ${{ matrix.os }}.exe + if-no-files-found: error release: @@ -89,10 +53,6 @@ jobs: contents: write steps: - - name: Check out the repo - uses: actions/checkout@v6 - with: - fetch-depth: 0 - uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0de4feb..0e6f84f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,14 +1,33 @@ -name: Build +name: Build wheels -on: [push, pull_request] +on: + workflow_call: + inputs: + package-dir: + type: string + required: false + default: ./python + output-dir: + type: string + required: false + default: wheelhouse + cibw-build: + type: string + required: false + default: "" + cibw-skip: + type: string + required: false + default: "*-musllinux_*" + upload-artifact: + type: boolean + required: false + default: true jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] + name: Build wheels + runs-on: ubuntu-latest steps: @@ -21,21 +40,22 @@ jobs: shell: bash run: | set -euo pipefail - echo "VMOL_GIT_HASH=$(git rev-parse HEAD)" >> "$GITHUB_ENV" - echo "VMOL_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_ENV" - DESC="$(git describe --tags --dirty 2>/dev/null || true)" - echo "VMOL_GIT_DESCRIBE=${DESC}" >> "$GITHUB_ENV" - # ${{ github.sha }} (commit hash) - # ${{ github.ref_name }} (branch or tag name for the workflow run) + echo "VMOL_GIT_HASH=${{ github.sha }}" >> "$GITHUB_ENV" + echo "VMOL_GIT_BRANCH=${{ github.ref_name }}" >> "$GITHUB_ENV" + echo "VMOL_GIT_DESCRIBE=$(git describe --tags --dirty 2>/dev/null || true)" >> "$GITHUB_ENV" - uses: actions/setup-python@v6 + with: + python-version: '3.13' - name: Install cibuildwheel run: python -m pip install cibuildwheel==3.4.0 - name: Build wheels - run: python -m cibuildwheel ./python --output-dir wheelhouse + run: python -m cibuildwheel "${{ inputs.package-dir }}" --output-dir "${{ inputs.output-dir }}" env: + CIBW_BUILD: ${{ inputs.cibw-build }} + CIBW_SKIP: ${{ inputs.cibw-skip }} CIBW_BEFORE_ALL_LINUX: | if [ -f /etc/alpine-release ]; then # musllinux (Alpine) apk add --no-cache libx11-dev libxpm-dev pkgconf @@ -43,8 +63,10 @@ jobs: /usr/bin/dnf -y install libX11-devel libXpm-devel pkgconf-pkg-config fi - - uses: actions/upload-artifact@v6 + - name: Upload wheels + if: ${{ inputs.upload-artifact }} + uses: actions/upload-artifact@v6 with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl + name: vmol-wheels-${{ runner.os }}-${{ github.ref_name }}-${{ github.run_number }} + path: ${{ inputs.output-dir }}/*.whl if-no-files-found: error From e98ffbb8fa713cb81f8cbb83f035d7131d2cf237 Mon Sep 17 00:00:00 2001 From: Ksenia Date: Sun, 8 Mar 2026 20:28:03 +0100 Subject: [PATCH 48/48] version bump --- .github/CHANGELOG.md | 6 ++++-- python/README.md | 8 ++++---- python/setup.py | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index e751cf2..b1bc395 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -5,13 +5,15 @@ * Add partial extended xyz support (https://github.com/briling/v/pull/18) * Add `j` hotkey to jump to a frame inside and CLI option `frame:%d` to start with a specific frame (https://github.com/briling/v/pull/5) * Add `bmax` CLI argument for max. bond length (920202b) -* Python integration (#22, see https://github.com/aligfellow/xyzrender) +* Add `com` and `exitcom` CLI argument for `gui:0` and on-exit command sequences, respectively +* Python integration (#28, see https://github.com/aligfellow/xyzrender) ### Improvements * New colors by @iribirii (https://github.com/briling/v/pull/2, https://github.com/briling/v/pull/13, https://github.com/briling/v/pull/15) * Remove case sensitivity of xyz file inputs (https://github.com/briling/v/pull/9) * Add CLI option to disable centering of molecules (https://github.com/briling/v/pull/14) * Disable default rotation wrt inertia axis for z-matrix input and add a CLI option to force it (https://github.com/briling/v/pull/14) +* Read molecules from the standard input ### Fixes * Exit correctly when window closed (https://github.com/briling/v/pull/10) @@ -19,7 +21,6 @@ * Fix NaNs when compute dihedrals (https://github.com/briling/v/pull/14) ### Still have to be done: -* documentation for the python bindings * finish colors (#15) * ? extended xyz (#16, #17) * ? fix `readmore` bug (#7) @@ -27,3 +28,4 @@ * ? how to build on mac **Full Changelog**: https://github.com/briling/v/compare/v2.0...v3.0rc3 + diff --git a/python/README.md b/python/README.md index 9c62d2a..b737e06 100644 --- a/python/README.md +++ b/python/README.md @@ -19,19 +19,19 @@ Inspired by @aligfellow's [xyzrender](https://github.com/aligfellow/xyzrender). ## Installation ``` -VV="3.0rc3" # v version +VV="3.0rc4" # v version PY="313" # python version for wheels, also available "311" and "312" ``` ### Option 1 -- install wheels ``` -pip install "https://github.com/briling/v/releases/download/v3.0rc3/vmol-${VV}-cp${PY}-cp${PY}-linux_x86_64.whl" +pip install "https://github.com/briling/v/releases/download/v${VV}/vmol-${VV}-cp${PY}-cp${PY}-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl" ``` alternatively ``` -wget "https://github.com/briling/v/releases/download/v3.0rc3/vmol-${VV}-cp${PY}-cp${PY}-linux_x86_64.whl" -pip install "vmol-${VV}-cp${PY}-cp${PY}-linux_x86_64.whl" +wget "https://github.com/briling/v/releases/download/v${VV}/vmol-${VV}-cp${PY}-cp${PY}-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl" +pip install "vmol-${VV}-cp${PY}-cp${PY}-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl" ``` ### Option 2 -- build and install from github diff --git a/python/setup.py b/python/setup.py index f2320cd..0acf5bd 100644 --- a/python/setup.py +++ b/python/setup.py @@ -6,7 +6,7 @@ from pathlib import Path -VERSION="3.0rc3" +VERSION="3.0rc4" def run_git(args): try: