diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..b213de7b --- /dev/null +++ b/.drone.yml @@ -0,0 +1,28 @@ +--- +kind: pipeline +type: docker +name: default + +clone: + depth: 10 + +steps: + +- name: configure + image: scemama666/qp2_env + commands: + - ./configure -i all -c ./config/gfortran_debug.cfg + - bash -c "source quantum_package.rc ; qp plugins download https://gitlab.com/scemama/qp_plugins_scemama" + - bash -c "source quantum_package.rc ; qp plugins install champ" + +- name: compile + image: scemama666/qp2_env + commands: + - bash -c "source quantum_package.rc ; exec ninja" + +- name: testing + image: scemama666/qp2_env + commands: + - bash -c "source quantum_package.rc ; qp test -a" + + diff --git a/drone/Docker/README.md b/drone/Docker/README.md new file mode 100644 index 00000000..eb569777 --- /dev/null +++ b/drone/Docker/README.md @@ -0,0 +1,8 @@ +Docker files to build the containers used with DroneCI. + +Example: +``` +docker build -t ubuntu/qp2_env . + +``` + diff --git a/drone/Docker/Ubuntu/Dockerfile b/drone/Docker/Ubuntu/Dockerfile new file mode 100644 index 00000000..05d87ad8 --- /dev/null +++ b/drone/Docker/Ubuntu/Dockerfile @@ -0,0 +1,27 @@ +ARG UBUNTU_VERSION=20.04 +FROM ubuntu:${UBUNTU_VERSION} AS builder + +# Timezone for tzdata +ARG tz=Etc/UTC +RUN echo $tz > /etc/timezone && rm -rf /etc/localtime + +# Install +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + git \ + curl \ + wget \ + python3 \ + gfortran \ + gcc \ + g++ \ + make \ + build-essential \ + rsync \ + unzip \ + libopenblas-dev \ + pkg-config \ + m4 + +RUN ln -s /usr/bin/python3 /usr/bin/python + + diff --git a/travis/compilation.sh b/drone/compilation.sh similarity index 100% rename from travis/compilation.sh rename to drone/compilation.sh diff --git a/travis/configuration.sh b/drone/configuration.sh similarity index 100% rename from travis/configuration.sh rename to drone/configuration.sh diff --git a/drone/drone_docker.yml b/drone/drone_docker.yml new file mode 100644 index 00000000..d1eb7175 --- /dev/null +++ b/drone/drone_docker.yml @@ -0,0 +1,30 @@ +--- +kind: pipeline +type: docker +name: default + +clone: + depth: 10 + +steps: +- name: configure + pull: never + image: ubuntu/qp2_env + commands: + - ./configure -i all -c ./config/gfortran_debug.cfg + - source quantum_package.rc ; qp plugins download https://gitlab.com/scemama/qp_plugins_scemama + - source quantum_package.rc ; qp plugins install champ + +- name: compile + pull: never + image: ubuntu/qp2_env + commands: + - ninja + +- name: testing + pull: never + image: ubuntu/qp2_env + commands: + - qp test + + diff --git a/drone/drone_ssh.yml b/drone/drone_ssh.yml new file mode 100644 index 00000000..99397f11 --- /dev/null +++ b/drone/drone_ssh.yml @@ -0,0 +1,29 @@ +kind: pipeline +type: ssh +name: default + +clone: + depth: 10 + +server: + host: 130.120.229.139 + user: test + password: + from_secret: ssh_pass + +steps: +- name: configure + commands: + - ./configure -i all -c ./config/gfortran_debug.cfg + - source quantum_package.rc ; qp plugins download https://gitlab.com/scemama/qp_plugins_scemama + - source quantum_package.rc ; qp plugins install champ + +- name: compile + commands: + - ninja + +- name: testing + commands: + - qp test + + diff --git a/travis/testing.sh b/drone/testing.sh similarity index 100% rename from travis/testing.sh rename to drone/testing.sh diff --git a/src/cipsi/EZFIO.cfg b/src/cipsi/EZFIO.cfg index 7fcf19eb..e01359c5 100644 --- a/src/cipsi/EZFIO.cfg +++ b/src/cipsi/EZFIO.cfg @@ -34,3 +34,9 @@ doc: Maximum number of excitation for beta determinants with respect to the Hart interface: ezfio,ocaml,provider default: -1 +[twice_hierarchy_max] +type: integer +doc: Twice the maximum hierarchy parameter (excitation degree plus half the seniority number). Using -1 selects all determinants +interface: ezfio,ocaml,provider +default: -1 + diff --git a/src/cipsi/selection.irp.f b/src/cipsi/selection.irp.f index 342f759f..7417dd05 100644 --- a/src/cipsi/selection.irp.f +++ b/src/cipsi/selection.irp.f @@ -713,6 +713,25 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d if (do_cycle) cycle endif + if (twice_hierarchy_max >= 0) then + s = 0 + do k=1,N_int + s = s + popcnt(ieor(det(k,1),det(k,2))) + enddo + if ( mod(s,2)>0 ) stop 'For now, hierarchy CI is defined only for an even number of electrons' + if (excitation_ref == 1) then + call get_excitation_degree(HF_bitmask,det(1,1),degree,N_int) + else if (excitation_ref == 2) then + stop 'For now, hierarchy CI is defined only for a single reference determinant' +! do k=1,N_dominant_dets_of_cfgs +! call get_excitation_degree(dominant_dets_of_cfgs(1,1,k),det(1,1),degree,N_int) +! enddo + endif + integer :: twice_hierarchy + twice_hierarchy = degree + s/2 + if (twice_hierarchy > twice_hierarchy_max) cycle + endif + Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),det,fock_diag_tmp,N_int) w = 0d0 diff --git a/src/fci/40.fci.bats b/src/fci/40.fci.bats index f2c78067..1a0c5507 100644 --- a/src/fci/40.fci.bats +++ b/src/fci/40.fci.bats @@ -59,43 +59,43 @@ function run_stoch() { @test "HCO" { # 12.2868s qp set_file hco.ezfio - run -113.389297812482 6.e-4 100000 + run -113.393356604085 1.e-3 100000 } @test "H2O2" { # 12.9214s qp set_file h2o2.ezfio qp set_mo_class --core="[1-2]" --act="[3-24]" --del="[25-38]" - run -151.00467 1.e-4 100000 + run -151.005848404095 1.e-3 100000 } @test "HBO" { # 13.3144s [[ -n $TRAVIS ]] && skip qp set_file hbo.ezfio - run -100.212560384678 1.e-3 100000 + run -100.214099486337 1.e-3 100000 } @test "H2O" { # 11.3727s [[ -n $TRAVIS ]] && skip qp set_file h2o.ezfio - run -76.2361605151999 3.e-4 100000 + run -76.2361605151999 5.e-4 100000 } @test "ClO" { # 13.3755s [[ -n $TRAVIS ]] && skip qp set_file clo.ezfio - run -534.545616787223 3.e-4 100000 + run -534.546453546852 1.e-3 100000 } @test "SO" { # 13.4952s [[ -n $TRAVIS ]] && skip qp set_file so.ezfio - run -26.0096209515081 1.e-3 100000 + run -26.0176563764039 1.e-3 100000 } @test "H2S" { # 13.6745s [[ -n $TRAVIS ]] && skip qp set_file h2s.ezfio - run -398.859168655255 3.e-4 100000 + run -398.859577605891 5.e-4 100000 } @test "OH" { # 13.865s @@ -113,13 +113,13 @@ function run_stoch() { @test "H3COH" { # 14.7299s [[ -n $TRAVIS ]] && skip qp set_file h3coh.ezfio - run -115.205191406072 3.e-4 100000 + run -115.205632960026 1.e-3 100000 } @test "SiH3" { # 15.99s [[ -n $TRAVIS ]] && skip qp set_file sih3.ezfio - run -5.57241217753818 3.e-4 100000 + run -5.57241217753818 5.e-4 100000 } @test "CH4" { # 16.1612s @@ -132,28 +132,28 @@ function run_stoch() { @test "ClF" { # 16.8864s [[ -n $TRAVIS ]] && skip qp set_file clf.ezfio - run -559.169313755572 3.e-4 100000 + run -559.169748890031 1.5e-3 100000 } @test "SO2" { # 17.5645s [[ -n $TRAVIS ]] && skip qp set_file so2.ezfio qp set_mo_class --core="[1-8]" --act="[9-87]" - run -41.5746738713298 3.e-4 100000 + run -41.5746738713298 1.5e-3 100000 } @test "C2H2" { # 17.6827s [[ -n $TRAVIS ]] && skip qp set_file c2h2.ezfio qp set_mo_class --act="[1-30]" --del="[31-36]" - run -12.3685464085969 3.e-4 100000 + run -12.3685464085969 2.e-3 100000 } @test "N2" { # 18.0198s [[ -n $TRAVIS ]] && skip qp set_file n2.ezfio qp set_mo_class --core="[1,2]" --act="[3-40]" --del="[41-60]" - run -109.28681540699360 3.e-4 100000 + run -109.287917088107 1.5e-3 100000 } @test "N2H4" { # 18.5006s @@ -167,7 +167,7 @@ function run_stoch() { [[ -n $TRAVIS ]] && skip qp set_file co2.ezfio qp set_mo_class --core="[1,2]" --act="[3-30]" --del="[31-42]" - run -187.968547952413 3.e-4 100000 + run -187.970184372047 1.5e-3 100000 } @@ -182,6 +182,6 @@ function run_stoch() { [[ -n $TRAVIS ]] && skip qp set_file hcn.ezfio qp set_mo_class --core="[1,2]" --act="[3-40]" --del="[41-55]" - run -93.0771143355433 3.e-4 100000 + run -93.0777619629755 1.e-3 100000 }