10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-17 08:30:31 +02:00

Merge pull request #3 from scemama/master

Merge with the amazing one
This commit is contained in:
Emmanuel Giner 2016-11-04 17:41:10 +01:00 committed by GitHub
commit c9702efcad
305 changed files with 17253 additions and 6605 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
quantum_package.rc
config/ifort.cfg
quantum_package_static.tar.gz
build.ninja
.ninja_log

View File

@ -9,6 +9,8 @@ sudo: false
addons:
apt:
packages:
- zlib1g-dev
- libgmp3-dev
- gfortran
- gcc
- liblapack-dev
@ -24,7 +26,7 @@ python:
script:
- ./configure --production ./config/gfortran.cfg
- source ./quantum_package.rc ; qp_module.py install Full_CI Hartree_Fock CAS_SD MRCC_CASSD All_singles
- source ./quantum_package.rc ; qp_module.py install Full_CI Full_CI_ZMQ Hartree_Fock CAS_SD mrcepa0 All_singles
- source ./quantum_package.rc ; ninja
- source ./quantum_package.rc ; cd ocaml ; make ; cd -
- source ./quantum_package.rc ; cd tests ; ./run_tests.sh #-v

View File

@ -1,21 +1,20 @@
Quantum package
===============
![QP](https://raw.githubusercontent.com/LCPQ/quantum_package/master/data/qp.png)
[![Build Status](https://travis-ci.org/LCPQ/quantum_package.svg?branch=master)](https://travis-ci.org/LCPQ/quantum_package)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/LCPQ/quantum_package?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Set of quantum chemistry programs and libraries.
(under GNU GENERAL PUBLIC LICENSE v2)
For more information, you can visit the [wiki of the project](http://github.com/LCPQ/quantum_package/wiki>), or below for the installation instructions.
Demo
====
[![Full-CI energy of C2 in 2 minutes](https://i.vimeocdn.com/video/555047954_295x166.jpg)](https://vimeo.com/scemama/quantum_package_demo "Quantum Package Demo")
[![Frozen-core Full-CI energy of Ti](https://raw.githubusercontent.com/LCPQ/quantum_package/master/data/Titanium.png)](https://raw.githubusercontent.com/LCPQ/quantum_package/master/data/Titanium.png "Convergence of Ti in cc-pv{DTQ}Z")
# Installation
@ -159,7 +158,7 @@ Program exited with code 139.
#### Why ?
It's caused when we call the DGEM routine of LAPACK.
It's caused when we call the DGEMM routine of LAPACK.
##### Fix

View File

@ -10,7 +10,7 @@
#
#
[COMMON]
FC : gfortran -ffree-line-length-none -I . -mavx
FC : gfortran -ffree-line-length-none -I . -mavx -g
LAPACK_LIB : -llapack -lblas
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32

View File

@ -51,7 +51,7 @@ FCFLAGS : -Ofast
# -g : Extra debugging information
#
[DEBUG]
FCFLAGS : -g -pedantic -msse4.2
FCFLAGS : -g -msse4.2
# OpenMP flags
#################

View File

@ -31,14 +31,15 @@ OPENMP : 1 ; Append OpenMP flags
# -ftz : Flushes denormal results to zero
#
[OPT]
FCFLAGS : -xSSE4.2 -O2 -ip -opt-prefetch -ftz -g
FC : -traceback
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -opt-prefetch -ftz
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
# Debugging flags
#################
@ -57,6 +58,6 @@ FCFLAGS : -xSSE2 -C -fpe0
#################
#
[OPENMP]
FC : -openmp
FC : -qopenmp
IRPF90_FLAGS : --openmp

62
config/sse4_avx2.cfg Normal file
View File

@ -0,0 +1,62 @@
# Common flags
##############
#
# -mkl=[parallel|sequential] : Use the MKL library
# --ninja : Allow the utilisation of ninja. It is mandatory !
# --align=32 : Align all provided arrays on a 32-byte boundary
#
[COMMON]
FC : ifort
LAPACK_LIB : -mkl=parallel
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 1 ; Enable cache_compile.py
OPENMP : 1 ; Append OpenMP flags
# Optimization flags
####################
#
# -xHost : Compile a binary optimized for the current architecture
# -O2 : O3 not better than O2.
# -ip : Inter-procedural optimizations
# -ftz : Flushes denormal results to zero
#
[OPT]
FCFLAGS : -axSSE4.2,AVX,CORE-AVX2 -O2 -ip -ftz -g -traceback
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
# Debugging flags
#################
#
# -traceback : Activate backtrace on runtime
# -fpe0 : All floating point exaceptions
# -C : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
# -xSSE2 : Valgrind needs a very simple x86 executable
#
[DEBUG]
FC : -g -traceback
FCFLAGS : -xSSE2 -C -fpe0
# OpenMP flags
#################
#
[OPENMP]
FC : -openmp
IRPF90_FLAGS : --openmp

15
configure vendored
View File

@ -46,7 +46,12 @@ if len(sys.argv) != 3:
# \_| |_ (_) |_) (_| | | | | | (_)
#
QP_ROOT = os.getcwd()
try:
QP_ROOT = os.environ["QP_ROOT"]
except KeyError:
QP_ROOT = os.getcwd()
os.environ["QP_ROOT"] = QP_ROOT
QP_ROOT_BIN = join(QP_ROOT, "bin")
QP_ROOT_LIB = join(QP_ROOT, "lib")
QP_ROOT_INSTALL = join(QP_ROOT, "install")
@ -137,7 +142,7 @@ ezfio = Info(
default_path=join(QP_ROOT_INSTALL, "EZFIO"))
zeromq = Info(
url='http://download.zeromq.org/zeromq-4.0.7.tar.gz',
url='https://github.com/zeromq/zeromq4-1/releases/download/v4.1.5/zeromq-4.1.5.tar.gz',
description=' ZeroMQ',
default_path=join(QP_ROOT_LIB, "libzmq.a"))
@ -482,7 +487,6 @@ def create_ninja_and_rc(l_installed):
l_rc = [
'export QP_ROOT={0}'.format(QP_ROOT),
'#export QP_NIC=ib0 # Choose the correct network inuterface',
'export QP_EZFIO={0}'.format(path_ezfio.replace(QP_ROOT,"${QP_ROOT}")),
'export QP_PYTHON={0}'.format(":".join(l_python)), "",
'export IRPF90={0}'.format(path_irpf90.replace(QP_ROOT,"${QP_ROOT}")),
@ -493,6 +497,10 @@ def create_ninja_and_rc(l_installed):
'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"', "",
'source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh', "",
'source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true',
'',
'# Choose the correct network interface',
'# export QP_NIC=ib0',
'# export QP_NIC=eth0',
""
]
@ -538,7 +546,6 @@ def recommendation():
print ""
print "Finally :"
print " ninja"
print " make -C ocaml"
print ""
print "You can install more plugin with the qp_module.py install command"
print "PS : For more info on compiling the code, read the README.md"

BIN
data/Titanium.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -705,3 +705,5 @@ H 1
1 21.1040000 1.0000000
H 1
1 0.7420000 1.0000000

View File

@ -893,3 +893,5 @@ D 1
1 11.4590000 1.0000000
D 1
1 0.2400000 1.0000000

View File

@ -1594,3 +1594,5 @@ G 1
1 17.2430000 1.0000000
G 1
1 0.4590000 1.0000000

View File

@ -1224,3 +1224,5 @@ F 1
1 13.6740000 1.0000000
F 1
1 0.4060000 1.0000000

View File

@ -7065,3 +7065,5 @@ H 1
1 0.9303000 1.0000000
H 1
1 0.5800000 1.0000000

View File

@ -1515,3 +1515,5 @@ I 1
1 1.5066000 1.0000000
I 1
1 0.9926000 1.0000000

View File

@ -3485,3 +3485,5 @@ D 1
1 0.5030000 1.0000000
D 1
1 0.2155000 1.0000000

View File

@ -5685,3 +5685,5 @@ G 1
1 0.7395000 1.0000000
G 1
1 0.3590000 1.0000000

View File

@ -4421,3 +4421,5 @@ F 1
1 0.6622000 1.0000000
F 1
1 0.3280000 1.0000000

View File

@ -1614,3 +1614,5 @@ G 1
1 0.3023000 1.0000000
H 1
1 0.2534000 1.0000000

View File

@ -1515,3 +1515,5 @@ I 1
1 1.5066000 1.0000000
I 1
1 24.5369000 1.0000000

View File

@ -905,3 +905,5 @@ D 1
1 0.0537000 1.0000000
D 1
1 1.3743000 1.0000000

View File

@ -1611,3 +1611,5 @@ G 1
1 0.1466000 1.0000000
G 1
1 1.5908000 1.0000000

View File

@ -1246,3 +1246,5 @@ F 1
1 0.1509000 1.0000000
F 1
1 1.3909000 1.0000000

View File

@ -7212,3 +7212,5 @@ G 1
1 1.1040000 1.0000000
H 1
1 0.9303000 1.0000000

View File

@ -1323,3 +1323,5 @@ H 1
1 0.8871000 1.0000000
I 1
1 1.5066000 1.0000000

View File

@ -3367,3 +3367,5 @@ D 5
5 1.5075240 0.2667560
D 1
1 0.5030000 1.0000000

View File

@ -5482,3 +5482,5 @@ F 1
1 0.9557000 1.0000000
G 1
1 0.7395000 1.0000000

View File

@ -4269,3 +4269,5 @@ D 1
1 0.3006000 1.0000000
F 1
1 0.6622000 1.0000000

View File

@ -166,3 +166,5 @@ D 1
1 0.6650000 1.0000000
D 1
1 2.6600000 1.0000000

View File

@ -1017,3 +1017,5 @@ F 1
G 1
1 0.623669 1.000000

View File

@ -586,3 +586,5 @@ S 1
P 1
1 1.275000 1.000000

View File

@ -997,3 +997,5 @@ P 8
7 9.063386 -0.224631
8 16.737180 0.098422

View File

@ -2409,3 +2409,5 @@ G 1
H 1
1 3.164456 1.000000

View File

@ -809,3 +809,5 @@ D 1
F 1
1 1.021427 1.000000

View File

@ -1850,3 +1850,5 @@ F 1
G 1
1 2.775762 1.000000

View File

@ -1279,3 +1279,5 @@ P 1
D 1
1 1.913792 1.000000

32
data/pseudo/tm Normal file
View File

@ -0,0 +1,32 @@
Ag GEN 36 2
4
11.074 1 1.712
-166.201 2 1.391
255.676 2 1.194
-91.757 2 1.033
3
11.074 1 0.897
-22.6472 2 1.226
16.8557 2 0.9789
4
9.524 1 12.668
227.659 2 1.662
-363.576 2 1.4
150.286 2 1.205
Au GEN 68 2
4
10.881 1 2.286
-97.386 2 1.088
270.134 2 1.267
-171.733 2 1.499
3
10.721 1 1.38
-63.222 2 1.111
60.634 2 0.987
4
9.383 1 11.
225.822 2 1.66
286.233 2 1.342
-497.561 2 1.437

806
data/pseudo/tn_df Normal file
View File

@ -0,0 +1,806 @@
H GEN 0 2
6
1.00000000 1 34.44662515
-0.89096601 2 40.13885591
-4.35250792 2 24.66307521
-11.58011743 2 20.49225491
12.58011743 2 30.23909011
34.44662515 3 22.28419700
6
-262.22422461 2 17.87367530
258.22981252 2 28.75598991
5613.63467960 2 19.10096571
-4192.30569417 2 18.88256059
-1341.04802395 2 20.95302325
-79.28421640 2 34.10653707
6
-199.48848662 2 37.85954681
197.31066276 2 28.79454664
4870247.22276531 2 40.22839783
-5277181.77014563 2 40.34690459
-196566.81095176 2 39.13989706
603502.35555458 2 40.91315002
He GEN 0 2
6
2.00000000 1 22.64777484
-0.00700692 2 23.54196640
-8.90169316 2 18.71556903
113.56926776 2 15.15150658
-112.56926776 2 13.80465850
45.29554968 3 12.54192267
6
747.63794984 2 13.33611411
-753.70091072 2 23.45392111
-397.08293819 2 12.23651194
10.35341837 2 14.87987639
-1430.53848568 2 18.32138342
1818.26602949 2 21.24054054
6
305.67933642 2 21.32319132
-307.98355807 2 12.22370696
5957.66379729 2 14.11720170
-6099.62872267 2 14.41269814
523.59639310 2 17.66028106
-380.63505659 2 21.52626637
Li GEN 2 2
6
1.00000000 1 0.78732101
-2.23999912 2 0.79224763
0.10376190 2 1.79622268
4.27489122 2 1.83637465
-3.27489122 2 1.91213904
0.78732101 3 0.79291624
6
256.80790655 2 1.78312879
-255.81956741 2 0.95553059
90.30361668 2 0.87617279
272.13155048 2 1.09621549
-180.73373018 2 1.43900642
-180.70146573 2 1.83085147
6
-4.80714862 2 1.53942961
3.36281864 2 0.84742021
-305.38012622 2 0.78976831
-509.40184487 2 0.98031681
436.16121675 2 0.81548364
379.61797456 2 1.02582853
Be GEN 2 2
6
2.00000000 1 1.20639978
-5.40313229 2 1.18425537
1.72394027 2 2.81826911
2.83884922 2 2.37513515
-1.83884922 2 2.82920954
2.41279956 3 1.18219335
6
-1045.63679908 2 2.59240356
1047.85482764 2 1.41685787
-1899.15859219 2 1.48536566
1398.06780686 2 1.70076501
-696.13481389 2 2.03898674
1198.22571139 2 2.57766211
6
630.90931326 2 1.84421403
-632.78437074 2 1.13419132
441.35012255 2 1.13393716
435.97021325 2 1.22419150
-353.63284449 2 1.39760436
-522.69065435 2 1.88595068
B GEN 2 2
6
3.00000000 1 2.72292969
-11.78419674 2 2.41356794
5.22993640 2 4.60628004
0.42834165 2 3.81569642
0.57165835 2 4.75281449
8.16878907 3 2.42655010
6
-260.26050710 2 2.55536939
265.37594882 2 4.54575013
76.89512909 2 2.14992133
-57.25691791 2 2.71845869
4293.37943873 2 3.54567059
-4312.01708538 2 3.65811356
6
236.98381086 2 3.86703012
-239.59777090 2 2.15409783
4347.09682018 2 2.51320631
-4637.07702775 2 2.58243237
786.10765740 2 3.15459528
-495.13181880 2 3.69673537
C GEN 2 2
6
4.00000000 1 6.85914037
-69.31783111 2 7.66877502
58.73619595 2 8.89164866
-5.11066199 2 4.63398124
6.11066199 2 5.40104250
27.43656147 3 6.79273179
6
430.61454744 2 8.62389774
-421.35054055 2 5.03244470
-33212.40034531 2 6.89861917
44.12655159 2 3.96628687
96.39927700 2 5.01313881
33072.87650778 2 6.85964729
6
-104389.58452246 2 4.75057662
104386.03365951 2 8.95366858
690570.92310077 2 7.84605551
105067.78650436 2 4.75435948
-142604.06718444 2 8.80450514
-653033.64724842 2 7.81116996
N GEN 2 2
6
5.00000000 1 11.01983025
-747.65378590 2 7.70260962
731.28815439 2 7.83791198
-3.54162255 2 8.41784728
4.54162255 2 12.53426384
55.09915125 3 6.76845507
6
189.29450948 2 10.95064006
-174.81483163 2 7.48980682
148422.74289741 2 6.18035270
-167161.90534269 2 6.21695388
34280.43140051 2 6.81408633
-15540.26812247 2 7.23413705
6
-5338.70218681 2 6.15987128
5334.35386770 2 7.49726635
-1839.21100223 2 8.80963870
16010.85000728 2 6.52067091
-16722.95522386 2 6.97790252
2552.31199840 2 8.37871646
O GEN 2 2
6
6.00000000 1 8.86932353
-28.04199287 2 6.05326172
11.15704031 2 5.51480979
180.82432510 2 10.77878397
-179.82432510 2 10.23693413
53.21594115 3 7.90462675
6
-9212.20980516 2 7.28893859
9226.86567950 2 6.05971190
58203.26727502 2 10.83143357
-5120.48607364 2 5.75281092
-93321.50266843 2 10.51155711
40239.72318888 2 9.72227746
6
10001.55649464 2 7.43321349
-10012.86801601 2 5.85047476
8554.95973537 2 5.79011164
-20342.33136146 2 8.08750969
11739.44079236 2 8.43229920
48.92837040 2 4.71055456
F GEN 2 2
6
7.00000000 1 16.52048840
-10.46754024 2 13.26693551
-11.21567917 2 18.77563836
-32.41582195 2 10.96778594
33.41582195 2 21.09729680
115.64341877 3 13.46927525
6
1201.43391413 2 19.92490215
-1182.60889584 2 11.77163137
-8770.99026936 2 12.30043337
5336.21358848 2 11.63810105
8729.77565724 2 14.12189391
-5293.99672165 2 16.53091209
6
92.58757506 2 8.66992000
-108.46085404 2 9.40009036
-319.30686222 2 9.08633595
524.57586653 2 9.90194004
-443.63347077 2 13.57164540
239.36118945 2 16.47995554
Ne GEN 2 2
6
8.00000000 1 21.64664513
1794.02959527 2 14.45731213
-1828.03241002 2 14.11697591
23.90491418 2 14.10774236
-22.90491418 2 20.42359560
173.17316107 3 11.93940404
6
-5911.13460210 2 12.24993716
5941.26076308 2 20.24332306
2840.09993994 2 12.20646543
1742.40556167 2 11.50431394
8834.09207695 2 16.82066882
-13415.59681607 2 18.72208419
6
53626.32637171 2 20.56468824
-53639.90888359 2 19.92390926
-576.65341012 2 13.02834964
1907.80575476 2 15.43385134
5623.71426075 2 18.06950435
-6953.86800222 2 22.66963993
K GEN 18 2
6
1.00000000 1 0.50008727
1416.76952428 2 0.63134777
-1419.89095139 2 0.60241926
-302.74307268 2 0.68724573
303.74307268 2 0.55624069
0.50008727 3 0.50008691
6
-854959.33457742 2 0.55297829
854960.96236303 2 0.59508099
-2735051.37932036 2 0.55136787
-797902.82136562 2 0.59254779
-90621.33409241 2 0.60683509
3623576.53510235 2 0.55188848
6
5366450.44923246 2 0.56834617
-5366449.39460951 2 0.57395202
506392.75510780 2 0.65188562
1065012.45735119 2 0.60395254
-764583.36396565 2 0.55451976
-806820.84832728 2 0.64359720
Ca GEN 18 2
6
2.00000000 1 0.74758765
308735.40641498 2 0.72269274
-308740.90975833 2 0.72197603
7202.81432103 2 0.70435779
-7201.81432103 2 0.73462875
1.49517531 3 0.98521314
6
3358.40551562 2 0.85820603
-3354.33378202 2 0.50055931
645.82930380 2 0.77593512
-4032.30085432 2 0.85197466
3315.68514964 2 0.50005881
71.78714429 2 1.01826143
6
3797.10880911 2 0.54666026
-3794.15970380 2 0.55760964
1988.78457523 2 0.66771019
13912.48066729 2 0.71662858
-408.96685813 2 0.50701325
-15491.29677996 2 0.71335086
Sc GEN 18 2
6
3.00000000 1 6.99258598
-124.50237230 2 4.24128187
97.21802227 2 1.68870852
-87.09390293 2 1.51321231
88.09390293 2 5.62659050
20.97775795 3 2.67617421
6
375.73920548 2 5.45654024
-350.54708476 2 5.82486421
-11.58800164 2 0.51173797
12.31935173 2 0.56805032
20.80334597 2 0.78399590
-20.53480959 2 1.25273408
6
6092.78689761 2 1.30970450
-6068.65474455 2 6.97688197
6074.16548241 2 6.96312742
-2.71306889 2 0.50000000
562.44223581 2 1.09627007
-6632.89448781 2 1.28901234
Ti GEN 18 2
6
4.00000000 1 4.58962911
29.78882355 2 12.99080675
-64.03604684 2 6.47044482
4.09908827 2 7.32890448
-3.09908827 2 0.86508310
18.35851644 3 11.66884823
6
204.54741131 2 6.98984163
-173.26765359 2 1.14387234
-179.62280834 2 7.98041969
81.98571631 2 1.30274954
-105.23530836 2 0.79373704
203.87378660 2 0.87617820
6
47.21398743 2 4.46327869
-17.03315162 2 12.03758238
-1.80345968 2 1.82986618
-67.65022794 2 0.85432599
83.23157126 2 0.75234069
-12.77614240 2 0.56466795
V GEN 18 2
6
5.00000000 1 4.80344323
22.35774108 2 18.78787979
-64.07198704 2 7.13216682
4.33388926 2 9.27213879
-3.33388926 2 0.97989891
24.01721615 3 16.08839186
6
180.61077610 2 8.25076842
-142.94184574 2 0.97905818
-150.64642751 2 9.92043295
-6.71407277 2 0.62363714
176.09329684 2 0.95148528
-17.73131270 2 1.07801133
6
57.45110361 2 5.32960287
-20.81111514 2 14.24980571
-8.29286428 2 1.85925508
-5.73287020 2 0.58593750
29.10022105 2 0.79878530
-14.07269455 2 1.00225258
Cr GEN 18 2
6
6.00000000 1 12.84308988
-3.09604991 2 0.99382054
-44.89504234 2 7.58819115
-170.55613293 2 14.51774012
171.55613293 2 16.43682827
77.05853926 3 12.82491986
6
-18202.34922306 2 1.98782159
18244.42867028 2 31.32646602
30868.09979612 2 30.37846452
17868.98085600 2 1.97809129
-49114.96837018 2 30.73273877
378.88775116 2 2.67913288
6
29.20236180 2 19.25203633
12.37319603 2 0.97567458
4072.48148684 2 17.43196546
-17623.52674725 2 16.30880219
0.00000000 2 1.00000000
13552.04578438 2 15.92770430
Mn GEN 18 2
6
7.00000000 1 15.05016398
76.06668034 2 15.84783194
-134.18719488 2 9.80426007
5.15310013 2 22.40715541
-4.15310013 2 1.28870598
105.35114786 3 9.24698903
6
5.29793560 2 36.81344701
46.23395617 2 10.22325416
-60.32817992 2 19.40077237
47.36691946 2 10.31192728
-593.48022661 2 0.82035751
607.44155846 2 0.82499832
6
43.56050065 2 39.11191097
6.67450664 2 5.89010993
273.74198710 2 12.39309544
-27.45450618 2 46.10455298
-256.40166892 2 15.13448958
11.11513392 2 0.96513012
Fe GEN 18 2
6
8.00000000 1 15.22430826
44.74166498 2 23.61492800
-111.48295214 2 10.92989564
4.87905385 2 34.25190536
-3.87905385 2 1.33822720
121.79446608 3 12.33553803
6
-19.50464924 2 30.77395752
78.13974335 2 10.21396062
-93.51149367 2 7.16717891
-5331.00729306 2 2.86167947
2973.12062964 2 2.65030718
2452.39961633 2 3.20024669
6
24692.89537881 2 35.68878072
-24635.37117467 2 1.90446408
67.20321584 2 9.50100295
-24719.85685234 2 35.67756831
155.45498669 2 2.48480944
24498.19947049 2 1.90126047
Co GEN 18 2
6
9.00000000 1 16.99448342
49.13807967 2 27.18614115
-125.28324533 2 12.21218102
5.11388765 2 39.14513799
-4.11388765 2 1.47717612
152.95035078 3 13.67966454
6
-14.42629264 2 42.14707531
80.80701231 2 9.38147677
-241.37463154 2 5.80599555
-2375.49390008 2 3.20236619
1470.87516654 2 3.85735739
1146.99509265 2 2.77670509
6
136.98013925 2 35.88691706
-71.59603354 2 2.32679268
69.29537053 2 14.47120857
-182.97334302 2 33.48566094
53.73921710 2 5.03596368
60.93980797 2 1.71252673
Ni GEN 18 2
6
10.00000000 1 22.08639324
-144.93688782 2 14.51813938
58.56151708 2 31.72005545
5.46467869 2 46.47610840
-4.46467869 2 1.64348434
220.86393239 3 17.23929992
6
-1037.96291767 2 23.63013626
1112.68285967 2 22.54579447
-202.88667032 2 10.67846148
-1992.46747856 2 2.78611652
261.70081349 2 7.26891690
1934.65478930 2 2.71695433
6
-53.30731307 2 26.78098186
127.09013633 2 3.54449677
-4806.85555998 2 9.97427088
4887.04372410 2 10.06368893
-212.17359382 2 2.46160888
132.98697057 2 1.97486742
Cu GEN 18 2
6
11.00000000 1 2.82733696
-34.48196386 2 1.92614044
-60.25585479 2 16.36117816
95.74606505 2 26.07073787
-94.74606505 2 15.23964803
31.10070652 3 2.17204001
6
-45.62927216 2 31.69953680
125.91417027 2 1.14930323
-14.54702824 2 1.62190112
4.20903863 2 5.04037704
108.15433753 2 13.02666762
-96.81611101 2 1.08245080
6
95.22440516 2 11.30741812
-15.05535618 2 0.88219501
50.51809351 2 1.10244974
-44.11033096 2 1.38963093
24.77977412 2 1.74927941
-30.18619193 2 36.48037929
Zn GEN 18 2
6
12.00000000 1 31.07239014
-200.01988966 2 17.28158695
92.10229536 2 34.39655496
5.98135501 2 49.89939973
-4.98135501 2 1.96865590
372.86868168 3 19.34259724
6
-36.14038802 2 38.52109994
128.37782465 2 12.00212013
-1.61496737 2 1.07625274
-1.83786181 2 49.67118376
65.46563590 2 2.17772473
-61.01291439 2 3.24812913
6
-65.64354860 2 18.09701361
156.02859885 2 36.00255883
172.20201747 2 14.96596000
-192.17040837 2 36.71242576
4.39165632 2 5.39429237
16.57829500 2 1.49031308
Ga GEN 28 2
6
3.00000000 1 1.13608798
164.07678897 2 1.26217688
-167.28328999 2 1.14858151
-669.79177234 2 1.15353581
670.79177234 2 1.12952095
3.40826394 3 1.10744970
6
2326.37321481 2 0.75031475
-2323.38047364 2 0.75000124
386.83516033 2 2.39556890
3373.92258044 2 1.92296729
-3444.97340674 2 2.01243025
-314.78429931 2 1.54022372
6
-49.00749762 2 0.97248539
49.23559677 2 1.12030491
13.15736344 2 1.17799318
125.85888665 2 1.43966818
-194.32447492 2 1.61975153
56.31063114 2 1.96345236
Ge GEN 28 2
6
4.00000000 1 1.37803409
19.62241898 2 1.39153725
-23.72148814 2 1.27769848
2.49161805 2 1.59279926
-1.49161805 2 0.64699203
5.51213636 3 0.92923210
6
-2.74466220 2 0.87224298
6.62035166 2 1.17293014
-2420.40847648 2 1.99495027
-82306.43955717 2 2.42954180
6740.23721390 2 2.16484262
77987.61073589 2 2.43883104
6
-2107.38453991 2 1.16911036
2108.21076604 2 1.46731756
1481.43044167 2 1.13494844
-5605.67944848 2 1.57427397
1698.46708565 2 1.69705377
2426.78290985 2 1.49642085
As GEN 28 2
6
5.00000000 1 1.43022249
-9.34297986 2 1.49610460
4.21498088 2 6.47107540
10.09813510 2 3.25241162
-9.09813510 2 5.07144325
7.15111245 3 1.33657021
6
13218.94379269 2 1.93743539
-13214.39886844 2 1.06114866
-12968.43207956 2 1.94924972
13915.97822491 2 1.06566409
-954.00698285 2 1.23265097
7.46088753 2 4.89271387
6
1464.46500602 2 1.99905491
-1463.07044815 2 1.47578217
368.93680276 2 1.30626554
-20015.22902646 2 1.76510607
-4931.41969774 2 1.62454622
24578.71284776 2 1.71245824
Se GEN 28 2
6
6.00000000 1 1.51096144
18985.66456772 2 2.92355341
-18994.15945825 2 2.92032845
-67662.27071451 2 3.11248219
67663.27071451 2 3.11189793
9.06576863 3 1.65761092
6
9.98441274 2 1.51889669
-2.50844675 2 1.97738476
-180236.05319146 2 2.70806322
388717.66809223 2 2.76186155
-395809.31847294 2 2.85646715
187328.70401255 2 2.90992434
6
-0.64003892 2 1.60286011
4.75615253 2 1.39335643
-1221.08696720 2 2.09669307
-10412.15615824 2 2.41527013
11345.50935270 2 2.36453165
288.73492615 2 3.03391531
Br GEN 28 2
6
7.00000000 1 1.41289916
-7.52651514 2 1.15658370
-0.55005317 2 2.42725255
32.50767838 2 2.88316202
-31.50767838 2 2.65601102
9.89029412 3 1.40346702
6
28526.73706896 2 2.34791729
-28520.73498833 2 2.45113975
-99003.29767895 2 2.50553756
749850.19071550 2 2.81179865
-1128475.81390516 2 2.78141408
477629.92118992 2 2.68265676
6
17.76908748 2 1.31119911
-15.01578842 2 1.60289186
-18723.09651802 2 2.55330648
-655.15159005 2 2.02749820
16349.83148583 2 2.49321553
3029.41777740 2 2.76331597
Kr GEN 28 2
6
8.00000000 1 8.52108317
-122698.81335772 2 3.24264497
122687.31930993 2 3.40822193
-118092.31104849 2 3.40804203
118093.31104849 2 3.23631062
68.16866536 3 4.68396906
6
-494.70169718 2 5.76331362
503.25343741 2 2.73098609
-367021.57369848 2 3.66759371
-1529686.47073208 2 3.83008505
1834642.13235417 2 3.78655002
62066.91317383 2 4.17980892
6
-73.83484449 2 5.20603747
79.00632901 2 4.70236432
1062.70264892 2 4.15470411
-40873.21549348 2 3.08586486
43280.45283221 2 3.10363880
-3468.93856436 2 3.63224008
Al GEN 10 2
6
3.00000000 1 0.91821413
-12.79791788 2 1.10715442
7.32796626 2 2.03989390
-52053.92058080 2 2.04204466
52054.92058080 2 2.04199047
2.75464240 3 0.94029840
6
-42.72903905 2 1.99445589
47.15203530 2 1.12469986
3231.39534748 2 1.72843552
-398.06113457 2 1.37872018
6652.21368423 2 1.92811339
-9484.54780105 2 1.87995009
6
830.07508675 2 1.87943518
-827.97758021 2 1.42508183
-1235.04705829 2 1.80941062
-21.40768628 2 0.95469299
154.21154335 2 1.20079877
1103.24388863 2 1.53169350
Si GEN 10 2
6
4.00000000 1 1.22418085
40.72596063 2 2.05337336
-48.11509746 2 1.71412850
-37.28006653 2 2.41395005
38.28006653 2 2.32084434
4.89672339 3 1.35299631
6
-7.68509694 2 1.13070385
13.98411213 2 1.16859753
-116498.38332824 2 2.36994226
-9121.48068622 2 2.16734100
31941.11999828 2 2.44879942
93679.74429067 2 2.32322104
6
41248.64599856 2 1.86811003
-41245.51022334 2 2.10179754
-60.37864776 2 1.33467919
4180.55486914 2 2.29835912
-142125.41164262 2 1.93345601
138006.23630568 2 1.99192523
P GEN 10 2
6
5.00000000 1 3.71332384
-13724.87406260 2 3.31759335
13714.20593187 2 3.65850189
-19470.81568886 2 3.61426447
19471.81568886 2 3.37579099
18.56661922 3 2.21831587
6
-1411.99322697 2 3.20289077
1421.31824558 2 2.14807352
576236.74902855 2 2.65372234
-397754.23263905 2 2.69778221
-194403.08693812 2 2.58386669
15921.57087605 2 2.99361065
6
64.03084909 2 2.59482433
-58.63734715 2 3.43313766
365.80442210 2 2.95557705
-12.13895471 2 1.75387879
158.27628825 2 3.69699906
-510.94109430 2 3.15077203
S GEN 10 2
6
6.00000000 1 2.51977085
-84.83332404 2 3.22007986
70.54487302 2 4.71655238
3581.56671658 2 4.39998291
-3580.56671658 2 4.41784559
15.11862509 3 2.54586294
6
-231.72652822 2 4.61819246
244.26248418 2 2.30938314
-920.53494189 2 2.65072450
2410.83323256 2 3.31119070
-2429.46016726 2 3.80226712
940.16251250 2 4.46824294
6
957.88712772 2 4.48874898
-950.12559451 2 3.37845034
6481.05990210 2 3.83307173
-157.23448173 2 1.92699416
186.18956071 2 1.98946862
-6509.01396292 2 3.99439281
Cl GEN 10 2
6
7.00000000 1 6.06473582
-454.17116717 2 5.57110302
436.13184861 2 5.26917938
-712.97599461 2 4.62455647
713.97599461 2 4.94326867
42.45315074 3 3.47635853
6
3561.38023524 2 4.48278574
-3545.84042135 2 3.43372818
-348465.51723117 2 3.74855830
12627.08188052 2 3.20650110
404246.19776785 2 3.70673786
-68406.76197098 2 3.45681590
6
19.30024745 2 3.79400952
-9.26766424 2 3.06020678
508.81151546 2 4.47438492
-7.59455659 2 2.43219723
-757.15587217 2 4.97983429
256.93953188 2 5.71145786
Ar GEN 10 2
6
8.00000000 1 3.61306766
326.13269394 2 4.01911273
-346.66642426 2 5.31624938
-7083.13498801 2 4.62848435
7084.13498801 2 4.70295676
28.90454131 3 3.84612203
6
323.59441180 2 3.28236424
-306.35028843 2 3.72212609
-6283.46399338 2 4.23452843
435312.63926384 2 4.90386840
20087.00527001 2 5.30220051
-449115.17955704 2 4.93088566
6
-2470.88386165 2 5.66191962
2481.68427537 2 4.62960722
48097.69821672 2 2.45115265
-48060.46858390 2 2.45082141
-1386.79918148 2 4.23753203
1350.57102634 2 6.12344921
Ag GEN 36 2
6
11.00000000 1 7.02317516
178.71479273 2 1.36779344
-206.54166000 2 1.85990342
92.80009949 2 2.70385827
-91.80009949 2 1.21149868
77.25492677 3 2.46247055
6
-19159.46923372 2 2.56205947
19178.09022506 2 3.28075183
-19956.12207989 2 3.86486918
12405.48540805 2 2.42437953
-8569.95659418 2 5.14643113
16121.59197935 2 4.79642660
6
-1054.66284551 2 1.92427691
1072.38275494 2 1.94184452
-1.15533162 2 27.95704514
88.48945385 2 1.25545336
-0.36033231 2 10.04954095
-85.97371403 2 1.49011553

292
data/pseudo/tn_df_sc Normal file
View File

@ -0,0 +1,292 @@
Sc GEN 12 2
8
9.00000000 1 18.44478556
-28.08765281 2 1.72227091
6.39250114 2 38.78217945
135.57316128 3 4.25767220
30.42990876 3 30.59237471
732.69856731 4 3.04901650
-839.18407578 4 3.26586693
306.02608763 4 19.55311974
8
-0.66275990 2 28.84167604
15.34001225 2 2.35022973
-2135.70086146 3 2.36887926
-272.32226474 3 1.53860208
2408.02312621 3 2.24659807
101.49528202 4 3.20659052
2308.19070504 4 1.65816906
-2392.74854053 4 1.70062176
8
253.56902450 2 1.38158346
-244.79525414 2 7.79906720
613.28437434 3 3.46268859
-167.40250936 3 1.44953060
-445.88186498 3 4.19986338
-558.92885001 4 2.84253773
-139.52186395 4 8.10103826
-860.39715397 4 5.29686620
Ti GEN 12 2
8
10.00000000 1 22.29649672
-72305.15340277 2 6.07562013
72279.39956641 2 7.08549167
-5.38004642 3 1.85317121
228.34501358 3 11.48488557
72347.84359974 4 6.58565089
-36.31015055 4 10.79509368
524.90430538 4 4.36759114
8
-1486.27686725 2 1.90199524
1504.05739312 2 3.17280244
-346.63236251 3 7.28185273
297.60206194 3 1.60782556
49.03030057 3 31.70876802
1363.17044217 4 2.57136209
173.13661454 4 15.10326471
408.87838151 4 10.51280239
8
770.58828172 2 4.79017059
-760.06500844 2 16.39428027
4131.47101858 3 2.73641831
-2.86068712 3 1.26533109
-4128.61033146 3 2.75566672
-4681.55429918 4 13.54811035
-216.64417046 4 3.18165696
-3871.27097394 4 7.38011991
V GEN 12 2
8
11.00000000 1 7.61152016
-2254.24090893 2 3.39807975
2224.02899636 2 6.97361870
-110446453.80565737 3 4.55862146
110446537.53237911 3 4.55862102
3279.23908558 4 3.96488312
110445429.80748074 4 5.79893896
-110440859.60674113 4 5.79892709
8
793493.20383269 2 1.90936932
-793472.27490442 2 1.96341714
-208.86387558 3 5.49944355
258.48298732 3 4.42141770
-49.61911175 3 2.27427679
-42873.55595686 4 1.93670396
-750668.26686351 4 13.81929388
750696.33209725 4 13.81951796
8
563.75098077 2 2.73920868
-551.25384718 2 8.34159772
565.60881231 3 6.86565518
-552.54712531 3 7.02672916
-13.06168700 3 1.72160118
766.15325384 4 5.21722741
-1341.96583800 4 3.64504781
-2478.29367021 4 6.45896159
Cr GEN 12 2
8
12.00000000 1 37.30558989
-31.65683900 2 2.72495980
-3.82112970 2 82.35078893
-1340.05228092 3 5.03605834
1787.71935961 3 8.49223479
1670.38275859 4 5.05934149
-297.67363866 4 11.22316422
-1773.64577915 4 12.78798168
8
1321.32584937 2 2.01494487
-1297.16280545 2 9.11769637
172456.79432585 3 2.74640213
-172130.54143941 3 2.73601029
-326.25288644 3 8.22966405
3318.19479259 4 8.93660753
-4964.77333719 4 4.18996691
-7518.15931266 4 8.08712175
8
426.08303476 2 2.13852920
-410.95463497 2 6.95873057
-26339.61341213 3 10.51865586
27348.01671881 3 10.59655900
-1008.40330668 3 12.57249470
-1190.97633771 4 3.81958382
-242.50982893 4 2.30397730
-515.04540222 4 8.50147041
Mn GEN 12 2
8
13.00000000 1 5.18371402
-578541.89058487 2 5.06065032
578503.38848415 2 6.70792867
-51913.84692424 3 6.17952209
51981.23520653 3 6.17539491
363344.02202434 4 6.42176078
267112.71548476 4 5.85884127
322304.52239107 4 5.30004030
8
1419.16815158 2 2.36735511
-1393.80593768 2 10.44777616
90835.30824196 3 3.38832573
-87236.54130341 3 3.33976449
-3598.76693855 3 4.59371397
-6244.54083570 4 4.53305698
1227.60592152 4 6.80451212
-6185.56255228 4 8.40561309
8
4024.75281098 2 2.94114594
-4009.68099577 2 7.86104996
6036.24229971 3 5.47734943
597.55987937 3 7.26632213
-6633.80217908 3 5.64966653
-8536.73955532 4 4.35053539
-2120.81538582 4 3.10976563
-9025.36229250 4 6.88076377
Fe GEN 12 2
8
14.00000000 1 5.12237041
-40.17016318 2 2.51511645
-1.31093574 2 68.88205922
233.53970769 3 8.04518971
-161.82652195 3 11.87602774
-1791.82033120 4 5.09693593
1599.45078669 4 4.72210640
1.03695301 4 1.70594204
8
26.70612465 2 1.98046097
0.57578912 2 129.99498266
3039.39666376 3 2.39996246
-3165.32503397 3 2.43500497
125.92837021 3 5.42607639
-291.65810402 4 8.00515516
391.88052787 4 5.38996549
27.51771082 4 21.57361672
8
624.99065580 2 2.73200743
-610.14663705 2 8.14205971
1017.89543597 3 6.81776145
-40.92293045 3 25.88593190
-976.97250552 3 5.88766735
-1433.26030940 4 3.94271278
-167.70300401 4 2.68547503
-1659.40792313 4 8.24853344
Co GEN 12 2
8
15.00000000 1 7.54679164
144513.79744165 2 3.67362404
-144558.25171900 2 4.84501436
107.53071842 3 2.40342575
5.67115611 3 26.17864786
-58433.23776581 4 3.80837544
-86187.09039425 4 4.51680318
-24877.11683436 4 4.40937071
8
95.23258759 2 2.24610518
-66.50913381 2 5.03497074
5039.10184384 3 3.22714612
106438.82887427 3 4.39051698
-111477.93071810 3 4.34028955
-3416.23892647 4 3.35420522
-108155.92422115 4 5.08283495
111451.19401338 4 5.04411598
8
595.60664332 2 4.48956443
-581.05689813 2 7.69628175
-1377.49199281 3 3.90883087
825.53641688 3 4.85597858
551.95557593 3 2.42496884
-403.44284159 4 2.48937518
360.79216631 4 7.08237042
-1755.31252545 4 7.01264199
Ni GEN 12 2
8
16.00000000 1 7.69817381
1050.11428773 2 7.53303210
-1144.28791364 2 25.60798551
13641.04856576 3 13.90272560
-13517.87778478 3 14.02243059
-99.93959073 4 5.40919366
-14590.22326277 4 19.39187326
-6702.20081903 4 10.04177364
8
-137324.04248861 2 3.00959957
137399.59146577 2 2.97820277
137895.50489379 3 3.20429852
-1036.38091066 3 8.22563766
-136859.12398313 3 3.17346613
1370.72380067 4 18.22958633
-904.80564965 4 6.63637638
-4552.45338879 4 4.01705177
8
-315.28909178 2 15.14825706
371.76324185 2 5.57172908
471.27416207 3 2.88437623
165.43855728 3 3.75784965
-636.71271936 3 3.41699124
-172.18113847 4 5.67830819
-148.24251004 4 2.70288433
-2384.29249546 4 8.91177457
Cu GEN 12 2
8
17.00000000 1 14.72121260
0.43564135 2 173.23217215
-51.26559465 2 2.58024469
3.82433122 3 80.09883693
246.43628291 3 9.08368916
6456.72306266 4 4.49885474
-6459.98303523 4 4.56436500
-53.55070822 4 20.14135032
8
-7.61322720 2 104.42478595
38.51618543 2 3.64199543
-12.00344193 3 52.46064977
288.99573247 3 4.33410703
-276.99229053 3 8.38373584
876.14551285 4 3.01347300
-1144.52462196 4 3.25680498
-386.35474053 4 59.52152812
8
142.97388030 2 48.08520852
-128.80933064 2 49.90034500
-186.15554307 3 11.18440029
180.45159943 3 5.04653753
5.70394364 3 85.01391269
101.90155258 4 3.06268644
-238.17133323 4 3.55821337
583.56858981 4 22.24622222
Zn GEN 12 2
8
18.00000000 1 16.25309578
-62.06001046 2 3.04359000
8.22443626 2 52.31604625
284.31836352 3 4.12635237
8.23736049 3 129.68855961
11442.99692797 4 7.94323624
-11664.25528103 4 7.74821809
462.64311342 4 34.44853266
8
140.30017448 2 3.16683649
-108.24959569 2 14.80839343
88.79372352 3 43.94225321
949.52154936 3 3.34122685
-1038.31527288 3 8.34153430
780.81282740 4 18.34782011
-1958.42831296 4 4.00418064
18.92059615 4 597.07325481
8
664.93623774 2 5.16678579
-651.12455824 2 11.88724380
930.96426186 3 7.96788974
-913.07841414 3 5.27302550
-17.88584772 3 127.63757255
3275.61040524 4 37.54266998
-3957.43240479 4 9.90068894
-3622.67126499 4 37.33250038

785
data/pseudo/tn_hf Normal file
View File

@ -0,0 +1,785 @@
H GEN 0 2
6
1.00000000 1 33.97261756
-5.73227574 2 41.31028903
-0.09126064 2 25.25940941
-20.89980944 2 22.55290552
21.89980945 2 32.44131356
33.97261756 3 21.12884239
6
-792.10375913 2 18.05333002
788.69064150 2 28.72271273
243.76232429 2 17.34000000
1971.45741618 2 20.31094085
-1795.56663560 2 22.08154655
-418.65661775 2 30.98799599
6
20.17177614 2 43.35000000
-21.74798121 2 30.58059209
81.48044293 2 43.35000000
-250.69197995 2 42.07548166
88.72115024 2 36.90496619
81.48044293 2 43.35000000
He GEN 0 2
6
2.00000000 1 20.98762121
-33.61186426 2 22.14709418
24.51669349 2 23.61790706
130.14113834 2 15.38761786
-129.14113834 2 14.22621787
41.97524242 3 12.59257273
6
1056.41263785 2 13.17618363
-1062.28560366 2 23.62254131
-463.87351954 2 12.04168890
-676.20404915 2 15.14280380
-595.21618656 2 19.81607243
1736.29130578 2 22.34342328
6
428.21432838 2 21.71652417
-430.31401911 2 12.32378638
7327.65357096 2 14.04426129
-7501.20178041 2 14.34477832
827.37705616 2 17.58948890
-652.83515208 2 21.22706329
Li GEN 2 2
6
1.00000000 1 0.78732101
-2.23995793 2 0.79224763
0.10336496 2 1.79622268
4.26591073 2 1.83637465
-3.26591073 2 1.91213904
0.78732101 3 0.79291624
6
256.06005883 2 1.78312879
-255.07112703 2 0.95553059
89.99417499 2 0.87617279
271.48958394 2 1.09621549
-180.35430387 2 1.43900642
-180.12948429 2 1.83085147
6
-6.15265886 2 1.51120608
4.70876577 2 0.76936375
-145.31681550 2 0.76874061
-238.21930857 2 0.99080928
219.67347903 2 0.80457655
164.85986038 2 1.07164892
Be GEN 2 2
6
2.00000000 1 1.20639978
-5.40210132 2 1.18425537
1.72285109 2 2.81826911
2.83477794 2 2.37513515
-1.83477794 2 2.82920954
2.41279956 3 1.18219335
6
-1045.56923435 2 2.59240549
1047.78889524 2 1.41686040
-1899.02207714 2 1.48536195
1398.02036098 2 1.70076266
-696.17508584 2 2.03898393
1198.17691383 2 2.57766021
6
630.77503458 2 1.84421403
-632.64959849 2 1.13419132
441.30858401 2 1.13393716
435.76647651 2 1.22419150
-353.48689426 2 1.39760436
-522.59133089 2 1.88595068
B GEN 2 2
6
3.00000000 1 2.72292969
-11.77602579 2 2.41356794
5.22133296 2 4.60628004
0.40709712 2 3.81569642
0.59290288 2 4.75281449
8.16878906 3 2.42655010
6
-259.65579181 2 2.54943794
264.77623108 2 4.54559309
79.19161122 2 2.15270531
-59.67150303 2 2.71820746
4276.39654293 2 3.54458188
-4294.91608677 2 3.65732479
6
236.40878048 2 3.85965228
-239.02058908 2 2.15130911
4065.68265375 2 2.50786619
-4354.92616892 2 2.58144728
782.08428825 2 3.14947869
-491.84514677 2 3.69136935
C GEN 2 2
6
4.00000000 1 6.85924392
-68.83281650 2 7.67473342
58.31001518 2 8.89832626
-5.23010100 2 4.63334409
6.23010100 2 5.40036758
27.43697568 3 6.78357071
6
15927.37261280 2 7.83879438
-15918.16480090 2 5.19308059
2266.75441213 2 7.53204263
199.75030501 2 9.76960112
15915.92435302 2 5.19521204
-18381.42723477 2 7.82847044
6
-153360.42295057 2 4.77965478
153356.81223147 2 7.75552602
-369415.66050006 2 7.39994991
152547.92039307 2 4.77641318
-50035.07991665 2 8.01352516
266903.80850142 2 7.30461659
N GEN 2 2
6
5.00000000 1 11.01983025
-745.67280403 2 7.70260962
729.30210222 2 7.83791198
-3.61639106 2 8.41784728
4.61639106 2 12.53426384
55.09915126 3 6.76845507
6
190.73305357 2 10.95092720
-176.25003778 2 7.48977970
138618.50426238 2 6.17989888
-156031.83911197 2 6.21713643
33624.66842989 2 6.84042808
-16210.33273520 2 7.23938652
6
-6963.78021671 2 6.00000000
6959.42174113 2 6.82157159
-1881.92821431 2 8.95497565
13576.39988827 2 6.21477468
-14307.35309373 2 6.69426410
2613.87687182 2 8.63240466
O GEN 2 2
6
6.00000000 1 8.86965578
-28.03502457 2 6.05347085
11.15565054 2 5.51487970
180.73182495 2 10.77996678
-179.73182495 2 10.23800841
53.21793471 3 7.90307811
6
-9301.89903913 2 7.28355994
9316.57793048 2 6.06026884
59864.04331135 2 10.82203807
-5153.55178109 2 5.75221581
-94673.29831259 2 10.51025188
39963.80850689 2 9.71187643
6
1682.75815189 2 6.93414347
-1694.05800561 2 5.70161443
848.47217112 2 5.90927487
-8787.11179775 2 8.69956320
7632.94108771 2 8.89513889
306.69604455 2 4.97067782
F GEN 2 2
6
7.00000000 1 16.52363418
-6.34751135 2 13.25777643
-15.15415075 2 18.76649923
-34.29784879 2 10.97564997
35.29784879 2 21.10568925
115.66543928 3 13.45706123
6
3851.10542697 2 18.85020393
-3832.40250429 2 12.48878559
-237433.87385812 2 13.23599298
4380.91891820 2 11.79852686
240164.95590264 2 13.28196243
-7110.99868861 2 17.38283172
6
-154.12048513 2 8.59949907
138.11297468 2 9.44224375
90.42851925 2 8.92886754
24.83173716 2 10.18592724
-424.59591732 2 14.47166344
310.33244840 2 16.45175456
Ne GEN 2 2
6
8.00000000 1 21.65168713
1792.30188007 2 14.45374325
-1826.14661180 2 14.11313946
24.26469360 2 14.10779016
-23.26469360 2 20.42281751
173.21349705 3 11.94458523
6
-3233.03788910 2 12.39056574
3263.09949012 2 20.60119535
1065.47298248 2 11.30677784
846.05067282 2 12.27737462
-34052.05079344 2 17.82669542
32141.52790433 2 17.34318949
6
64989.42116117 2 20.31242587
-65003.08394100 2 20.05277414
-486.55828399 2 12.87396775
2895.04182579 2 15.84533388
-261.91821074 2 19.42277681
-2145.56672184 2 23.82700477
K GEN 18 2
6
1.00000000 1 0.68724959
7665.13435390 2 0.62381187
-7668.26785841 2 0.59278246
-3877.60874288 2 0.63961163
3878.60874288 2 0.57860350
0.68724959 3 0.50008691
6
477943.00813868 2 0.60446875
-477941.36080643 2 0.55281419
-533027.54468668 2 0.57763214
644866.44840953 2 0.56624742
-347063.87255621 2 0.60823749
235225.96911606 2 0.54903924
6
5177368.01138896 2 0.56835236
-5177366.94506877 2 0.57395949
479730.23987439 2 0.65183506
1027151.48932830 2 0.60393420
-737636.25038898 2 0.55451546
-769244.47868615 2 0.64345811
Ca GEN 18 2
6
2.00000000 1 1.02097432
-10036.20006734 2 0.76570985
10030.67757963 2 0.83608195
-8136.00883920 2 0.84362927
8137.00883920 2 0.75729596
2.04194863 3 0.94514267
6
-34706.02643508 2 0.85912364
34710.12533681 2 0.50000000
860.68953329 2 0.79227941
33806.87817612 2 0.85997136
-34747.30927870 2 0.50004940
80.74228959 2 1.01833438
6
514.89542915 2 0.50045897
-511.93073005 2 0.57886998
-1374495660.24999190 2 0.50000000
687246875.87136328 2 0.50000000
595.96081232 2 0.56402502
687248189.41960287 2 0.50000000
Sc GEN 18 2
6
3.00000000 1 8.57059896
39.59298139 2 7.59719947
-67.37349200 2 5.06179469
3.54689568 2 11.85222547
-2.54689568 2 0.70815643
25.71179688 3 5.04858060
6
414.99811890 2 5.58945823
-389.30527335 2 5.93611719
8.74915776 2 0.56803113
-23.92388226 2 0.60868170
42.12589000 2 0.76957270
-25.95178014 2 1.21300456
6
87.05758924 2 1.12946939
-62.19670511 2 8.56362761
66.37833241 2 7.27494713
16.41391965 2 0.74327556
43.70031508 2 2.03252459
-125.49197853 2 1.19227023
Ti GEN 18 2
6
4.00000000 1 4.77516915
28.34758957 2 10.86929502
-63.21363466 2 5.37319310
5.17935660 2 6.86168513
-4.17935660 2 0.95669336
19.10067660 3 3.52162434
6
211.66189616 2 7.01854391
-179.82099411 2 1.03880358
-185.28466640 2 8.02474194
43.44334388 2 1.22490803
-44.06205312 2 0.73917909
186.90335758 2 0.89595855
6
49.26886952 2 4.65596397
-18.32131307 2 12.03001514
-5.50633295 2 2.16547114
-342.25486254 2 0.92182600
304.90681508 2 0.90099079
43.85505055 2 0.99684289
V GEN 18 2
6
5.00000000 1 7.54069430
35.58763613 2 13.63949328
-78.03044429 2 6.35551182
6.53716910 2 2.59423528
-5.53716910 2 1.16176108
37.70347150 3 6.00940761
6
194.57815114 2 8.18606241
-156.25972501 2 0.95585889
-162.29334861 2 9.81441300
-7.74379387 2 0.70017858
244.84040986 2 0.97854682
-73.80312462 2 1.14925292
6
58.91069981 2 5.48333809
-21.55840127 2 14.40777862
-10.12891199 2 2.12080402
2.52953175 2 0.69388688
109.28174657 2 1.01378564
-100.68144081 2 1.02780261
Cr GEN 18 2
6
6.00000000 1 5.86829616
-3.09900314 2 0.98487638
-44.94655388 2 6.96616660
135.46731129 2 13.59887742
-134.46731129 2 11.34882544
35.20977696 3 8.91110617
6
-526.12421414 2 1.73784849
568.24328209 2 32.55674074
-4019.88240027 2 29.55364033
495.64908693 2 1.64707294
3445.48735974 2 29.05037955
79.74580069 2 3.85284016
6
31.31844062 2 19.50625909
10.30743573 2 0.86978393
-81.88780266 2 15.20370471
461.22634080 2 10.28610919
1.00599253 2 29.84121604
-379.34381792 2 10.93761710
Mn GEN 18 2
6
7.00000000 1 15.05016398
76.91199595 2 15.84783194
-135.08366030 2 9.80426007
5.12036990 2 21.62193241
-4.12036990 2 1.26331891
105.35114786 3 9.24698903
6
4.45077705 2 37.07900996
46.93892122 2 10.09409180
-59.63952162 2 18.98557107
47.25376130 2 10.16267391
2270.38024432 2 0.79460121
-2256.99438460 2 0.79345224
6
43.65884288 2 39.18960573
6.58957965 2 5.88646925
273.41973132 2 12.35978155
-27.85882166 2 45.92825074
-255.64090683 2 15.10051906
11.08093098 2 0.96083847
Fe GEN 18 2
6
8.00000000 1 20.13246747
61.79343671 2 20.09868712
-128.55600523 2 10.70685691
4.84472314 2 28.79726611
-3.84472314 2 1.31374323
161.05973977 3 11.74858936
6
-20.21006220 2 30.42214774
78.68908034 2 10.18491881
-104.38370168 2 6.69228251
11879.61125830 2 2.98725076
4067.63536025 2 2.63900793
-15841.86182474 2 2.88538957
6
52.35701571 2 38.26448010
4.85142656 2 5.90250183
2169.08154283 2 14.09502191
-40.04038813 2 42.65213493
-2140.34005623 2 14.44188153
12.29991314 2 1.06050818
Co GEN 18 2
6
9.00000000 1 18.31609159
47.84627034 2 26.91264651
-123.98809879 2 11.91957078
5.09540361 2 38.50128360
-4.09540361 2 1.45636943
164.84482431 3 13.41744556
6
-22.55314559 2 34.07535172
88.75521276 2 10.45260699
-158.32924566 2 5.91087540
-53402.80058080 2 3.13684604
49767.17959800 2 3.16692544
3794.95155282 2 2.81533596
6
61.92019742 2 38.11279103
2.85881103 2 5.82898971
-387.27158530 2 15.59733227
-64.65478412 2 38.57519906
439.30094674 2 13.98109833
13.62664636 2 1.17046441
Ni GEN 18 2
6
10.00000000 1 19.84291404
-195.32353012 2 16.02128656
108.98533897 2 26.59513762
6.08469364 2 39.39261550
-5.08469364 2 1.73812596
198.42914037 3 16.63287860
6
636.14358475 2 21.00974643
-561.54325704 2 22.88188409
-146.65571659 2 11.08963477
1590.91833845 2 2.66405882
203.15470938 2 6.84512029
-1646.41568069 2 2.74451213
6
67.70992628 2 28.31556957
5.37743585 2 4.16521410
374.49405320 2 17.37825451
-389.83846114 2 21.96153313
1.91671522 2 49.74424984
14.42906054 2 1.27579002
Cu GEN 18 2
6
11.00000000 1 35.47715926
-18105.91023962 2 21.73013363
18011.23386368 2 21.83870561
6.01228206 2 18.42008793
-5.01228206 2 1.78198604
390.24875182 3 20.58922180
6
-51.41016015 2 31.92243640
131.47547623 2 14.07215286
-100490.54220540 2 4.21909683
20675.75763691 2 3.56801887
263590.56712535 2 4.06536588
-183774.78117039 2 3.92650866
6
68.62159615 2 31.47726702
10.70810140 2 4.95987737
233.01753836 2 17.95562228
-258.78181256 2 26.97191776
12.01106739 2 46.85069031
14.75422657 2 1.35614623
Zn GEN 18 2
6
12.00000000 1 26.60492300
-196.98442222 2 17.93401272
89.18558790 2 36.25784521
6.19159911 2 49.96784160
-5.19159911 2 1.99109193
319.25907600 3 19.77027094
6
-177.37971474 2 32.01501166
269.42130045 2 23.08836163
60361.29701582 2 4.67975974
1343973.13568915 2 5.29114502
-619902.07009680 2 5.11539109
-784431.36064381 2 5.38368747
6
46.22045015 2 19.08371294
43.98275320 2 50.00000000
103.59052598 2 16.88459979
-129.86700605 2 37.83300205
11.83058445 2 5.11918008
15.44716451 2 1.45112568
Ga GEN 28 2
6
3.00000000 1 1.29464779
1852.96920182 2 1.20541500
-1856.15440251 2 1.17879070
-513.51787928 2 1.21964580
514.51787928 2 1.12868888
3.88394338 3 1.06946118
6
-10.41248284 2 0.75266853
13.44253658 2 0.82344143
-163070.82529640 2 1.96346903
118782.06261627 2 1.90761481
72439.51450979 2 2.00432013
-28149.75180125 2 1.83309310
6
-55.43707314 2 0.98715132
55.68679311 2 1.18143237
95.35935510 2 1.24163917
-111.55606197 2 1.48647971
6.22134153 2 1.87957113
10.97737885 2 2.24689865
Ge GEN 28 2
6
4.00000000 1 0.64699203
1042.65966555 2 1.17600365
-1045.50742663 2 1.40672708
-522.21837337 2 1.06148136
523.21837337 2 1.52689039
2.58796812 3 0.70634661
6
298.52031462 2 1.37488700
-295.91758286 2 3.05395101
-65778.83466330 2 1.99750874
253302.61962618 2 2.10159773
25864.29161720 2 2.35028323
-213387.07659768 2 2.16152517
6
-1416.87913796 2 1.43279054
1416.49405157 2 1.27947333
-4677.12774504 2 1.39756889
6758.57740664 2 1.50728327
-2630.12555402 2 1.70834188
549.67778384 2 1.92912262
As GEN 28 2
6
5.00000000 1 1.90897798
-8.55267316 2 1.59326524
3.44617934 2 1.10844459
-8.94709126 2 1.02625257
9.94709126 2 1.90897549
9.54488990 3 1.18318262
6
-299.57003383 2 1.31601774
303.89084920 2 0.88992491
34018.91875930 2 0.82417957
-44808.38727678 2 0.87058735
19528.43031171 2 0.91644709
-8737.95845690 2 0.77833472
6
46094.50987530 2 1.90902784
-46093.10097169 2 1.56895782
-1934.82978262 2 1.41134047
-240427.05172601 2 1.84187044
36043.17172862 2 1.53235052
206319.71069040 2 1.81590910
Se GEN 28 2
6
6.00000000 1 1.73885845
-4868.76631948 2 3.10952817
4860.07291481 2 2.76656612
247376.94576273 2 2.93723435
-247375.94576273 2 2.93039894
10.43315069 3 1.80783830
6
43.48906338 2 1.54256367
-36.07303722 2 1.99876644
-1338.16209913 2 2.22244851
88855.15492433 2 3.01653570
-93322.17292948 2 3.00370283
5806.18068397 2 2.62760372
6
101.24952978 2 1.51703915
-96.89194467 2 1.50669503
-561.81915381 2 2.17759706
1474.30831735 2 2.47900419
-87533.83638244 2 3.02701983
86622.34849171 2 3.03071493
Br GEN 28 2
6
7.00000000 1 1.29861066
-8.22129971 2 1.15959643
0.21335410 2 2.29768788
-14617.16154553 2 2.88622041
14618.16154553 2 2.88664159
9.09027461 3 1.38987227
6
1993.56030565 2 1.99554365
-1988.14839885 2 2.18330258
62338.94920254 2 2.78298975
91516.94063906 2 2.50252605
-109846.25447802 2 2.70576408
-44008.63516555 2 2.38434210
6
17.36412726 2 1.29580803
-14.67327121 2 1.60078690
-6128.76923065 2 2.16344915
12563.02678529 2 2.26961184
757.63553722 2 2.83383736
-7190.89195704 2 2.41971949
Kr GEN 28 2
6
8.00000000 1 6.82429532
2245.94610147 2 4.82301962
-2257.24927570 2 3.38163452
1889.52842356 2 3.29088128
-1888.52842356 2 4.98656184
54.59436254 3 3.01373570
6
-2003.10975854 2 6.01573226
2010.79212346 2 4.07497664
13467772.94730707 2 4.47273823
-18464141.82809087 2 4.45030979
-2607955.84552628 2 4.28291762
7604325.72641131 2 4.35368575
6
-6512.57971257 2 5.33963561
6517.54562224 2 4.41831473
55170.14413687 2 3.66247372
-35314.20447418 2 3.56293692
-27094.88743738 2 3.99199621
7239.94695795 2 5.23539786
Al GEN 10 2
6
3.00000000 1 0.90167530
-12.07740634 2 1.08338853
6.60507677 2 2.07851308
-13877404.00590185 2 2.08053590
13877405.00590186 2 2.08053570
2.70502591 3 0.92748596
6
-41.26842670 2 2.04866185
45.70193781 2 1.11866688
2946.69575922 2 1.71721106
-376.01922297 2 1.36753958
4331.41613799 2 1.93292012
-6901.09265568 2 1.86705782
6
504.79904464 2 1.88548919
-502.69536383 2 1.42616967
-769.46860271 2 1.80548694
-17.66088618 2 0.95520911
101.43853505 2 1.20112583
686.69150206 2 1.52824179
Si GEN 10 2
6
4.00000000 1 2.54461774
-2902.58084906 2 2.24978528
2895.18838752 2 2.53789008
7161.72254279 2 2.34887222
-7160.72254279 2 2.46336277
10.17847098 3 1.52421025
6
4.24352962 2 1.08064949
2.05989979 2 1.33341749
88608.14855737 2 2.39993059
-849.93508619 2 1.92845396
-1434647.87047626 2 2.35634772
1346890.65714548 2 2.35320332
6
-15264.86061936 2 1.82998100
15267.99758945 2 1.91566514
-0.49522434 2 1.35066217
2807.17037795 2 2.16756956
6912.45723497 2 1.79762600
-9718.13169060 2 2.03990309
P GEN 10 2
6
5.00000000 1 2.20104239
-14571.76154266 2 3.30954781
14561.08785293 2 3.65491917
-21023.88213100 2 3.60582863
21024.88213100 2 3.36814532
11.00521195 3 2.06883762
6
-214.99423753 2 3.00175595
224.31212541 2 1.90508764
-1320.42895216 2 2.23252373
2262.27394007 2 2.56842585
-5217.11058123 2 3.22957222
4276.26614237 2 3.32169865
6
-4655.41288683 2 1.51251059
4660.80718311 2 1.51289861
-994.25816078 2 3.31761981
-19.30793578 2 2.04639527
311.57919748 2 3.70626860
702.98798215 2 3.09154453
S GEN 10 2
6
6.00000000 1 3.76431332
518.21506704 2 2.91975646
-532.35656437 2 2.26777538
14394.84387811 2 2.49556645
-14393.84387811 2 2.51698479
22.58587994 3 2.71241239
6
-104.19902150 2 4.55895180
116.57081427 2 2.10503756
-994.81335242 2 2.63814508
2203.13414043 2 3.11140569
-1617.61176296 2 3.62963239
410.29160018 2 4.55921172
6
723.09548214 2 4.48128068
-715.46568241 2 3.35956681
9063.41201304 2 3.83857196
-16.38228027 2 1.92699416
44.06704522 2 2.30670170
-9090.09577098 2 3.92706305
Cl GEN 10 2
6
7.00000000 1 4.77392870
719885.76609499 2 4.74019033
-719903.82223984 2 4.74189768
-37102.89380181 2 4.67979490
37103.89380181 2 4.71510215
33.41750090 3 3.29732864
6
959.05010082 2 5.01134618
-943.54843009 2 3.64529189
-6456.16063099 2 4.20510279
637.70704529 2 2.74283267
-1479.66774202 2 3.00605599
7299.12201388 2 3.90198120
6
-121.63220275 2 3.86324469
131.70125226 2 3.08695111
5447.27282828 2 5.92092153
-52.94814165 2 2.63467524
559.83762330 2 5.08437179
-5953.16139883 2 5.86183616
Ar GEN 10 2
6
8.00000000 1 5.17746158
-76.72264736 2 5.90884243
56.16280755 2 3.53735685
-660.63282107 2 4.53072721
661.63282107 2 4.90879705
41.41969264 3 3.95156133
6
496.48392385 2 3.21092458
-479.29969508 2 3.39224537
-12086.26924659 2 4.28061928
37151.97923364 2 4.62803105
496310.90908097 2 5.10487541
-521375.61810527 2 5.08995306
6
-1901.02320099 2 5.53714820
1911.87432982 2 4.52372637
-127.53875733 2 2.45115265
198.78501467 2 2.62001527
-976.26297293 2 3.97593759
906.01814260 2 6.12659776

BIN
data/qp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -25,7 +25,7 @@ import sys, os
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.pngmath', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

View File

@ -5,7 +5,8 @@ QP_ROOT=$PWD
cd -
# Normal installation
PACKAGES="core cryptokit ocamlfind sexplib ZMQ"
PACKAGES="core cryptokit zarith ocamlfind sexplib ZMQ"
#ppx_sexp_conv
# Needed for ZeroMQ
export C_INCLUDE_PATH="${QP_ROOT}"/lib:"${C_INCLUDE_PATH}"

View File

@ -15,14 +15,14 @@ function _install()
./configure --without-libsodium || exit 1
make -j 8 || exit 1
rm -f -- "${QP_ROOT}"/lib/libzmq.a "${QP_ROOT}"/lib/libzmq.so "${QP_ROOT}"/lib/libzmq.so.?
# cp .libs/libzmq.a "${QP_ROOT}"/lib
# cp .libs/libzmq.so "${QP_ROOT}"/lib/libzmq.so.5
cp src/.libs/libzmq.a "${QP_ROOT}"/lib
cp src/.libs/libzmq.so "${QP_ROOT}"/lib/libzmq.so.4
cp .libs/libzmq.a "${QP_ROOT}"/lib
cp .libs/libzmq.so "${QP_ROOT}"/lib/libzmq.so.5
# cp src/.libs/libzmq.a "${QP_ROOT}"/lib
# cp src/.libs/libzmq.so "${QP_ROOT}"/lib/libzmq.so.4
cp include/{zmq.h,zmq_utils.h} "${QP_ROOT}"/lib
cd "${QP_ROOT}"/lib
# ln -s libzmq.so.5 libzmq.so
ln -s libzmq.so.4 libzmq.so
ln -s libzmq.so.5 libzmq.so
# ln -s libzmq.so.4 libzmq.so
cd ${ORIG}
return 0
}

View File

@ -42,7 +42,7 @@ end = struct
assert (String.is_prefix ~prefix:"inproc://" x);
x
let create name =
Printf.sprintf "ipc://%s" name
Printf.sprintf "inproc://%s" name
let to_string x = x
end

View File

@ -1,4 +1,4 @@
open Core.Std;;
open Core.Std
exception AtomError of string
@ -27,12 +27,18 @@ let of_string ~units s =
coord = Point3d.of_string ~units (String.concat [x; y; z] ~sep:" ")
}
| _ -> raise (AtomError s)
;;
let to_string ~units a =
[ Element.to_string a.element ;
Charge.to_string a.charge ;
Point3d.to_string ~units a.coord ]
|> String.concat ~sep:" "
;;
let to_xyz a =
Printf.sprintf "%-3s %s"
(Element.to_string a.element)
(Point3d.to_string ~units:Units.Angstrom a.coord)

View File

@ -7,3 +7,4 @@ val sexp_of_t : t -> Sexplib.Sexp.t
val of_string : units:Units.units -> string -> t
val to_string : units:Units.units -> t -> string
val to_xyz : t -> string

View File

@ -35,11 +35,11 @@ let read_element in_channel at_number element =
read in_channel at_number
let to_string b =
let to_string_general ~fmt ~atom_sep b =
let new_nucleus n =
Printf.sprintf "Atom %d" n
in
let rec do_work accu current_nucleus = function
| [] -> List.rev accu
| (g,n)::tail ->
@ -47,15 +47,27 @@ let to_string b =
in
let accu =
if (n <> current_nucleus) then
(new_nucleus n)::""::accu
(new_nucleus n)::atom_sep::accu
else
accu
in
do_work ((Gto.to_string g)::accu) n tail
do_work ((Gto.to_string ~fmt g)::accu) n tail
in
do_work [new_nucleus 1] 1 b
|> String.concat ~sep:"\n"
let to_string_gamess =
to_string_general ~fmt:Gto.Gamess ~atom_sep:""
let to_string_gaussian b =
String.concat ~sep:"\n"
[ to_string_general ~fmt:Gto.Gaussian ~atom_sep:"****" b ; "****" ]
let to_string ?(fmt=Gto.Gamess) =
match fmt with
| Gto.Gamess -> to_string_gamess
| Gto.Gaussian -> to_string_gaussian
include To_md5
let to_md5 = to_md5 sexp_of_t

View File

@ -14,7 +14,7 @@ val read_element :
in_channel -> Nucl_number.t -> Element.t -> (Gto.t * Nucl_number.t) list
(** Convert the basis to a string *)
val to_string : (Gto.t * Nucl_number.t) list -> string
val to_string : ?fmt:Gto.fmt -> (Gto.t * Nucl_number.t) list -> string
(** Convert the basis to an MD5 hash *)
val to_md5 : (Gto.t * Nucl_number.t) list -> MD5.t

View File

@ -9,6 +9,7 @@ type t =
|Li|Be |B |C |N |O |F |Ne
|Na|Mg |Al|Si|P |S |Cl|Ar
|K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr
|Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe
with sexp
let of_string x =
@ -50,6 +51,24 @@ let of_string x =
| "Se" | "Selenium" -> Se
| "Br" | "Bromine" -> Br
| "Kr" | "Krypton" -> Kr
| "Rb" | "Rubidium" -> Rb
| "Sr" | "Strontium" -> Sr
| "Y" | "Yttrium" -> Y
| "Zr" | "Zirconium" -> Zr
| "Nb" | "Niobium" -> Nb
| "Mo" | "Molybdenum" -> Mo
| "Tc" | "Technetium" -> Tc
| "Ru" | "Ruthenium" -> Ru
| "Rh" | "Rhodium" -> Rh
| "Pd" | "Palladium" -> Pd
| "Ag" | "Silver" -> Ag
| "Cd" | "Cadmium" -> Cd
| "In" | "Indium" -> In
| "Sn" | "Tin" -> Sn
| "Sb" | "Antimony" -> Sb
| "Te" | "Tellurium" -> Te
| "I" | "Iodine" -> I
| "Xe" | "Xenon" -> Xe
| x -> raise (ElementError ("Element "^x^" unknown"))
@ -91,6 +110,24 @@ let to_string = function
| Se -> "Se"
| Br -> "Br"
| Kr -> "Kr"
| Rb -> "Rb"
| Sr -> "Sr"
| Y -> "Y"
| Zr -> "Zr"
| Nb -> "Nb"
| Mo -> "Mo"
| Tc -> "Tc"
| Ru -> "Ru"
| Rh -> "Rh"
| Pd -> "Pd"
| Ag -> "Ag"
| Cd -> "Cd"
| In -> "In"
| Sn -> "Sn"
| Sb -> "Sb"
| Te -> "Te"
| I -> "I"
| Xe -> "Xe"
let to_long_string = function
@ -131,6 +168,24 @@ let to_long_string = function
| Se -> "Selenium"
| Br -> "Bromine"
| Kr -> "Krypton"
| Rb -> "Rubidium"
| Sr -> "Strontium"
| Y -> "Yttrium"
| Zr -> "Zirconium"
| Nb -> "Niobium"
| Mo -> "Molybdenum"
| Tc -> "Technetium"
| Ru -> "Ruthenium"
| Rh -> "Rhodium"
| Pd -> "Palladium"
| Ag -> "Silver"
| Cd -> "Cadmium"
| In -> "Indium"
| Sn -> "Tin"
| Sb -> "Antimony"
| Te -> "Tellurium"
| I -> "Iodine"
| Xe -> "Xenon"
let to_charge c =
@ -172,6 +227,24 @@ let to_charge c =
| Se -> 34
| Br -> 35
| Kr -> 36
| Rb -> 37
| Sr -> 38
| Y -> 39
| Zr -> 40
| Nb -> 41
| Mo -> 42
| Tc -> 43
| Ru -> 44
| Rh -> 45
| Pd -> 46
| Ag -> 47
| Cd -> 48
| In -> 49
| Sn -> 50
| Sb -> 51
| Te -> 52
| I -> 53
| Xe -> 54
in Charge.of_int result
@ -213,6 +286,24 @@ let of_charge c = match (Charge.to_int c) with
| 34 -> Se
| 35 -> Br
| 36 -> Kr
| 37 -> Rb
| 38 -> Sr
| 39 -> Y
| 40 -> Zr
| 41 -> Nb
| 42 -> Mo
| 43 -> Tc
| 44 -> Ru
| 45 -> Rh
| 46 -> Pd
| 47 -> Ag
| 48 -> Cd
| 49 -> In
| 50 -> Sn
| 51 -> Sb
| 52 -> Te
| 53 -> I
| 54 -> Xe
| x -> raise (ElementError ("Element of charge "^(string_of_int x)^" unknown"))
@ -255,6 +346,24 @@ let covalent_radius x =
| Se -> 0.70
| Br -> 1.24
| Kr -> 1.91
| Rb -> 2.20
| Sr -> 1.95
| Y -> 1.90
| Zr -> 1.75
| Nb -> 1.64
| Mo -> 1.54
| Tc -> 1.47
| Ru -> 1.46
| Rh -> 1.42
| Pd -> 1.39
| Ag -> 1.45
| Cd -> 1.44
| In -> 1.42
| Sn -> 1.39
| Sb -> 1.39
| Te -> 1.38
| I -> 1.39
| Xe -> 1.40
in
Units.angstrom_to_bohr *. (result x)
|> Positive_float.of_float
@ -298,6 +407,24 @@ let vdw_radius x =
| Se -> 1.70
| Br -> 2.10
| Kr -> 1.70
| Rb -> 3.03
| Sr -> 2.49
| Y -> 0.
| Zr -> 0.
| Nb -> 0.
| Mo -> 0.
| Tc -> 0.
| Ru -> 0.
| Rh -> 0.
| Pd -> 1.63
| Ag -> 1.72
| Cd -> 1.58
| In -> 1.93
| Sn -> 2.17
| Sb -> 2.06
| Te -> 2.06
| I -> 1.98
| Xe -> 2.16
in
Units.angstrom_to_bohr *. (result x)
|> Positive_float.of_float
@ -341,6 +468,24 @@ let mass x =
| Se -> 78.96
| Br -> 79.904
| Kr -> 83.80
| Rb -> 85.4678
| Sr -> 87.62
| Y -> 88.90584
| Zr -> 91.224
| Nb -> 92.90637
| Mo -> 95.95
| Tc -> 98.
| Ru -> 101.07
| Rh -> 102.90550
| Pd -> 106.42
| Ag -> 107.8682
| Cd -> 112.414
| In -> 114.818
| Sn -> 118.710
| Sb -> 121.760
| Te -> 127.60
| I -> 126.90447
| Xe -> 131.293
in
result x
|> Positive_float.of_float

View File

@ -6,6 +6,7 @@ type t =
|Li|Be |B |C |N |O |F |Ne
|Na|Mg |Al|Si|P |S |Cl|Ar
|K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr
|Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe
with sexp
(** String conversion functions *)
@ -18,3 +19,4 @@ val to_charge : t -> Charge.t
val of_charge : Charge.t -> t
val covalent_radius : t -> Qptypes.Positive_float.t
val vdw_radius : t -> Qptypes.Positive_float.t
val mass : t -> Qptypes.Positive_float.t

View File

@ -4,6 +4,10 @@ open Qptypes
exception GTO_Read_Failure of string
exception End_Of_Basis
type fmt =
| Gamess
| Gaussian
type t =
{ sym : Symmetry.t ;
lc : ((Primitive.t * AO_coef.t) list)
@ -68,8 +72,8 @@ let read_one in_channel =
(** Transform the gto to a string *)
let to_string { sym = sym ; lc = lc } =
(** Write the GTO in Gamess format *)
let to_string_gamess { sym = sym ; lc = lc } =
let result =
Printf.sprintf "%s %3d" (Symmetry.to_string sym) (List.length lc)
in
@ -88,3 +92,30 @@ let to_string { sym = sym ; lc = lc } =
|> String.concat ~sep:"\n"
(** Write the GTO in Gaussian format *)
let to_string_gaussian { sym = sym ; lc = lc } =
let result =
Printf.sprintf "%s %3d 1.00" (Symmetry.to_string sym) (List.length lc)
in
let rec do_work accu i = function
| [] -> List.rev accu
| (p,c)::tail ->
let p = AO_expo.to_float p.Primitive.expo
and c = AO_coef.to_float c
in
let result =
Printf.sprintf "%15.7f %15.7f" p c
in
do_work (result::accu) (i+1) tail
in
(do_work [result] 1 lc)
|> String.concat ~sep:"\n"
(** Transform the gto to a string *)
let to_string ?(fmt=Gamess) =
match fmt with
| Gamess -> to_string_gamess
| Gaussian -> to_string_gaussian

View File

@ -1,5 +1,9 @@
exception GTO_Read_Failure of string
exception End_Of_Basis
type fmt =
| Gamess
| Gaussian
type t =
{ sym : Symmetry.t ;
lc : (Primitive.t * Qptypes.AO_coef.t) list;
@ -13,4 +17,4 @@ val of_prim_coef_list :
val read_one : in_channel -> t
(** Convert to string for printing *)
val to_string : t -> string
val to_string : ?fmt:fmt -> t -> string

View File

@ -1,26 +1,22 @@
open Core.Std
module Id : sig
type t
val of_int : int -> t
val to_int : t -> int
val of_string : string -> t
val to_string : t -> string
val increment : t -> t
val decrement : t -> t
end
= struct
module Id = struct
type t = int
let of_int x =
assert (x>0); x
let to_int x = x
let of_string x =
Int.of_string x
int_of_string x
|> of_int
let to_string x =
Int.to_string x
string_of_int x
let increment x = x + 1
let decrement x = x - 1
let compare = compare
end
module Task = struct

23
ocaml/Id.mli Normal file
View File

@ -0,0 +1,23 @@
module Id :
sig
type t
val of_int : int -> t
val to_int : t -> int
val of_string : string -> t
val to_string : t -> string
val increment : t -> t
val decrement : t -> t
val compare : t -> t -> int
end
module Task :
sig
include (module type of Id)
end
module Client :
sig
include (module type of Id)
end

View File

@ -17,6 +17,7 @@ module Ao_basis : sig
;;
val read : unit -> t option
val to_string : t -> string
val to_basis : t -> Basis.t
val write : t -> unit
val to_md5 : t -> MD5.t
val to_rst : t -> Rst_string.t

View File

@ -93,23 +93,6 @@ end = struct
;;
let read_n_states_diag () =
if not (Ezfio.has_determinants_n_states_diag ()) then
read_n_states ()
|> States_number.to_int
|> Ezfio.set_determinants_n_states_diag
;
Ezfio.get_determinants_n_states_diag ()
|> States_number.of_int
;;
let write_n_states_diag ~n_states n =
let n_states = States_number.to_int n_states
and n = States_number.to_int n
in
Ezfio.set_determinants_n_states_diag (max n_states n)
;;
let read_expected_s2 () =
if not (Ezfio.has_determinants_expected_s2 ()) then
begin

View File

@ -13,6 +13,7 @@ module Nuclei : sig
val read : unit -> t option
val write : t -> unit
val to_string : t -> string
val to_atom_list : t -> Atom.t list
val to_rst : t -> Rst_string.t
val of_rst : Rst_string.t -> t option
end = struct
@ -134,6 +135,22 @@ end = struct
;;
let to_atom_list b =
let rec loop accu (coord, charge, label) = function
| -1 -> accu
| i ->
let atom =
{ Atom.element = label.(i) ;
Atom.charge = charge.(i) ;
Atom.coord = coord.(i) ;
}
in
loop (atom::accu) (coord, charge, label) (i-1)
in
loop [] (b.nucl_coord, b.nucl_charge, b.nucl_label)
( (Nucl_number.to_int b.nucl_num) - 1)
;;
let to_string b =
Printf.sprintf "
nucl_num = %s

View File

@ -79,7 +79,7 @@ git:
${QP_ROOT}/install/EZFIO/Ocaml/ezfio.ml:
$(NINJA) -C ${QP_ROOT}/install/EZFIO
Input_auto_generated.ml qp_edit.ml:
Input_auto_generated.ml qp_edit.ml: $(filter-out Input_auto_generated.ml, $(wildcard Input_*.ml))
ei_handler.py ocaml_global
clean:

View File

@ -248,16 +248,20 @@ end
(** GetTaskReply : Reply to the GetTask message *)
module GetTaskReply_msg : sig
type t
val create : task_id:Id.Task.t -> task:string -> t
val create : task_id:Id.Task.t option -> task:string option -> t
val to_string : t -> string
end = struct
type t =
{ task_id: Id.Task.t ;
task : string ;
{ task_id: Id.Task.t option ;
task : string option ;
}
let create ~task_id ~task = { task_id ; task }
let to_string x =
Printf.sprintf "get_task_reply %d %s" (Id.Task.to_int x.task_id) x.task
match x.task_id, x.task with
| Some task_id, Some task ->
Printf.sprintf "get_task_reply %d %s" (Id.Task.to_int task_id) task
| _ ->
Printf.sprintf "get_task_reply 0"
end
(** GetPsi : get the current variational wave function *)
@ -288,13 +292,14 @@ module Psi : sig
n_det_selectors : Strictly_positive_int.t option;
psi_det : string ;
psi_coef : string ;
energy : string;
}
val create : n_state:Strictly_positive_int.t
-> n_det:Strictly_positive_int.t
-> psi_det_size:Strictly_positive_int.t
-> n_det_generators:Strictly_positive_int.t option
-> n_det_selectors:Strictly_positive_int.t option
-> psi_det:string -> psi_coef:string -> t
-> psi_det:string -> psi_coef:string -> energy:string -> t
end = struct
type t =
{
@ -305,14 +310,16 @@ end = struct
n_det_selectors : Strictly_positive_int.t option;
psi_det : string ;
psi_coef : string ;
energy : string ;
}
let create ~n_state ~n_det ~psi_det_size
~n_det_generators ~n_det_selectors ~psi_det ~psi_coef =
~n_det_generators ~n_det_selectors ~psi_det ~psi_coef
~energy =
assert (Strictly_positive_int.to_int n_det <=
Strictly_positive_int.to_int psi_det_size );
{ n_state; n_det ; psi_det_size ;
n_det_generators ; n_det_selectors ;
psi_det ; psi_coef }
psi_det ; psi_coef ; energy }
end
(** GetPsiReply_msg : Reply to the GetPsi message *)
@ -329,19 +336,6 @@ end = struct
psi : Psi.t }
let create ~client_id ~psi =
{ client_id ; psi }
let to_string_list x =
let g, s =
match x.psi.Psi.n_det_generators, x.psi.Psi.n_det_selectors with
| Some g, Some s -> Strictly_positive_int.to_int g, Strictly_positive_int.to_int s
| _ -> -1, -1
in
[ Printf.sprintf "get_psi_reply %d %d %d %d %d %d"
(Id.Client.to_int x.client_id)
(Strictly_positive_int.to_int x.psi.Psi.n_state)
(Strictly_positive_int.to_int x.psi.Psi.n_det)
(Strictly_positive_int.to_int x.psi.Psi.psi_det_size)
g s ;
x.psi.Psi.psi_det ; x.psi.Psi.psi_coef ]
let to_string x =
let g, s =
match x.psi.Psi.n_det_generators, x.psi.Psi.n_det_selectors with
@ -354,6 +348,9 @@ end = struct
(Strictly_positive_int.to_int x.psi.Psi.n_det)
(Strictly_positive_int.to_int x.psi.Psi.psi_det_size)
g s
let to_string_list x =
[ to_string x ;
x.psi.Psi.psi_det ; x.psi.Psi.psi_coef ; x.psi.Psi.energy ]
end
@ -375,7 +372,8 @@ module PutPsi_msg : sig
psi_det:string option ->
psi_coef:string option ->
n_det_generators: string option ->
n_det_selectors:string option -> t
n_det_selectors:string option ->
energy:string option -> t
val to_string_list : t -> string list
val to_string : t -> string
end = struct
@ -388,7 +386,7 @@ end = struct
n_det_selectors : Strictly_positive_int.t option;
psi : Psi.t option }
let create ~client_id ~n_state ~n_det ~psi_det_size ~psi_det ~psi_coef
~n_det_generators ~n_det_selectors =
~n_det_generators ~n_det_selectors ~energy =
let n_state, n_det, psi_det_size =
Int.of_string n_state
|> Strictly_positive_int.of_int ,
@ -407,45 +405,19 @@ end = struct
| _ -> None, None
in
let psi =
match (psi_det, psi_coef) with
| (Some psi_det, Some psi_coef) ->
match (psi_det, psi_coef, energy) with
| (Some psi_det, Some psi_coef, Some energy) ->
Some (Psi.create ~n_state ~n_det ~psi_det_size ~psi_det
~psi_coef ~n_det_generators ~n_det_selectors)
~psi_coef ~n_det_generators ~n_det_selectors ~energy)
| _ -> None
in
{ client_id = Id.Client.of_string client_id ;
n_state ; n_det ; psi_det_size ; n_det_generators ;
n_det_selectors ; psi }
let to_string_list x =
match x.n_det_generators, x.n_det_selectors, x.psi with
| Some g, Some s, Some psi ->
[ Printf.sprintf "put_psi %d %d %d %d %d %d"
(Id.Client.to_int x.client_id)
(Strictly_positive_int.to_int x.n_state)
(Strictly_positive_int.to_int x.n_det)
(Strictly_positive_int.to_int x.psi_det_size)
(Strictly_positive_int.to_int g)
(Strictly_positive_int.to_int s) ;
psi.Psi.psi_det ; psi.Psi.psi_coef ]
| Some g, Some s, None ->
[ Printf.sprintf "put_psi %d %d %d %d %d %d"
(Id.Client.to_int x.client_id)
(Strictly_positive_int.to_int x.n_state)
(Strictly_positive_int.to_int x.n_det)
(Strictly_positive_int.to_int x.psi_det_size)
(Strictly_positive_int.to_int g)
(Strictly_positive_int.to_int s) ;
"None" ; "None" ]
| _ ->
[ Printf.sprintf "put_psi %d %d %d %d -1 -1"
(Id.Client.to_int x.client_id)
(Strictly_positive_int.to_int x.n_state)
(Strictly_positive_int.to_int x.n_det)
(Strictly_positive_int.to_int x.psi_det_size) ;
"None" ; "None" ]
let to_string x =
match x.n_det_generators, x.n_det_selectors, x.psi with
| Some g, Some s, Some psi ->
match x.n_det_generators, x.n_det_selectors with
| Some g, Some s ->
Printf.sprintf "put_psi %d %d %d %d %d %d"
(Id.Client.to_int x.client_id)
(Strictly_positive_int.to_int x.n_state)
@ -453,21 +425,20 @@ end = struct
(Strictly_positive_int.to_int x.psi_det_size)
(Strictly_positive_int.to_int g)
(Strictly_positive_int.to_int s)
| Some g, Some s, None ->
Printf.sprintf "put_psi %d %d %d %d %d %d"
(Id.Client.to_int x.client_id)
(Strictly_positive_int.to_int x.n_state)
(Strictly_positive_int.to_int x.n_det)
(Strictly_positive_int.to_int x.psi_det_size)
(Strictly_positive_int.to_int g)
(Strictly_positive_int.to_int s)
| _, _, _ ->
| _, _ ->
Printf.sprintf "put_psi %d %d %d %d %d %d"
(Id.Client.to_int x.client_id)
(Strictly_positive_int.to_int x.n_state)
(Strictly_positive_int.to_int x.n_det)
(Strictly_positive_int.to_int x.psi_det_size)
(-1) (-1)
let to_string_list x =
match x.psi with
| Some psi ->
[ to_string x ; psi.Psi.psi_det ; psi.Psi.psi_coef ; psi.Psi.energy ]
| None ->
[ to_string x ; "None" ; "None" ; "None" ]
end
(** PutPsiReply_msg : Reply to the PutPsi message *)
@ -574,6 +545,9 @@ type t =
| Terminate of Terminate_msg.t
| Ok of Ok_msg.t
| Error of Error_msg.t
| SetStopped
| SetWaiting
| SetRunning
let of_string s =
@ -606,14 +580,15 @@ let of_string s =
| "put_psi" :: client_id :: n_state :: n_det :: psi_det_size :: n_det_generators :: n_det_selectors :: [] ->
PutPsi (PutPsi_msg.create ~client_id ~n_state ~n_det ~psi_det_size
~n_det_generators:(Some n_det_generators) ~n_det_selectors:(Some n_det_selectors)
~psi_det:None ~psi_coef:None )
~psi_det:None ~psi_coef:None ~energy:None )
| "put_psi" :: client_id :: n_state :: n_det :: psi_det_size :: [] ->
PutPsi (PutPsi_msg.create ~client_id ~n_state ~n_det ~psi_det_size ~n_det_generators:None
~n_det_selectors:None ~psi_det:None ~psi_coef:None )
| "ok" :: [] ->
Ok (Ok_msg.create ())
| "error" :: rest ->
Error (Error_msg.create (String.concat ~sep:" " rest))
~n_det_selectors:None ~psi_det:None ~psi_coef:None ~energy:None)
| "ok" :: [] -> Ok (Ok_msg.create ())
| "error" :: rest -> Error (Error_msg.create (String.concat ~sep:" " rest))
| "set_stopped" :: [] -> SetStopped
| "set_running" :: [] -> SetRunning
| "set_waiting" :: [] -> SetWaiting
| _ -> failwith "Message not understood"
@ -638,6 +613,9 @@ let to_string = function
| Error x -> Error_msg.to_string x
| PutPsi x -> PutPsi_msg.to_string x
| GetPsiReply x -> GetPsiReply_msg.to_string x
| SetStopped -> "set_stopped"
| SetRunning -> "set_running"
| SetWaiting -> "set_waiting"
let to_string_list = function

View File

@ -85,7 +85,7 @@ let name m =
String.concat (result)
let to_string m =
let to_string_general ~f m =
let { nuclei ; elec_alpha ; elec_beta } = m
in
let n =
@ -94,10 +94,15 @@ let to_string m =
let title =
name m
in
[ Int.to_string n ; title ] @
(List.map ~f:(fun x -> Atom.to_string Units.Angstrom x) nuclei)
[ Int.to_string n ; title ] @ (List.map ~f nuclei)
|> String.concat ~sep:"\n"
let to_string =
to_string_general ~f:(fun x -> Atom.to_string Units.Angstrom x)
let to_xyz =
to_string_general ~f:Atom.to_xyz
let of_xyz_string
?(charge=(Charge.of_int 0)) ?(multiplicity=(Multiplicity.of_int 1))
@ -142,10 +147,28 @@ let of_xyz_file
let (_,buffer) = In_channel.read_all filename
|> String.lsplit2_exn ~on:'\n' in
let (_,buffer) = String.lsplit2_exn buffer ~on:'\n' in
of_xyz_string ~charge:charge ~multiplicity:multiplicity
~units:units buffer
of_xyz_string ~charge ~multiplicity ~units buffer
let of_zmt_file
?(charge=(Charge.of_int 0)) ?(multiplicity=(Multiplicity.of_int 1))
?(units=Units.Angstrom)
filename =
In_channel.read_all filename
|> Zmatrix.of_string
|> Zmatrix.to_xyz_string
|> of_xyz_string ~charge ~multiplicity ~units
let of_file
?(charge=(Charge.of_int 0)) ?(multiplicity=(Multiplicity.of_int 1))
?(units=Units.Angstrom)
filename =
try
of_xyz_file ~charge ~multiplicity ~units filename
with _ ->
of_zmt_file ~charge ~multiplicity ~units filename
let distance_matrix molecule =
let coord =

View File

@ -20,6 +20,7 @@ val name : t -> string
(** Conversion for printing *)
val to_string : t -> string
val to_xyz : t -> string
(** Creates a molecule from an xyz file *)
@ -28,6 +29,18 @@ val of_xyz_file :
?multiplicity:Multiplicity.t ->
?units:Units.units -> string -> t
(** Creates a molecule from a zmt file *)
val of_zmt_file :
?charge:Charge.t ->
?multiplicity:Multiplicity.t ->
?units:Units.units -> string -> t
(** Creates a molecule from a file (xyz or zmt) *)
val of_file :
?charge:Charge.t ->
?multiplicity:Multiplicity.t ->
?units:Units.units -> string -> t
(** Creates a molecule from an xyz file in a string *)
val of_xyz_string :
?charge:Charge.t ->

View File

@ -14,13 +14,13 @@ type t =
let init ?(bar_length=20) ?(start_value=0.) ?(end_value=1.) ~title =
{ title ; start_value ; end_value ; bar_length ; cur_value=start_value ;
init_time= Time.now () ; dirty = true ; next = Time.now () }
init_time= Time.now () ; dirty = false ; next = Time.now () }
let update ~cur_value bar =
{ bar with cur_value ; dirty=true }
let increment_end bar =
{ bar with end_value=(bar.end_value +. 1.) ; dirty=true }
{ bar with end_value=(bar.end_value +. 1.) ; dirty=false }
let increment_cur bar =
{ bar with cur_value=(bar.cur_value +. 1.) ; dirty=true }

View File

@ -127,3 +127,14 @@ let get_ezfio_default directory data =
|> aux
;;
let ezfio_work ezfio_file =
let result =
Filename.concat ezfio_file "work"
in
begin
match Sys.is_directory result with
| `Yes -> ()
| _ -> Unix.mkdir result
end;
result
;;

View File

@ -1,25 +1,35 @@
open Core.Std
open Qptypes
module RunningMap = Map.Make (Id.Task)
module TasksMap = Map.Make (Id.Task)
module ClientsSet = Set.Make (Id.Client)
type t =
{ queued : Id.Task.t list ;
running : (Id.Task.t, Id.Client.t) Map.Poly.t ;
tasks : (Id.Task.t, string) Map.Poly.t;
clients : Id.Client.t Set.Poly.t;
{ queued_front : Id.Task.t list ;
queued_back : Id.Task.t list ;
running : Id.Client.t RunningMap.t;
tasks : string TasksMap.t;
clients : ClientsSet.t;
next_client_id : Id.Client.t;
next_task_id : Id.Task.t;
number_of_queued : int;
number_of_running : int;
number_of_tasks : int;
number_of_clients : int;
}
let create () =
{ queued = [] ;
running = Map.Poly.empty ;
tasks = Map.Poly.empty;
clients = Set.Poly.empty;
{ queued_front = [] ;
queued_back = [] ;
running = RunningMap.empty ;
tasks = TasksMap.empty;
clients = ClientsSet.empty;
next_client_id = Id.Client.of_int 1;
next_task_id = Id.Task.of_int 1;
number_of_queued = 0;
number_of_running = 0;
number_of_tasks = 0;
number_of_clients = 0;
}
@ -30,9 +40,11 @@ let add_task ~task q =
q.next_task_id
in
{ q with
queued = task_id :: q.queued ;
tasks = Map.add q.tasks ~key:task_id ~data:task ;
queued_front = task_id :: q.queued_front ;
tasks = TasksMap.add task_id task q.tasks;
next_task_id = Id.Task.increment task_id ;
number_of_queued = q.number_of_queued + 1;
number_of_tasks = q.number_of_tasks + 1;
}
@ -43,45 +55,62 @@ let add_client q =
q.next_client_id
in
{ q with
clients = Set.add q.clients client_id;
clients = ClientsSet.add client_id q.clients;
next_client_id = Id.Client.increment client_id;
number_of_clients = q.number_of_clients + 1;
}, client_id
let pop_task ~client_id q =
let { queued ; running ; _ } =
let { queued_front ; queued_back ; running ; _ } =
q
in
assert (Set.mem q.clients client_id);
match queued with
assert (ClientsSet.mem client_id q.clients);
let queued_front', queued_back' =
match queued_front, queued_back with
| (l, []) -> ( [], List.rev l)
| t -> t
in
match queued_back' with
| task_id :: new_queue ->
let new_q =
{ q with
queued = new_queue ;
running = Map.add running ~key:task_id ~data:client_id ;
queued_front= queued_front' ;
queued_back = new_queue ;
running = RunningMap.add task_id client_id running;
number_of_queued = q.number_of_queued - 1;
number_of_running = q.number_of_running + 1;
}
in new_q, Some task_id, (Map.find q.tasks task_id)
and found =
try Some (TasksMap.find task_id q.tasks)
with Not_found -> None
in new_q, Some task_id, found
| [] -> q, None, None
let del_client ~client_id q =
assert (Set.mem q.clients client_id);
assert (ClientsSet.mem client_id q.clients);
{ q with
clients = Set.remove q.clients client_id }
clients = ClientsSet.remove client_id q.clients;
number_of_clients = q.number_of_clients - 1
}
let end_task ~task_id ~client_id q =
let { running ; tasks ; _ } =
q
in
assert (Set.mem q.clients client_id);
assert (ClientsSet.mem client_id q.clients);
let () =
match Map.Poly.find running task_id with
| None -> failwith "Task already finished"
| Some client_id_check -> assert (client_id_check = client_id)
let client_id_check =
try RunningMap.find task_id running with
Not_found -> failwith "Task already finished"
in
assert (client_id_check = client_id)
in
{ q with
running = Map.remove running task_id ;
running = RunningMap.remove task_id running ;
number_of_running = q.number_of_running - 1
}
let del_task ~task_id q =
@ -89,9 +118,10 @@ let del_task ~task_id q =
q
in
if (Map.mem tasks task_id) then
if (TasksMap.mem task_id tasks) then
{ q with
tasks = Map.remove tasks task_id ;
tasks = TasksMap.remove task_id tasks;
number_of_tasks = q.number_of_tasks - 1;
}
else
Printf.sprintf "Task %d is already deleted" (Id.Task.to_int task_id)
@ -99,33 +129,81 @@ let del_task ~task_id q =
let number_of_tasks q =
assert (q.number_of_tasks >= 0);
q.number_of_tasks
let number_of_queued q =
Map.length q.tasks
assert (q.number_of_queued >= 0);
q.number_of_queued
let number_of_running q =
Map.length q.running
assert (q.number_of_running >= 0);
q.number_of_running
let number_of_clients q =
assert (q.number_of_clients >= 0);
q.number_of_clients
let to_string { queued ; running ; tasks ; _ } =
let to_string qs =
let { queued_back ; queued_front ; running ; tasks ; _ } = qs in
let q =
List.map ~f:Id.Task.to_string queued
|> String.concat ~sep:" ; "
(List.map Id.Task.to_string queued_front) @
(List.map Id.Task.to_string @@ List.rev queued_back)
|> String.concat " ; "
and r =
Map.Poly.to_alist running
|> List.map ~f:(fun (t,c) -> "("^(Id.Task.to_string t)^", "
RunningMap.bindings running
|> List.map (fun (t,c) -> "("^(Id.Task.to_string t)^", "
^(Id.Client.to_string c)^")")
|> String.concat ~sep:" ; "
|> String.concat " ; "
and t =
Map.Poly.to_alist tasks
|> List.map ~f:(fun (t,c) -> "("^(Id.Task.to_string t)^", \""
TasksMap.bindings tasks
|> List.map (fun (t,c) -> "("^(Id.Task.to_string t)^", \""
^c^"\")")
|> String.concat ~sep:" ; "
|> String.concat " ; "
in
Printf.sprintf "{
Tasks : %d Queued : %d Running : %d Clients : %d
queued : { %s }
running : { %s }
tasks : [ %s
]
}" q r t
}"
(number_of_tasks qs) (number_of_queued qs) (number_of_running qs) (number_of_clients qs)
q r t
let test () =
let q =
create ()
|> add_task ~task:"First Task"
|> add_task ~task:"Second Task"
in
let q, client_id =
add_client q
in
let q, task_id, task_content =
match pop_task ~client_id q with
| q, Some x, Some y -> q, Id.Task.to_int x, y
| _ -> assert false
in
Printf.printf "Task_id : %d \t\t Task : %s\n" task_id task_content;
to_string q |> print_endline ;
let q, task_id, task_content =
match pop_task ~client_id q with
| q, Some x, Some y -> q, Id.Task.to_int x, y
| _ -> assert false
in
Printf.printf "Task_id : %d \t\t Task : %s\n" task_id task_content;
let q, task_id, task_content =
match pop_task ~client_id q with
| q, None, None -> q, 0, "None"
| _ -> assert false
in
Printf.printf "Task_id : %d \t\t Task : %s\n" task_id task_content;
q
|> to_string
|> print_endline

63
ocaml/Queuing_system.mli Normal file
View File

@ -0,0 +1,63 @@
module RunningMap : Map.S with type key = Id.Task.t
module TasksMap : Map.S with type key = Id.Task.t
module ClientsSet : Set.S with type elt = Id.Client.t
type t = {
queued_front : Id.Task.t list ;
queued_back : Id.Task.t list ;
running : Id.Client.t RunningMap.t ;
tasks : string TasksMap.t ;
clients : ClientsSet.t ;
next_client_id : Id.Client.t ;
next_task_id : Id.Task.t ;
number_of_queued : int ;
number_of_running : int ;
number_of_tasks : int ;
number_of_clients : int ;
}
(** Creates a new queuing system. Returns the new queue. *)
val create : unit -> t
(** Add a new task represented as a string. Returns the queue with the added task. *)
val add_task : task:string -> t -> t
(** Add a new client. Returns the queue and a new client_id. *)
val add_client : t -> t * Id.Client.t
(** Pops a task from the queue. The task is set as running on client client_id.
Returns the queue, a task_id and the content of the task. If the queue contains
no task, the task_id and the task content are None. *)
val pop_task :
client_id:ClientsSet.elt -> t -> t * Id.Task.t option * string option
(** Deletes a client from the queuing system *)
val del_client : client_id:ClientsSet.elt -> t -> t
(** Deletes a client from the queuing system. The client is assumed to be a member
of the set of clients. Returns the queue without the removed client. *)
val end_task : task_id:RunningMap.key -> client_id:ClientsSet.elt -> t -> t
(** Deletes a task from the queuing system. The task is assumed to be a member
of the map of tasks. Returns the queue without the removed task. *)
val del_task : task_id:TasksMap.key -> t -> t
(** Returns the number of tasks, assumed >= 0 *)
val number_of_tasks : t -> int
(** Returns the number of queued tasks, assumed >= 0 *)
val number_of_queued : t -> int
(** Returns the number of running tasks, assumed >= 0 *)
val number_of_running : t -> int
(** Returns the number of connected clients, assumed >= 0 *)
val number_of_clients : t -> int
(** Prints the content of the queue *)
val to_string : t -> string
(** Test function for debug *)
val test : unit -> unit

View File

@ -2,6 +2,23 @@ open Core.Std
open Qptypes
type pub_state =
| Waiting
| Running of string
| Stopped
let pub_state_of_string = function
| "Waiting" -> Waiting
| "Stopped" -> Stopped
| s -> Running s
let string_of_pub_state = function
| Waiting -> "Waiting"
| Stopped -> "Stopped"
| Running s -> s
type t =
{
queue : Queuing_system.t ;
@ -31,20 +48,21 @@ let zmq_context =
ZMQ.Context.create ()
let bind_socket ~socket_type ~socket ~address =
let bind_socket ~socket_type ~socket ~port =
let rec loop = function
| 0 -> failwith @@ Printf.sprintf
"Unable to bind the %s socket : %s "
socket_type address
"Unable to bind the %s socket to port : %d "
socket_type port
| -1 -> ()
| i ->
try
ZMQ.Socket.bind socket address;
ZMQ.Socket.bind socket @@ Printf.sprintf "tcp://*:%d" port;
loop (-1)
with
| Unix.Unix_error _ -> (Time.pause @@ Time.Span.of_float 1. ; loop (i-1) )
| other_exception -> raise other_exception
in loop 10
in loop 60;
ZMQ.Socket.bind socket @@ Printf.sprintf "ipc:///tmp/qp_run:%d" port
let hostname = lazy (
@ -98,7 +116,7 @@ let stop ~port =
let req_socket =
ZMQ.Socket.create zmq_context ZMQ.Socket.req
and address =
Printf.sprintf "tcp://%s:%d" (Lazy.force ip_address) port
Printf.sprintf "ipc:///tmp/qp_run:%d" port
in
ZMQ.Socket.set_linger_period req_socket 1_000_000;
ZMQ.Socket.connect req_socket address;
@ -120,7 +138,7 @@ let stop ~port =
ZMQ.Socket.close req_socket
let new_job msg program_state rep_socket =
let new_job msg program_state rep_socket pair_socket =
let state =
msg.Message.Newjob_msg.state
@ -143,10 +161,32 @@ let new_job msg program_state rep_socket =
}
in
reply_ok rep_socket;
string_of_pub_state Waiting
|> ZMQ.Socket.send pair_socket ;
result
let change_pub_state msg program_state rep_socket pair_socket =
let msg =
match msg with
| `Waiting -> Waiting
| `Stopped -> Stopped
| `Running ->
begin
let state =
match program_state.state with
| Some x -> x
| None -> failwith "Trying to change pub state while no job is ready"
in
Running (Message.State.to_string state)
end
in
reply_ok rep_socket;
string_of_pub_state msg
|> ZMQ.Socket.send pair_socket ;
let end_job msg program_state rep_socket =
program_state
let end_job msg program_state rep_socket pair_socket =
let failure () =
reply_wrong_state rep_socket;
@ -165,7 +205,11 @@ let end_job msg program_state rep_socket =
| Some state ->
begin
if (msg.Message.Endjob_msg.state = state) then
begin
string_of_pub_state Waiting
|> ZMQ.Socket.send pair_socket ;
success state
end
else
failure ()
end
@ -262,8 +306,7 @@ let del_task msg program_state rep_socket =
}
in
let more =
(Queuing_system.number_of_queued new_program_state.queue +
Queuing_system.number_of_running new_program_state.queue) > 0
(Queuing_system.number_of_tasks new_program_state.queue > 0)
in
Message.DelTaskReply (Message.DelTaskReply_msg.create ~task_id ~more)
|> Message.to_string
@ -355,7 +398,7 @@ let add_task msg program_state rep_socket =
let get_task msg program_state rep_socket =
let get_task msg program_state rep_socket pair_socket =
let state, client_id =
msg.Message.GetTask_msg.state,
@ -371,6 +414,12 @@ let get_task msg program_state rep_socket =
let new_queue, task_id, task =
Queuing_system.pop_task ~client_id program_state.queue
in
if (Queuing_system.number_of_queued new_queue = 0) then
string_of_pub_state Waiting
|> ZMQ.Socket.send pair_socket
else
string_of_pub_state (Running (Message.State.to_string state))
|> ZMQ.Socket.send pair_socket;
let new_program_state =
{ program_state with
@ -378,21 +427,10 @@ let get_task msg program_state rep_socket =
}
in
match (task, task_id) with
| Some task, Some task_id ->
begin
Message.GetTaskReply (Message.GetTaskReply_msg.create ~task ~task_id)
|> Message.to_string
|> ZMQ.Socket.send rep_socket ;
new_program_state
end
| _ ->
begin
Message.Terminate (Message.Terminate_msg.create ())
|> Message.to_string
|> ZMQ.Socket.send rep_socket ;
program_state
end
in
@ -454,9 +492,9 @@ let put_psi msg rest_of_msg program_state rep_socket =
| Some x -> x
| None ->
begin
let psi_det, psi_coef =
let psi_det, psi_coef, energy =
match rest_of_msg with
| [ x ; y ] -> x, y
| [ x ; y ; e ] -> x, y, e
| _ -> failwith "Badly formed put_psi message"
in
Message.Psi.create
@ -467,6 +505,7 @@ let put_psi msg rest_of_msg program_state rep_socket =
~n_det_selectors:msg.Message.PutPsi_msg.n_det_selectors
~psi_det
~psi_coef
~energy
end
in
let new_program_state =
@ -501,29 +540,85 @@ let get_psi msg program_state rep_socket =
let terminate program_state rep_socket =
reply_ok rep_socket;
{ program_state with
psi = None;
address_tcp = None;
address_inproc = None;
running = false
}
let error msg program_state rep_socket =
Printf.printf "%s\n%!" msg;
Message.Error (Message.Error_msg.create msg)
|> Message.to_string
|> ZMQ.Socket.send rep_socket ;
program_state
let start_pub_thread ~port =
Thread.create (fun () ->
let timeout =
1000
in
let pair_socket =
ZMQ.Socket.create zmq_context ZMQ.Socket.pair
and address =
"inproc://pair"
in
ZMQ.Socket.connect pair_socket address;
let pub_socket =
ZMQ.Socket.create zmq_context ZMQ.Socket.pub
in
bind_socket ~socket_type:"PUB" ~socket:pub_socket ~port;
let pollitem =
ZMQ.Poll.mask_of
[| (pair_socket, ZMQ.Poll.In) |]
in
let rec run state =
let new_state =
let polling =
ZMQ.Poll.poll ~timeout pollitem
in
if (polling.(0) = Some ZMQ.Poll.In) then
ZMQ.Socket.recv ~block:false pair_socket
|> pub_state_of_string
else
state
in
ZMQ.Socket.send pub_socket @@ string_of_pub_state new_state;
match state with
| Stopped -> ()
| _ -> run new_state
in
run Waiting;
ZMQ.Socket.set_linger_period pair_socket 1000 ;
ZMQ.Socket.close pair_socket;
ZMQ.Socket.set_linger_period pub_socket 1000 ;
ZMQ.Socket.close pub_socket;
)
let run ~port =
(** Bind inproc socket for changing state of pub *)
let pair_socket =
ZMQ.Socket.create zmq_context ZMQ.Socket.pair
and address =
"inproc://pair"
in
ZMQ.Socket.bind pair_socket address;
let pub_thread =
start_pub_thread ~port:(port+1) ()
in
(** Bind REP socket *)
let rep_socket =
ZMQ.Socket.create zmq_context ZMQ.Socket.rep
and address =
Printf.sprintf "tcp://%s:%d" (Lazy.force ip_address) port
in
bind_socket "REP" rep_socket address;
ZMQ.Socket.set_linger_period rep_socket 1_000_000;
bind_socket "REP" rep_socket port;
let initial_program_state =
{ queue = Queuing_system.create () ;
@ -542,6 +637,9 @@ let run ~port =
[| (rep_socket, ZMQ.Poll.In) |]
in
let address =
Printf.sprintf "tcp://%s:%d" (Lazy.force ip_address) port
in
Printf.printf "Task server running : %s\n%!" address;
@ -579,9 +677,10 @@ let run ~port =
in
(** Debug input *)
Printf.sprintf "%d %d : %s\n%!"
Printf.sprintf "q:%d r:%d n:%d : %s\n%!"
(Queuing_system.number_of_queued program_state.queue)
(Queuing_system.number_of_running program_state.queue)
(Queuing_system.number_of_tasks program_state.queue)
(Message.to_string message)
|> debug;
@ -591,15 +690,18 @@ let run ~port =
| _ , Message.Terminate _ -> terminate program_state rep_socket
| _ , Message.PutPsi x -> put_psi x rest program_state rep_socket
| _ , Message.GetPsi x -> get_psi x program_state rep_socket
| None , Message.Newjob x -> new_job x program_state rep_socket
| None , Message.Newjob x -> new_job x program_state rep_socket pair_socket
| _ , Message.Newjob _ -> error "A job is already running" program_state rep_socket
| Some _, Message.Endjob x -> end_job x program_state rep_socket
| Some _, Message.Endjob x -> end_job x program_state rep_socket pair_socket
| Some _, Message.SetRunning -> change_pub_state `Running program_state rep_socket pair_socket
| _, Message.SetWaiting -> change_pub_state `Waiting program_state rep_socket pair_socket
| _, Message.SetStopped -> change_pub_state `Stopped program_state rep_socket pair_socket
| None , _ -> error "No job is running" program_state rep_socket
| Some _, Message.Connect x -> connect x program_state rep_socket
| Some _, Message.Disconnect x -> disconnect x program_state rep_socket
| Some _, Message.AddTask x -> add_task x program_state rep_socket
| Some _, Message.DelTask x -> del_task x program_state rep_socket
| Some _, Message.GetTask x -> get_task x program_state rep_socket
| Some _, Message.GetTask x -> get_task x program_state rep_socket pair_socket
| Some _, Message.TaskDone x -> task_done x program_state rep_socket
| _ , _ ->
error ("Invalid message : "^(Message.to_string message)) program_state rep_socket
@ -614,6 +716,11 @@ let run ~port =
end
in main_loop initial_program_state true;
ZMQ.Socket.send pair_socket @@ string_of_pub_state Stopped;
Thread.join pub_thread;
ZMQ.Socket.close rep_socket

84
ocaml/TaskServer.mli Normal file
View File

@ -0,0 +1,84 @@
type t =
{
queue : Queuing_system.t ;
state : Message.State.t option ;
address_tcp : Address.Tcp.t option ;
address_inproc : Address.Inproc.t option ;
psi : Message.Psi.t option;
progress_bar : Progress_bar.t option ;
running : bool;
}
(** {1} Debugging *)
(** Fetch the QP_TASK_DEBUG environment variable *)
val debug_env : bool
(** Print a debug message *)
val debug : string -> unit
(** {1} ZMQ *)
(** ZeroMQ context *)
val zmq_context : ZMQ.Context.t
(** Bind a ZMQ socket to a TCP port and to an IPC file /tmp/qp_run.<port> *)
val bind_socket :
socket_type:string -> socket:'a ZMQ.Socket.t -> port:int -> unit
(** Name of the host on which the server runs *)
val hostname : string lazy_t
(** IP address of the current host *)
val ip_address : string lazy_t
(** Standard messages *)
val reply_ok : [> `Req ] ZMQ.Socket.t -> unit
val reply_wrong_state : [> `Req ] ZMQ.Socket.t -> unit
(** Stop server *)
val stop : port:int -> unit
(** {1} Server functions *)
(** Create a new job *)
val new_job : Message.Newjob_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> [> `Pair] ZMQ.Socket.t -> t
(** Finish a running job *)
val end_job : Message.Endjob_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> [> `Pair] ZMQ.Socket.t -> t
(** Connect a client *)
val connect: Message.Connect_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t
(** Disconnect a client *)
val disconnect: Message.Disconnect_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t
(** Add a task to the pool *)
val add_task: Message.AddTask_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t
(** Mark the task as done by the client *)
val task_done: Message.TaskDone_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t
(** Delete a task when it has been pulled by the collector *)
val del_task: Message.DelTask_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t
(** The client get a new task to execute *)
val get_task: Message.GetTask_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> [> `Pair] ZMQ.Socket.t -> t
(** Terminate server *)
val terminate : t -> [> `Req ] ZMQ.Socket.t -> t
(** Put a wave function in the task server *)
val put_psi :
Message.PutPsi_msg.t -> string list -> t -> [> `Req ] ZMQ.Socket.t -> t
(** Get the wave function stored in the task server *)
val get_psi : Message.GetPsi_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t
(** Reply an Error message *)
val error : string -> t -> [> `Req ] ZMQ.Socket.t -> t
(** Run server *)
val run : port:int -> unit

326
ocaml/Zmatrix.ml Normal file
View File

@ -0,0 +1,326 @@
open Qptypes
module StringMap = Map.Make(String)
type atom_id = int
type angle = Label of string | Value of float
type distance = Label of string | Value of float
type dihedral = Label of string | Value of float
let pi = acos (-1.)
let to_radian = pi /. 180.
let rec in_range (xmin, xmax) x =
if (x <= xmin) then
in_range (xmin, xmax) (x -. xmin +. xmax )
else if (x > xmax) then
in_range (xmin, xmax) (x -. xmax +. xmin )
else
x
let atom_id_of_int : int -> atom_id =
fun x -> ( assert (x>0) ; x)
let distance_of_float : float -> distance =
fun x -> ( assert (x>=0.) ; Value x)
let angle_of_float : float -> angle =
fun x -> Value (in_range (-180., 180.) x)
let dihedral_of_float : float -> dihedral =
fun x -> Value (in_range (-360., 360.) x)
let atom_id_of_string : string -> atom_id =
fun i -> atom_id_of_int @@ int_of_string i
let distance_of_string : string -> distance =
fun s ->
try
distance_of_float @@ float_of_string s
with _ -> Label s
let angle_of_string : string -> angle =
fun s ->
try
angle_of_float @@ float_of_string s
with _ -> Label s
let dihedral_of_string : string -> dihedral =
fun s ->
try
dihedral_of_float @@ float_of_string s
with _ -> Label s
let int_of_atom_id : atom_id -> int = fun x -> x
let float_of_distance : float StringMap.t -> distance -> float =
fun map -> function
| Value x -> x
| Label s -> StringMap.find s map
let float_of_angle : float StringMap.t -> angle -> float =
fun map -> function
| Value x -> x
| Label s -> StringMap.find s map
let float_of_dihedral : float StringMap.t -> dihedral -> float =
fun map -> function
| Value x -> x
| Label s -> StringMap.find s map
type line =
| First of Element.t
| Second of (Element.t * distance)
| Third of (Element.t * atom_id * distance * atom_id * angle)
| Other of (Element.t * atom_id * distance * atom_id * angle * atom_id * dihedral )
| Coord of (string * float)
let string_of_line map =
let f_r = float_of_distance map
and f_a = float_of_angle map
and f_d = float_of_dihedral map
and i_i = int_of_atom_id
in function
| First e -> Printf.sprintf "%-3s" (Element.to_string e)
| Second (e, r) -> Printf.sprintf "%-3s %5d %f" (Element.to_string e) 1 (f_r r)
| Third (e, i, r, j, a) -> Printf.sprintf "%-3s %5d %f %5d %f" (Element.to_string e) (i_i i) (f_r r) (i_i j) (f_a a)
| Other (e, i, r, j, a, k, d) -> Printf.sprintf "%-3s %5d %f %5d %f %5d %f" (Element.to_string e) (i_i i) (f_r r) (i_i j) (f_a a) (i_i k) (f_d d)
| Coord (c, f) -> Printf.sprintf "%s %f" c f
let line_of_string l =
let line_clean =
Str.split (Str.regexp " ") l
|> List.filter (fun x -> x <> "")
in
match line_clean with
| e :: [] -> First (Element.of_string e)
| e :: i :: r :: [] -> Second
(Element.of_string e,
distance_of_string r)
| e :: i :: r :: j :: a :: [] -> Third
(Element.of_string e,
atom_id_of_string i,
distance_of_string r,
atom_id_of_string j,
angle_of_string a)
| e :: i :: r :: j :: a :: k :: d :: [] -> Other
(Element.of_string e,
atom_id_of_string i,
distance_of_string r,
atom_id_of_string j,
angle_of_string a,
atom_id_of_string k,
dihedral_of_string d)
| c :: f :: [] -> Coord (c, float_of_string f)
| _ -> failwith ("Syntax error: "^l)
type t = (line array * float StringMap.t)
let of_string t =
let l =
Str.split (Str.regexp "\n") t
|> List.map String.trim
|> List.filter (fun x -> x <> "")
|> List.map line_of_string
in
let l =
match l with
| First _ :: Second _ :: Third _ :: _
| First _ :: Second _ :: Coord _ :: []
| First _ :: Second _ :: []
| First _ :: [] -> l
| _ -> failwith "Syntax error"
in
let (l, m) =
let rec work lst map = function
| (First _ as x) :: rest
| (Second _ as x) :: rest
| (Third _ as x) :: rest
| (Other _ as x) :: rest -> work (x::lst) map rest
| (Coord (c,f)) :: rest -> work lst (StringMap.add c f map) rest
| [] -> (List.rev lst, map)
in
work [] (StringMap.empty) l
in
(Array.of_list l, m)
(** Linear algebra *)
let (|-) (x,y,z) (x',y',z') =
( x-.x', y-.y', z-.z' )
let (|+) (x,y,z) (x',y',z') =
( x+.x', y+.y', z+.z' )
let (|.) s (x,y,z) =
( s*.x, s*.y, s*.z )
let dot (x,y,z) (x',y',z') =
x*.x' +. y*.y' +. z*.z'
let norm u =
sqrt @@ dot u u
let normalized u =
1. /. (norm u) |. u
let cross (x,y,z) (x',y',z') =
((y *. z' -. z *. y'), -. (x *. z' -. z *. x'), (x *. y' -. y *. x'))
let rotation_matrix axis angle =
(* Euler-Rodrigues formula for rotation matrix, taken from
https://github.com/jevandezande/zmatrix/blob/master/converter.py
*)
let a =
(cos (angle *. to_radian *. 0.5))
in
let (b, c, d) =
(-. sin (angle *. to_radian *. 0.5)) |. (normalized axis)
in
Array.of_list @@
[(a *. a +. b *. b -. c *. c -. d *. d,
2. *. (b *. c -. a *. d),
2. *. (b *. d +. a *. c));
(2. *. (b *. c +. a *. d),
a *. a +. c *. c -.b *. b -. d *. d,
2. *. (c *. d -. a *. b));
(2. *. (b *. d -. a *. c),
2. *. (c *. d +. a *. b),
a *. a +. d *. d -. b *. b -. c *. c)]
(*
[(a *. a +. b *. b -. c *. c -. d *. d,
2. *. (b *. c +. a *. d),
2. *. (b *. d -. a *. c));
(2. *. (b *. c -. a *. d),
a *. a +. c *. c -.b *. b -. d *. d,
2. *. (c *. d +. a *. b));
(2. *. (b *. d +. a *. c),
2. *. (c *. d -. a *. b),
a *. a +. d *. d -. b *. b -. c *. c)]
*)
let apply_rotation_matrix rot u =
(dot rot.(0) u, dot rot.(1) u, dot rot.(2) u)
let center_of_mass l =
let (x,y,z) =
let sum_mass, com =
Array.fold_left (fun (s,com) (e,x,y,z) ->
let mass =
Positive_float.to_float @@ Element.mass e
in
(s +. mass, ( mass |. (x,y,z) ) |+ com) )
(0., (0.,0.,0.)) l
in
(1. /. sum_mass) |. com
in
Printf.printf "%f %f %f\n" x y z ; (x,y,z)
let to_xyz (z,map) =
let result =
Array.make (Array.length z) None
in
let get_cartesian_coord i =
match result.(i-1) with
| None -> failwith @@ Printf.sprintf "Atom %d is defined in the future" i
| Some (_, x, y, z) -> (x, y, z)
in
let append_line i' =
match z.(i') with
| First e ->
result.(i') <- Some (e, 0., 0., 0.)
| Second (e, r) ->
let r =
float_of_distance map r
in
result.(i') <- Some (e, 0., 0., r)
| Third (e, i, r, j, a) ->
begin
let i, r, j, a =
int_of_atom_id i,
float_of_distance map r,
int_of_atom_id j,
float_of_angle map a
in
let ui, uj =
get_cartesian_coord i,
get_cartesian_coord j
in
let u_ij =
(uj |- ui)
in
let rot =
rotation_matrix (0., 1., 0.) a
in
let new_vec =
apply_rotation_matrix rot ( r |. (normalized u_ij))
in
let (x, y, z) =
new_vec |+ ui
in
result.(i') <- Some (e, x, y, z)
end
| Other (e, i, r, j, a, k, d) ->
begin
let i, r, j, a, k, d =
int_of_atom_id i,
float_of_distance map r,
int_of_atom_id j,
float_of_angle map a,
int_of_atom_id k,
float_of_dihedral map d
in
let ui, uj, uk =
get_cartesian_coord i,
get_cartesian_coord j,
get_cartesian_coord k
in
let u_ij, u_kj =
(uj |- ui) , (uj |- uk)
in
let normal =
cross u_ij u_kj
in
let new_vec =
r |. (normalized u_ij)
|> apply_rotation_matrix (rotation_matrix normal a)
|> apply_rotation_matrix (rotation_matrix u_ij d)
in
let (x, y, z) =
new_vec |+ ui
in
result.(i') <- Some (e, x, y, z)
end
| Coord _ -> ()
in
Array.iteri (fun i _ -> append_line i) z;
let result =
Array.map (function
| Some x -> x
| None -> failwith "Some atoms were not defined" ) result
in
Array.to_list result
let to_xyz_string (l,map) =
String.concat "\n"
( to_xyz (l,map)
|> List.map (fun (e,x,y,z) ->
Printf.sprintf "%s %f %f %f\n" (Element.to_string e) x y z) )

View File

@ -1,3 +1,3 @@
true: package(core,sexplib.syntax,cryptokit,ZMQ)
true: package(core,cryptokit,ZMQ,sexplib.syntax,str)
true: thread
false: profile

View File

@ -19,7 +19,7 @@ let spec =
~doc:"string Name of the pseudopotential"
+> flag "cart" no_arg
~doc:" Compute AOs in the Cartesian basis set (6d, 10f, ...)"
+> anon ("xyz_file" %: file )
+> anon ("(xyz_file|zmt_file)" %: file )
(** Handle dummy atoms placed on bonds *)
@ -93,7 +93,7 @@ let run ?o b c d m p cart xyz_file =
(* Read molecule *)
let molecule =
(Molecule.of_xyz_file xyz_file ~charge:(Charge.of_int c)
(Molecule.of_file xyz_file ~charge:(Charge.of_int c)
~multiplicity:(Multiplicity.of_int m) )
in
let dummy =
@ -309,7 +309,8 @@ let run ?o b c d m p cart xyz_file =
| None ->
begin
match String.rsplit2 ~on:'.' xyz_file with
| Some (x,"xyz") -> x^".ezfio"
| Some (x,"xyz")
| Some (x,"zmt") -> x^".ezfio"
| _ -> xyz_file^".ezfio"
end
in
@ -640,9 +641,10 @@ let command =
============================
Creates an EZFIO directory from a standard xyz file. The basis set is defined
as a single string if all the atoms are taken from the same basis set,
otherwise specific elements can be defined as follows:
Creates an EZFIO directory from a standard xyz file or from a z-matrix file
in Gaussian format. The basis set is defined as a single string if all the
atoms are taken from the same basis set, otherwise specific elements can be
defined as follows:
-b \"cc-pcvdz | H:cc-pvdz | C:6-31g\"

141
ocaml/qp_create_guess.ml Normal file
View File

@ -0,0 +1,141 @@
open Qputils
open Qptypes
open Core.Std
let run ~multiplicity ezfio_file =
if (not (Sys.file_exists_exn ezfio_file)) then
failwith ("EZFIO directory "^ezfio_file^" not found");
Ezfio.set_file ezfio_file;
let d =
Input.Determinants_by_hand.read ()
in
let m =
Multiplicity.of_int multiplicity
in
let ne =
Ezfio.get_electrons_elec_alpha_num () +
Ezfio.get_electrons_elec_beta_num ()
|> Elec_number.of_int
in
let alpha, beta =
let (a,b) =
Multiplicity.to_alpha_beta ne m
in
(Elec_alpha_number.to_int a, Elec_beta_number.to_int b)
in
let n_open_shells =
alpha - beta
in
let mo_tot_num =
Ezfio.get_mo_basis_mo_tot_num ()
in
let build_list_of_dets ne n_closed n_open =
let init =
Array.create ~len:n_closed Bit.One
|> Array.to_list
in
let rec set_electron accu = function
| 1 -> [ Bit.One :: accu ]
| i ->
assert (i>1);
let rest =
set_electron (Bit.Zero :: accu) (i-1)
in
(Bit.One::accu) :: rest
in
let rec extend accu = function
| 0 -> List.rev accu
| i -> extend (Bit.Zero::accu) (i-1)
in
let rec set_n_electrons accu imax = function
| 0 -> []
| 1 -> set_electron accu imax
| i ->
assert (i>1);
let l =
set_electron accu (imax-1)
in
List.map ~f:(fun x -> set_n_electrons x (imax-1) (i-1)) l
|> List.concat
in
set_n_electrons init n_open ne
|> List.filter ~f:(fun x -> List.length x <= n_closed+n_open)
|> List.map ~f:(fun x -> extend x (((mo_tot_num-1)/64+1)*64 - List.length x))
in
let alpha_new =
(Elec_number.to_int ne + 1)/2
and beta_new =
Elec_number.to_int ne/2
in
let l_alpha =
build_list_of_dets ((alpha-beta+1)/2) beta n_open_shells
in
let l_beta =
if alpha_new = beta_new then
l_alpha
else
build_list_of_dets ((alpha-beta)/2)beta n_open_shells
in
let n_int =
Bitlist.n_int_of_mo_tot_num mo_tot_num
in
let determinants =
List.map l_alpha ~f:(fun x -> List.map l_beta ~f:(fun y -> (x,y) ))
|> List.concat
|> List.map ~f:(fun pair -> Determinant.of_bitlist_couple ~n_int
~alpha:(Elec_alpha_number.of_int alpha_new)
~beta:(Elec_beta_number.of_int beta_new) pair )
in
let c =
Array.create ~len:(List.length determinants) (Det_coef.of_float 1.)
in
determinants
|> List.map ~f:(fun x -> Determinant.to_string ~mo_tot_num:(MO_number.of_int mo_tot_num) x)
|> List.iter ~f:(fun x -> Printf.printf "%s\n\n%!" x);
let l =
List.length determinants
in
if l > 0 then
begin
let d =
let s = (Float.of_int (alpha - beta)) *. 0.5 in
let open Input.Determinants_by_hand in
{ d with n_int ;
n_det = Det_number.of_int ~min:1 ~max:l l;
expected_s2 = Positive_float.of_float (s *. (s +. 1.)) ;
psi_coef = c;
psi_det = Array.of_list determinants;
}
in
Input.Determinants_by_hand.write d;
Ezfio.set_determinants_read_wf true
end
else
Ezfio.set_determinants_read_wf false
let spec =
let open Command.Spec in
empty
+> flag "m" (required int)
~doc:"int Spin multiplicity"
+> anon ("ezfio_file" %: string)
let () =
Command.basic
~summary: "Quantum Package command"
~readme:( fun () -> "
Creates an open-shell multiplet initial guess\n\n" )
spec
(fun multiplicity ezfio_file () ->
run ~multiplicity ezfio_file
)
|> Command.run ~version: Git.sha1 ~build_info: Git.message

66
ocaml/qp_overlap_of_wf.ml Normal file
View File

@ -0,0 +1,66 @@
open Input_determinants_by_hand
open Qptypes
let () =
let ezfio, ezfio' =
try
Sys.argv.(1), Sys.argv.(2)
with Invalid_argument _ ->
raise (Invalid_argument (Printf.sprintf
"Syntax : %s EZFIO1 EZFIO2" Sys.argv.(0)))
in
let fetch_wf filename =
Ezfio.set_file filename;
let mo_tot_num =
Ezfio.get_mo_basis_mo_tot_num ()
|> MO_number.of_int
in
let d =
Determinants_by_hand.read ()
in
let n_det =
Det_number.to_int d.Determinants_by_hand.n_det
in
let keys =
Array.map (Determinant.to_string ~mo_tot_num)
d.Determinants_by_hand.psi_det
and values =
Array.map Det_coef.to_float
d.Determinants_by_hand.psi_coef
in
let hash =
Hashtbl.create n_det
in
for i=0 to n_det-1
do
Hashtbl.add hash keys.(i) values.(i);
done;
hash
in
let overlap wf wf' =
let result, norm, norm' =
Hashtbl.fold (fun k c (accu,norm,norm') ->
let c' =
try Hashtbl.find wf' k
with Not_found -> 0.
in
(accu +. c *. c' ,
norm +. c *. c ,
norm'+. c'*. c' )
) wf (0.,0.,0.)
in
result /. (norm *. norm')
in
let wf, wf' =
fetch_wf ezfio,
fetch_wf ezfio'
in
let o =
overlap wf wf'
in
print_float (abs_float o)

View File

@ -15,7 +15,7 @@ let print_list () =
let () =
Random.self_init ()
let run ~master exe ezfio_file =
let run slave exe ezfio_file =
(** Check availability of the ports *)
@ -28,7 +28,7 @@ let run ~master exe ezfio_file =
in
let rec try_new_port port_number =
try
List.iter [ 0;1;2;3;4 ] ~f:(fun i ->
List.iter [ 0;1;2;3;4;5;6;7;8;9 ] ~f:(fun i ->
let address =
Printf.sprintf "tcp://%s:%d" (Lazy.force TaskServer.ip_address) (port_number+i)
in
@ -43,6 +43,7 @@ let run ~master exe ezfio_file =
try_new_port 41279
in
ZMQ.Socket.close dummy_socket;
ZMQ.Context.terminate zmq_context;
result
in
let time_start =
@ -74,16 +75,23 @@ let run ~master exe ezfio_file =
| 0 -> ()
| i -> failwith "Error: Input inconsistent\n"
end;
begin
match master with
| Some address -> Unix.putenv ~key:"QP_RUN_ADDRESS_MASTER" ~data:address
| None -> ()
end;
let qp_run_address_filename =
Filename.concat (Qpackage.ezfio_work ezfio_file) "qp_run_address"
in
let () =
if slave then
try
let address =
In_channel.read_all qp_run_address_filename
|> String.strip
in
Unix.putenv ~key:"QP_RUN_ADDRESS_MASTER" ~data:address
with Sys_error _ -> failwith "No master is not running"
in
(** Start task server *)
let address =
Printf.sprintf "tcp://%s:%d" (Lazy.force TaskServer.ip_address) port_number
in
let task_thread =
let thread =
Thread.create ( fun () ->
@ -91,7 +99,16 @@ let run ~master exe ezfio_file =
in
thread ();
in
let address =
Printf.sprintf "tcp://%s:%d" (Lazy.force TaskServer.ip_address) port_number
in
Unix.putenv ~key:"QP_RUN_ADDRESS" ~data:address;
let () =
if (not slave) then
Out_channel.with_file qp_run_address_filename ~f:(
fun oc -> Out_channel.output_lines oc [address])
in
(** Run executable *)
let prefix =
@ -110,6 +127,8 @@ let run ~master exe ezfio_file =
TaskServer.stop ~port:port_number;
Thread.join task_thread;
if (not slave) then
Sys.remove qp_run_address_filename;
let duration = Time.diff (Time.now()) time_start
|> Core.Span.to_string in
@ -118,8 +137,8 @@ let run ~master exe ezfio_file =
let spec =
let open Command.Spec in
empty
+> flag "master" (optional string)
~doc:("address Address of the master process")
+> flag "slave" no_arg
~doc:(" Needed for slave tasks")
+> anon ("executable" %: string)
+> anon ("ezfio_file" %: string)
;;
@ -137,8 +156,8 @@ Executes a Quantum Package binary file among these:\n\n"
)
)
spec
(fun master exe ezfio_file () ->
run ~master exe ezfio_file
(fun slave exe ezfio_file () ->
run slave exe ezfio_file
)
|> Command.run ~version: Git.sha1 ~build_info: Git.message

View File

@ -49,20 +49,20 @@ let t_to_string = function
| None -> assert false
;;
let run ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_filename =
let set ~core ~inact ~act ~virt ~del =
Ezfio.set_file ezfio_filename ;
if not (Ezfio.has_mo_basis_mo_tot_num ()) then
failwith "mo_basis/mo_tot_num not found" ;
let mo_tot_num = Ezfio.get_mo_basis_mo_tot_num () in
let mo_tot_num =
Ezfio.get_mo_basis_mo_tot_num ()
in
let n_int =
try N_int_number.of_int (Ezfio.get_determinants_n_int ())
with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num
in
let mo_class = Array.init mo_tot_num ~f:(fun i -> None) in
let mo_class =
Array.init mo_tot_num ~f:(fun i -> None)
in
(* Check input data *)
let apply_class l =
@ -196,6 +196,49 @@ let run ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_fi
|> Ezfio.set_bitmasks_cas;
;;
let get () =
let mo_tot_num =
Ezfio.get_mo_basis_mo_tot_num ()
in
let n_int =
try N_int_number.of_int (Ezfio.get_determinants_n_int ())
with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num
in
let bitmasks =
match Input.Bitmasks.read () with
| Some x -> x
| None -> failwith "No data to print"
in
assert (bitmasks.Input.Bitmasks.n_mask_gen |> Bitmask_number.to_int = 1);
assert (bitmasks.Input.Bitmasks.n_mask_cas |> Bitmask_number.to_int = 1);
let (generators,cas) =
Bitlist.of_int64_array bitmasks.Input.Bitmasks.generators,
Bitlist.of_int64_array bitmasks.Input.Bitmasks.cas
in
Printf.printf "MO : %d\n" mo_tot_num;
Printf.printf "n_int: %d\n" (N_int_number.to_int n_int);
Printf.printf "Gen : %s\nCAS : %s\n"
(Bitlist.to_string generators)
(Bitlist.to_string cas)
;;
let run ~print ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_filename =
Ezfio.set_file ezfio_filename ;
if not (Ezfio.has_mo_basis_mo_tot_num ()) then
failwith "mo_basis/mo_tot_num not found" ;
if print then
get ()
else
set ~core ~inact ~act ~virt ~del
;;
let ezfio_file =
let failure filename =
eprintf "'%s' is not an EZFIO file.\n%!" filename;
@ -240,6 +283,7 @@ let spec =
+> flag "act" (optional string) ~doc:"range Range of active orbitals"
+> flag "virt" (optional string) ~doc:"range Range of virtual orbitals"
+> flag "del" (optional string) ~doc:"range Range of deleted orbitals"
+> flag "print" no_arg ~doc:" Print the current masks"
+> anon ("ezfio_filename" %: ezfio_file)
;;
@ -251,7 +295,7 @@ let command =
The range of MOs has the form : \"[36-53,72-107,126-131]\"
")
spec
(fun core inact act virt del ezfio_filename () -> run ?core ?inact ?act ?virt ?del ezfio_filename )
(fun core inact act virt del print ezfio_filename () -> run ~print ?core ?inact ?act ?virt ?del ezfio_filename )
;;
let () =

View File

@ -47,12 +47,8 @@ let input_data = "
* States_number : int
assert (x > 0) ;
if (x > 100) then
warning \"More than 100 states\";
if (Ezfio.has_determinants_n_states_diag ()) then
assert (x <= (Ezfio.get_determinants_n_states_diag ()))
else if (Ezfio.has_determinants_n_states ()) then
assert (x <= (Ezfio.get_determinants_n_states ()));
if (x > 1000) then
warning \"More than 1000 states\";
* Bit_kind_size : int
begin match x with

View File

@ -1 +1 @@
Generators_restart Perturbation Properties Selectors_no_sorted Utils
Generators_restart Perturbation Properties Selectors_no_sorted Utils Davidson

View File

@ -6,7 +6,77 @@ Needed Modules
==============
.. Do not edit this section It was auto-generated
.. by the `update_README.py` script.
.. image:: tree_dependency.png
* `Generators_restart <http://github.com/LCPQ/quantum_package/tree/master/plugins/Generators_restart>`_
* `Perturbation <http://github.com/LCPQ/quantum_package/tree/master/plugins/Perturbation>`_
* `Properties <http://github.com/LCPQ/quantum_package/tree/master/plugins/Properties>`_
* `Selectors_no_sorted <http://github.com/LCPQ/quantum_package/tree/master/plugins/Selectors_no_sorted>`_
* `Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Utils>`_
Documentation
=============
.. Do not edit this section It was auto-generated
.. by the `update_README.py` script.
h_apply_just_1h_1p
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
h_apply_just_1h_1p_diexc
Undocumented
h_apply_just_1h_1p_diexcorg
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_just_1h_1p_diexcp
Undocumented
h_apply_just_1h_1p_monoexc
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_just_mono
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
h_apply_just_mono_diexc
Undocumented
h_apply_just_mono_diexcorg
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_just_mono_diexcp
Undocumented
h_apply_just_mono_monoexc
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`restart_more_singles <http://github.com/LCPQ/quantum_package/tree/master/plugins/All_singles/all_singles.irp.f#L1>`_
Generates and select single excitations
on the top of a given restart wave function
`routine <http://github.com/LCPQ/quantum_package/tree/master/plugins/All_singles/all_singles.irp.f#L11>`_
Undocumented

View File

@ -22,6 +22,9 @@ Properties
Pseudo
Selectors_full
Utils
ZMQ
cas_s
cas_s_selected
cas_sd
cas_sd_selected
ezfio_interface.irp.f

View File

@ -3,6 +3,7 @@ BEGIN_SHELL [ /usr/bin/env python ]
from generate_h_apply import *
s = H_apply("CAS_SD")
s.unset_skip()
print s
s = H_apply("CAS_SD_selected_no_skip")
@ -12,6 +13,7 @@ print s
s = H_apply("CAS_SD_selected")
s.set_selection_pt2("epstein_nesbet_2x2")
s.unset_skip()
print s
s = H_apply("CAS_SD_PT2")
@ -22,13 +24,9 @@ print s
s = H_apply("CAS_S",do_double_exc=False)
print s
s = H_apply("CAS_S_selected_no_skip",do_double_exc=False)
s.set_selection_pt2("epstein_nesbet_2x2")
s.unset_skip()
print s
s = H_apply("CAS_S_selected",do_double_exc=False)
s.set_selection_pt2("epstein_nesbet_2x2")
s.unset_skip()
print s
s = H_apply("CAS_S_PT2",do_double_exc=False)

View File

@ -1 +1 @@
Perturbation Selectors_full Generators_CAS
Perturbation Selectors_full Generators_CAS Davidson

View File

@ -118,6 +118,106 @@ Documentation
Undocumented
h_apply_cas_s
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
h_apply_cas_s_diexc
Undocumented
h_apply_cas_s_diexcorg
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_s_diexcp
Undocumented
h_apply_cas_s_monoexc
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_s_pt2
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
h_apply_cas_s_pt2_diexc
Undocumented
h_apply_cas_s_pt2_diexcorg
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_s_pt2_diexcp
Undocumented
h_apply_cas_s_pt2_monoexc
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_s_selected
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
h_apply_cas_s_selected_diexc
Undocumented
h_apply_cas_s_selected_diexcorg
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_s_selected_diexcp
Undocumented
h_apply_cas_s_selected_monoexc
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_s_selected_no_skip
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
h_apply_cas_s_selected_no_skip_diexc
Undocumented
h_apply_cas_s_selected_no_skip_diexcorg
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_s_selected_no_skip_diexcp
Undocumented
h_apply_cas_s_selected_no_skip_monoexc
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
h_apply_cas_sd
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.

View File

@ -12,6 +12,7 @@ program full_ci
pt2 = 1.d0
diag_algorithm = "Lapack"
if (N_det > N_det_max) then
call diagonalize_CI
call save_wavefunction
@ -28,49 +29,84 @@ program full_ci
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
endif
double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(N_states)
double precision :: E_CI_before(N_states)
if(read_wf)then
call i_H_psi(psi_det(1,1,N_det),psi_det,psi_coef,N_int,N_det,psi_det_size,N_states,i_H_psi_array)
h = diag_H_mat_elem(psi_det(1,1,N_det),N_int)
selection_criterion = dabs(psi_coef(N_det,1) * (i_H_psi_array(1) - h * psi_coef(N_det,1))) * 0.1d0
soft_touch selection_criterion
endif
integer :: n_det_before
print*,'Beginning the selection ...'
E_CI_before(1:N_states) = CI_energy(1:N_states)
do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max)
call H_apply_CAS_S_selected_no_skip(pt2, norm_pert, H_pert_diag, N_st)
n_det_before = N_det
call H_apply_CAS_SD_selected(pt2, norm_pert, H_pert_diag, N_st)
PROVIDE psi_coef
PROVIDE psi_det
PROVIDE psi_det_sorted
if (N_det > N_det_max) then
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
N_det = N_det_max
soft_touch N_det psi_det psi_coef
endif
call diagonalize_CI
call save_wavefunction
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
call ezfio_set_cas_sd_energy(CI_energy(1))
enddo
call diagonalize_CI
if (N_det > N_det_max) then
N_det = N_det_max
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
touch N_det psi_det psi_coef psi_det_sorted psi_coef_sorted psi_average_norm_contrib_sorted
endif
call save_wavefunction
if(n_det_before == N_det)then
selection_criterion = selection_criterion * 0.5d0
endif
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
do k = 1, N_states
print*,'State ',k
print *, 'PT2 = ', pt2(k)
print *, 'E = ', CI_energy(k)
print *, 'E(before)+PT2 = ', E_CI_before(k)+pt2(k)
enddo
print *, '-----'
if(N_states.gt.1)then
print*,'Variational Energy difference'
do i = 2, N_states
print*,'Delta E = ',CI_energy(i) - CI_energy(1)
enddo
endif
if(N_states.gt.1)then
print*,'Variational + perturbative Energy difference'
do i = 2, N_states
print*,'Delta E = ',E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1))
enddo
endif
E_CI_before(1:N_states) = CI_energy(1:N_states)
call ezfio_set_cas_sd_energy(CI_energy(1))
enddo
N_det = min(N_det_max,N_det)
touch N_det psi_det psi_coef
call diagonalize_CI
if(do_pt2_end)then
print*,'Last iteration only to compute the PT2'
threshold_selectors = 1.d0
threshold_generators = 0.999d0
call H_apply_CAS_S_PT2(pt2, norm_pert, H_pert_diag, N_st)
call H_apply_CAS_SD_PT2(pt2, norm_pert, H_pert_diag, N_st)
print *, 'Final step'
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, 'E = ', CI_energy(1:N_states)
print *, 'E+PT2 = ', CI_energy(1:N_states)+pt2(1:N_states)
print *, '-----'
call ezfio_set_cas_sd_energy_pt2(CI_energy(1)+pt2(1))
endif
integer :: exc_max, degree_min
exc_max = 0
print *, 'CAS determinants : ', N_det_cas
@ -79,6 +115,7 @@ program full_ci
call get_excitation_degree(psi_cas(1,1,k),psi_cas(1,1,i),degree,N_int)
exc_max = max(exc_max,degree)
enddo
print *, psi_coef_cas_diagonalized(i,:)
call debug_det(psi_cas(1,1,i),N_int)
print *, ''
enddo

View File

@ -1,7 +1,6 @@
program full_ci
implicit none
integer :: i,k
integer :: N_det_old
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:)
@ -11,9 +10,9 @@ program full_ci
character*(64) :: perturbation
PROVIDE N_det_cas
N_det_old = 0
pt2 = 1.d0
diag_algorithm = "Lapack"
if (N_det > N_det_max) then
call diagonalize_CI
call save_wavefunction
@ -30,36 +29,68 @@ program full_ci
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
endif
double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(N_states)
double precision :: E_CI_before(N_states)
if(read_wf)then
call i_H_psi(psi_det(1,1,N_det),psi_det,psi_coef,N_int,N_det,psi_det_size,N_states,i_H_psi_array)
h = diag_H_mat_elem(psi_det(1,1,N_det),N_int)
selection_criterion = dabs(psi_coef(N_det,1) * (i_H_psi_array(1) - h * psi_coef(N_det,1))) * 0.1d0
soft_touch selection_criterion
endif
integer :: n_det_before
print*,'Beginning the selection ...'
E_CI_before(1:N_states) = CI_energy(1:N_states)
do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max)
N_det_old = N_det
n_det_before = N_det
call H_apply_CAS_SD(pt2, norm_pert, H_pert_diag, N_st)
PROVIDE psi_coef
PROVIDE psi_det
PROVIDE psi_det_sorted
if (N_det > N_det_max) then
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
N_det = N_det_max
soft_touch N_det psi_det psi_coef
endif
call diagonalize_CI
call save_wavefunction
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
call ezfio_set_cas_sd_energy(CI_energy(1))
if (N_det == N_det_old) then
exit
endif
enddo
call diagonalize_CI
if (N_det > N_det_max) then
N_det = N_det_max
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
touch N_det psi_det psi_coef psi_det_sorted psi_coef_sorted psi_average_norm_contrib_sorted
endif
call save_wavefunction
if(n_det_before == N_det)then
selection_criterion = selection_criterion * 0.5d0
endif
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
do k = 1, N_states
print*,'State ',k
print *, 'PT2 = ', pt2(k)
print *, 'E = ', CI_energy(k)
print *, 'E(before)+PT2 = ', E_CI_before(k)+pt2(k)
enddo
print *, '-----'
if(N_states.gt.1)then
print*,'Variational Energy difference'
do i = 2, N_states
print*,'Delta E = ',CI_energy(i) - CI_energy(1)
enddo
endif
if(N_states.gt.1)then
print*,'Variational + perturbative Energy difference'
do i = 2, N_states
print*,'Delta E = ',E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1))
enddo
endif
E_CI_before(1:N_states) = CI_energy(1:N_states)
call ezfio_set_cas_sd_energy(CI_energy(1))
enddo
N_det = min(N_det_max,N_det)
touch N_det psi_det psi_coef
call diagonalize_CI
if(do_pt2_end)then
print*,'Last iteration only to compute the PT2'
threshold_selectors = 1.d0
@ -70,13 +101,12 @@ program full_ci
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, 'E = ', CI_energy(1:N_states)
print *, 'E+PT2 = ', CI_energy(1:N_states)+pt2(1:N_states)
print *, '-----'
call ezfio_set_cas_sd_energy_pt2(CI_energy(1)+pt2(1))
endif
integer :: exc_max, degree_min
exc_max = 0
print *, 'CAS determinants : ', N_det_cas
@ -85,6 +115,7 @@ program full_ci
call get_excitation_degree(psi_cas(1,1,k),psi_cas(1,1,i),degree,N_int)
exc_max = max(exc_max,degree)
enddo
print *, psi_coef_cas_diagonalized(i,:)
call debug_det(psi_cas(1,1,i),N_int)
print *, ''
enddo

View File

@ -12,6 +12,7 @@ program full_ci
pt2 = 1.d0
diag_algorithm = "Lapack"
if (N_det > N_det_max) then
call diagonalize_CI
call save_wavefunction
@ -28,32 +29,68 @@ program full_ci
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
endif
double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(N_states)
double precision :: E_CI_before(N_states)
if(read_wf)then
call i_H_psi(psi_det(1,1,N_det),psi_det,psi_coef,N_int,N_det,psi_det_size,N_states,i_H_psi_array)
h = diag_H_mat_elem(psi_det(1,1,N_det),N_int)
selection_criterion = dabs(psi_coef(N_det,1) * (i_H_psi_array(1) - h * psi_coef(N_det,1))) * 0.1d0
soft_touch selection_criterion
endif
integer :: n_det_before
print*,'Beginning the selection ...'
E_CI_before(1:N_states) = CI_energy(1:N_states)
do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max)
n_det_before = N_det
call H_apply_CAS_SD_selected(pt2, norm_pert, H_pert_diag, N_st)
PROVIDE psi_coef
PROVIDE psi_det
PROVIDE psi_det_sorted
if (N_det > N_det_max) then
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
N_det = N_det_max
soft_touch N_det psi_det psi_coef
endif
call diagonalize_CI
call save_wavefunction
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
call ezfio_set_cas_sd_energy(CI_energy(1))
enddo
call diagonalize_CI
if (N_det > N_det_max) then
N_det = N_det_max
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
touch N_det psi_det psi_coef psi_det_sorted psi_coef_sorted psi_average_norm_contrib_sorted
endif
call save_wavefunction
if(n_det_before == N_det)then
selection_criterion = selection_criterion * 0.5d0
endif
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
do k = 1, N_states
print*,'State ',k
print *, 'PT2 = ', pt2(k)
print *, 'E = ', CI_energy(k)
print *, 'E(before)+PT2 = ', E_CI_before(k)+pt2(k)
enddo
print *, '-----'
if(N_states.gt.1)then
print*,'Variational Energy difference'
do i = 2, N_states
print*,'Delta E = ',CI_energy(i) - CI_energy(1)
enddo
endif
if(N_states.gt.1)then
print*,'Variational + perturbative Energy difference'
do i = 2, N_states
print*,'Delta E = ',E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1))
enddo
endif
E_CI_before(1:N_states) = CI_energy(1:N_states)
call ezfio_set_cas_sd_energy(CI_energy(1))
enddo
N_det = min(N_det_max,N_det)
touch N_det psi_det psi_coef
call diagonalize_CI
if(do_pt2_end)then
print*,'Last iteration only to compute the PT2'
threshold_selectors = 1.d0
@ -64,13 +101,12 @@ program full_ci
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, 'E = ', CI_energy(1:N_states)
print *, 'E+PT2 = ', CI_energy(1:N_states)+pt2(1:N_states)
print *, '-----'
call ezfio_set_cas_sd_energy_pt2(CI_energy(1)+pt2(1))
endif
integer :: exc_max, degree_min
exc_max = 0
print *, 'CAS determinants : ', N_det_cas
@ -79,6 +115,7 @@ program full_ci
call get_excitation_degree(psi_cas(1,1,k),psi_cas(1,1,i),degree,N_int)
exc_max = max(exc_max,degree)
enddo
print *, psi_cas_coef(i,:)
call debug_det(psi_cas(1,1,i),N_int)
print *, ''
enddo

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 109 KiB

View File

@ -1 +1 @@
Selectors_full SingleRefMethod
Selectors_full SingleRefMethod Davidson

View File

@ -1 +1 @@
Selectors_full SingleRefMethod
Selectors_full SingleRefMethod Davidson

View File

@ -1 +1 @@
Selectors_full SingleRefMethod
Selectors_full SingleRefMethod Davidson

View File

@ -1 +1 @@
Determinants
Determinants Davidson

View File

@ -1 +1 @@
Perturbation Selectors_full Generators_CAS
Perturbation Selectors_full Generators_CAS Davidson

View File

@ -1 +1 @@
Determinants
Determinants Davidson

View File

@ -273,7 +273,8 @@ subroutine H_apply_dressed_pert_monoexc(key_in, hole_1,particl_1,i_generator,ipr
integer,parameter :: size_max = 3072
integer, intent(in) :: Ndet_generators
double precision, intent(in) :: delta_ij_generators_(Ndet_generators,Ndet_generators),E_ref
double precision, intent(inout) :: E_ref
double precision, intent(inout) :: delta_ij_generators_(Ndet_generators,Ndet_generators)
integer(bit_kind), intent(in) :: psi_det_generators_input(N_int,2,Ndet_generators)
integer ,intent(in) :: i_generator
@ -437,8 +438,9 @@ subroutine H_apply_dressed_pert(delta_ij_generators_, Ndet_generators,psi_det_g
integer, intent(in) :: Ndet_generators
double precision, intent(inout) :: E_ref
double precision, intent(inout) :: delta_ij_generators_(Ndet_generators,Ndet_generators)
integer(bit_kind), intent(in) :: psi_det_generators_input(N_int,2,Ndet_generators)
double precision, intent(in) :: delta_ij_generators_(Ndet_generators,Ndet_generators),E_ref
integer :: i_generator, nmax

View File

@ -1 +1 @@
Perturbation Selectors_no_sorted Hartree_Fock
Perturbation Selectors_no_sorted Hartree_Fock Davidson CISD

View File

@ -40,7 +40,7 @@ subroutine dressing_1h1p(dets_in,u_in,diag_H_elements,dim_in,sze,N_st,Nint,conve
double precision :: phase
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i_ok
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral_schwartz
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral
double precision :: hij,c_ref,contrib
integer :: iorb
@ -231,7 +231,7 @@ subroutine dressing_1h1p_by_2h2p(dets_in,u_in,diag_H_elements,dim_in,sze,N_st,Ni
double precision :: phase
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i_ok
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral_schwartz
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral
double precision :: hij,c_ref,contrib
integer :: iorb
@ -409,7 +409,7 @@ subroutine dressing_1h1p_full(dets_in,u_in,H_matrix,dim_in,sze,N_st,Nint,converg
double precision :: phase
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i_ok
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral_schwartz
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral
double precision :: hij,c_ref,contrib
integer :: iorb
@ -603,6 +603,7 @@ subroutine SC2_1h1p_full(dets_in,u_in,energies,H_matrix,dim_in,sze,N_st,Nint,con
double precision, intent(in) :: convergence
integer :: i,j,iter
print*,'sze = ',sze
H_matrix = 0.d0
do iter = 1, 1
! if(sze<=N_det_max_jacobi)then
double precision, allocatable :: eigenvectors(:,:), eigenvalues(:),H_matrix_tmp(:,:)
@ -662,6 +663,7 @@ subroutine SC2_1h1p(dets_in,u_in,energies,diag_H_elements,dim_in,sze,N_st,Nint,c
double precision :: extra_diag_H_elements(dim_in)
double precision, intent(in) :: convergence
integer :: i,j,iter
DIAG_H_ELEMENTS = 0.d0
do iter = 1, 1
! call dressing_1h1p(dets_in,u_in,diag_H_elements,dim_in,sze,N_st,Nint,convergence)
call dressing_1h1p_by_2h2p(dets_in,u_in,extra_diag_H_elements,dim_in,sze,N_st,Nint,convergence)
@ -740,7 +742,7 @@ subroutine density_matrix_1h1p(dets_in,u_in,density_matrix_alpha,density_matrix_
double precision :: phase
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i_ok
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral_schwartz
double precision :: phase_single_double,phase_double_hf,get_mo_bielec_integral
double precision :: hij,c_ref,contrib
integer :: iorb

View File

@ -30,7 +30,7 @@ subroutine all_single(e_pt2)
print*,'N_det_generators = ',N_det_generators
pt2=-1.d0
print*, 'ref_bitmask_energy =',ref_bitmask_energy
print*, 'CI_expectation_value =',CI_expectation_value(1)
print*, 'CI_expectation_value =',psi_energy(1)
E_before = ref_bitmask_energy
print*,'Initial Step '

View File

@ -15,7 +15,7 @@
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i,j,k,l
integer :: i_hole,j_hole,k_part,l_part
double precision :: get_mo_bielec_integral_schwartz,hij,delta_e,exc,contrib
double precision :: get_mo_bielec_integral,hij,delta_e,exc,contrib
double precision :: diag_H_mat_elem
integer :: i_ok,ispin
! Alpha - Beta correlation energy
@ -46,7 +46,7 @@
if(i_ok .ne.1)cycle
delta_e = (ref_bitmask_energy - diag_H_mat_elem(key_tmp,N_int))
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
contrib = hij*hij/delta_e
total_corr_e_2h2p += contrib
! Single orbital contribution
@ -81,8 +81,8 @@
k_part = list_virt(k)
do l = k+1,n_virt_orb
l_part = list_virt(l)
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral_schwartz(i_hole,j_hole,l_part,k_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral(i_hole,j_hole,l_part,k_part,mo_integrals_map)
key_tmp = ref_bitmask
ispin = 1
call do_mono_excitation(key_tmp,i_hole,k_part,ispin,i_ok)
@ -114,8 +114,8 @@
k_part = list_virt(k)
do l = k+1,n_virt_orb
l_part = list_virt(l)
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral_schwartz(i_hole,j_hole,l_part,k_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral(i_hole,j_hole,l_part,k_part,mo_integrals_map)
key_tmp = ref_bitmask
ispin = 2
call do_mono_excitation(key_tmp,i_hole,k_part,ispin,i_ok)
@ -161,7 +161,7 @@ END_PROVIDER
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i,j,k,l
integer :: i_hole,j_hole,k_part,l_part
double precision :: get_mo_bielec_integral_schwartz,hij,delta_e,exc,contrib
double precision :: get_mo_bielec_integral,hij,delta_e,exc,contrib
double precision :: diag_H_mat_elem
integer :: i_ok,ispin
! Alpha - Beta correlation energy
@ -191,7 +191,7 @@ END_PROVIDER
if(i_ok .ne.1)cycle
delta_e = -(ref_bitmask_energy - diag_H_mat_elem(key_tmp,N_int))
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
contrib = 0.5d0 * (delta_e - dsqrt(delta_e * delta_e + 4.d0 * hij*hij))
total_corr_e_2h1p += contrib
corr_energy_2h1p_ab_bb_per_2_orb(i_hole,j_hole) += contrib
@ -211,8 +211,8 @@ END_PROVIDER
k_part = list_act(k)
do l = 1,n_virt_orb
l_part = list_virt(l)
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral_schwartz(i_hole,j_hole,l_part,k_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral(i_hole,j_hole,l_part,k_part,mo_integrals_map)
key_tmp = ref_bitmask
ispin = 1
call do_mono_excitation(key_tmp,i_hole,k_part,ispin,i_ok)
@ -241,8 +241,8 @@ END_PROVIDER
k_part = list_act(k)
do l = 1,n_virt_orb
l_part = list_virt(l)
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral_schwartz(i_hole,j_hole,l_part,k_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral(i_hole,j_hole,l_part,k_part,mo_integrals_map)
key_tmp = ref_bitmask
ispin = 2
call do_mono_excitation(key_tmp,i_hole,k_part,ispin,i_ok)
@ -276,7 +276,7 @@ END_PROVIDER
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i,j,k,l
integer :: i_hole,j_hole,k_part,l_part
double precision :: get_mo_bielec_integral_schwartz,hij,delta_e,exc,contrib
double precision :: get_mo_bielec_integral,hij,delta_e,exc,contrib
double precision :: diag_H_mat_elem
integer :: i_ok,ispin
! Alpha - Beta correlation energy
@ -302,7 +302,7 @@ END_PROVIDER
if(i_ok .ne.1)cycle
delta_e = -(ref_bitmask_energy - diag_H_mat_elem(key_tmp,N_int))
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
contrib = 0.5d0 * (delta_e - dsqrt(delta_e * delta_e + 4.d0 * hij*hij))
total_corr_e_1h2p += contrib
@ -324,8 +324,8 @@ END_PROVIDER
k_part = list_act(k)
do l = i+1,n_virt_orb
l_part = list_virt(l)
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral_schwartz(i_hole,j_hole,l_part,k_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral(i_hole,j_hole,l_part,k_part,mo_integrals_map)
key_tmp = ref_bitmask
ispin = 1
@ -356,8 +356,8 @@ END_PROVIDER
k_part = list_act(k)
do l = i+1,n_virt_orb
l_part = list_virt(l)
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral_schwartz(i_hole,j_hole,l_part,k_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
exc = get_mo_bielec_integral(i_hole,j_hole,l_part,k_part,mo_integrals_map)
key_tmp = ref_bitmask
ispin = 2
@ -388,7 +388,7 @@ END_PROVIDER
integer(bit_kind) :: key_tmp(N_int,2)
integer :: i,j,k,l
integer :: i_hole,j_hole,k_part,l_part
double precision :: get_mo_bielec_integral_schwartz,hij,delta_e,exc,contrib
double precision :: get_mo_bielec_integral,hij,delta_e,exc,contrib
double precision :: diag_H_mat_elem
integer :: i_ok,ispin
! Alpha - Beta correlation energy
@ -412,7 +412,7 @@ END_PROVIDER
if(i_ok .ne.1)cycle
delta_e = -(ref_bitmask_energy - diag_H_mat_elem(key_tmp,N_int))
hij = get_mo_bielec_integral_schwartz(i_hole,j_hole,k_part,l_part,mo_integrals_map)
hij = get_mo_bielec_integral(i_hole,j_hole,k_part,l_part,mo_integrals_map)
contrib = 0.5d0 * (delta_e - dsqrt(delta_e * delta_e + 4.d0 * hij*hij))
total_corr_e_1h1p_spin_flip += contrib

View File

@ -38,7 +38,7 @@ end
subroutine diag_inactive_virt_new_and_update_mos
implicit none
integer :: i,j,i_inact,j_inact,i_virt,j_virt,k,k_act
double precision :: tmp(mo_tot_num_align,mo_tot_num),accu,get_mo_bielec_integral_schwartz
double precision :: tmp(mo_tot_num_align,mo_tot_num),accu,get_mo_bielec_integral
character*(64) :: label
tmp = 0.d0
do i = 1, mo_tot_num
@ -52,8 +52,8 @@ subroutine diag_inactive_virt_new_and_update_mos
accu =0.d0
do k = 1, n_act_orb
k_act = list_act(k)
accu += get_mo_bielec_integral_schwartz(i_inact,k_act,j_inact,k_act,mo_integrals_map)
accu -= get_mo_bielec_integral_schwartz(i_inact,k_act,k_act,j_inact,mo_integrals_map)
accu += get_mo_bielec_integral(i_inact,k_act,j_inact,k_act,mo_integrals_map)
accu -= get_mo_bielec_integral(i_inact,k_act,k_act,j_inact,mo_integrals_map)
enddo
tmp(i_inact,j_inact) = Fock_matrix_mo(i_inact,j_inact) + accu
tmp(j_inact,i_inact) = Fock_matrix_mo(j_inact,i_inact) + accu
@ -67,7 +67,7 @@ subroutine diag_inactive_virt_new_and_update_mos
accu =0.d0
do k = 1, n_act_orb
k_act = list_act(k)
accu += get_mo_bielec_integral_schwartz(i_virt,k_act,j_virt,k_act,mo_integrals_map)
accu += get_mo_bielec_integral(i_virt,k_act,j_virt,k_act,mo_integrals_map)
enddo
tmp(i_virt,j_virt) = Fock_matrix_mo(i_virt,j_virt) - accu
tmp(j_virt,i_virt) = Fock_matrix_mo(j_virt,i_virt) - accu

View File

@ -212,16 +212,16 @@ subroutine dress_H_matrix_from_psi_det_input(psi_det_generators_input,Ndet_gener
call lapack_diagd(eigvalues,eigvectors,dressed_H_matrix,Ndet_generators,Ndet_generators) ! Diagonalize the Dressed_H_matrix
double precision :: s2,E_ref(N_states)
double precision :: s2(N_det_generators),E_ref(N_states)
integer :: i_state(N_states)
integer :: n_state_good
n_state_good = 0
if(s2_eig)then
call u_0_S2_u_0(s2,eigvectors,Ndet_generators,psi_det_generators_input,N_int,N_det_generators,size(eigvectors,1))
do i = 1, Ndet_generators
call get_s2_u0(psi_det_generators_input,eigvectors(1,i),Ndet_generators,Ndet_generators,s2)
print*,'s2 = ',s2
print*,dabs(s2-expected_s2)
if(dabs(s2-expected_s2).le.0.3d0)then
print*,'s2 = ',s2(i)
print*,dabs(s2(i)-expected_s2)
if(dabs(s2(i)-expected_s2).le.0.3d0)then
n_state_good +=1
i_state(n_state_good) = i
E_ref(n_state_good) = eigvalues(i)
@ -279,7 +279,6 @@ subroutine dress_H_matrix_from_psi_det_input(psi_det_generators_input,Ndet_gener
integer :: i_good_state(0:N_states)
i_good_state(0) = 0
do i = 1, Ndet_generators
call get_s2_u0(psi_det_generators_input,eigvectors(1,i),Ndet_generators,Ndet_generators,s2)
! State following
do k = 1, N_states
accu = 0.d0
@ -387,7 +386,7 @@ subroutine fill_H_apply_buffer_no_selection_first_order_coef(n_selected,det_buff
call i_H_psi(det_buffer(1,1,i),psi_selectors,psi_selectors_coef,N_int,N_det_selectors,psi_selectors_size,N_states,i_H_psi_array)
call i_H_j(det_buffer(1,1,i),det_buffer(1,1,i),N_int,h)
do j=1,N_states
delta_e = -1.d0 /(h - CI_expectation_value(j))
delta_e = -1.d0 /(h - psi_energy(j))
H_apply_buffer(iproc)%coef(i+H_apply_buffer(iproc)%N_det,j) = i_H_psi_array(j) * delta_e
enddo
enddo

View File

@ -1,83 +0,0 @@
program test_sc2
implicit none
read_wf = .True.
touch read_wf
call routine
end
subroutine routine
implicit none
double precision, allocatable :: energies(:),diag_H_elements(:)
double precision, allocatable :: H_matrix(:,:)
allocate(energies(N_states),diag_H_elements(N_det))
call diagonalize_CI
call test_hcc
call test_mulliken
call SC2_1h1p(psi_det,psi_coef,energies, &
diag_H_elements,size(psi_coef,1),N_det,N_states_diag,N_int,threshold_convergence_SC2)
! allocate(H_matrix(N_det,N_det))
! call SC2_1h1p_full(psi_det,psi_coef,energies, &
! H_matrix,size(psi_coef,1),N_det,N_states_diag,N_int,threshold_convergence_SC2)
! deallocate(H_matrix)
integer :: i,j
double precision :: accu,coef_hf
! coef_hf = 1.d0/psi_coef(1,1)
! do i = 1, N_det
! psi_coef(i,1) *= coef_hf
! enddo
touch psi_coef
call pouet
end
subroutine pouet
implicit none
double precision :: accu,coef_hf
provide one_body_dm_mo_alpha one_body_dm_mo_beta
! call density_matrix_1h1p(psi_det,psi_coef,one_body_dm_mo_alpha,one_body_dm_mo_beta,accu,size(psi_coef,1),N_det,N_states_diag,N_int)
! touch one_body_dm_mo_alpha one_body_dm_mo_beta
call test_hcc
call test_mulliken
call save_wavefunction
end
subroutine test_hcc
implicit none
double precision :: accu
integer :: i,j
print*,'Z AU GAUSS MHZ cm^-1'
do i = 1, nucl_num
write(*,'(I2,X,F3.1,X,4(F16.6,X))')i,nucl_charge(i),spin_density_at_nucleous(i),iso_hcc_gauss(i),iso_hcc_mhz(i),iso_hcc_cm_1(i)
enddo
end
subroutine test_mulliken
double precision :: accu
integer :: i
integer :: j
accu= 0.d0
do i = 1, nucl_num
print*,i,nucl_charge(i),mulliken_spin_densities(i)
accu += mulliken_spin_densities(i)
enddo
print*,'Sum of Mulliken SD = ',accu
!print*,'AO SPIN POPULATIONS'
accu = 0.d0
!do i = 1, ao_num
! accu += spin_gross_orbital_product(i)
! write(*,'(X,I3,X,A4,X,I2,X,A4,X,F10.7)')i,trim(element_name(int(nucl_charge(ao_nucl(i))))),ao_nucl(i),trim(l_to_charater(ao_l(i))),spin_gross_orbital_product(i)
!enddo
!print*,'sum = ',accu
!accu = 0.d0
!print*,'Angular momentum analysis'
!do i = 0, ao_l_max
! accu += spin_population_angular_momentum(i)
! print*,' ',trim(l_to_charater(i)),spin_population_angular_momentum(i)
!print*,'sum = ',accu
!enddo
end

Some files were not shown because too many files have changed in this diff Show More