From 75ca9b2160f4b69bd267c7214e6b83dd19a0c34d Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Wed, 2 Jan 2019 16:10:15 +0100 Subject: [PATCH] added 21.rsks.bats --- docs/source/intro/intro.rst | 5 +- docs/source/modules/becke_numerical_grid.rst | 54 ++++++++++++++----- docs/source/modules/tools.rst | 14 +++++ .../programmers_guide/index_providers.rst | 2 + docs/source/research.bib | 14 +++++ .../grid_becke_vector.irp.f | 2 +- src/cis/cis.irp.f | 6 +++ src/dft_utils_one_e/sr_pot_ao.irp.f | 1 - src/hartree_fock/scf.irp.f | 1 + src/kohn_sham_rs/21.rsks.bats | 37 +++++++++++++ src/kohn_sham_rs/rs_ks_scf.irp.f | 4 +- src/scf_utils/roothaan_hall_scf.irp.f | 4 +- 12 files changed, 124 insertions(+), 20 deletions(-) create mode 100644 src/kohn_sham_rs/21.rsks.bats diff --git a/docs/source/intro/intro.rst b/docs/source/intro/intro.rst index a0a76c05..b5872309 100644 --- a/docs/source/intro/intro.rst +++ b/docs/source/intro/intro.rst @@ -55,14 +55,17 @@ Multiple programs were developed with the |qp|, such as: - Selected Full-CI + Epstein-Nesbet PT2 (CIPSI) :cite:`Caffarel_2016,Caffarel_2016.2,Loos_2018,Scemama_2018,Dash_2018` - Hybrid stochastic/deterministic MR-PT2 :cite:`Garniron_2017.2,Loos_2018` +- Orbital optimization for open-shell systems :cite:`Giner2016Mar,Giner_2017.3` - CIS, CISD, MP2 - Selected CISD - Jeziorsky-Monkhorst MR-PT2 :cite:`Giner_2017` +- Effective Hamiltonian for variational MR wave functions :cite:`Giner_2017.2` - Selected CAS+SD - Selected difference-dedicated CI (DD-CI) - Multi-Reference Coupled Cluster (MR-CCSD) :cite:`Giner_2016,Garniron_2017` - Shifted-Bk with CIPSI :cite:`Garniron_2018` -- CIPSI with range-separated DFT +- CIPSI with range-separated DFT (plugins at ``_) +- DFT for basis set corrections :cite:`Giner_2018` All these programs can generate ground and excited states, and spin pure wave functions (eigenstates of |S^2|). diff --git a/docs/source/modules/becke_numerical_grid.rst b/docs/source/modules/becke_numerical_grid.rst index d83dee68..f842c0ca 100644 --- a/docs/source/modules/becke_numerical_grid.rst +++ b/docs/source/modules/becke_numerical_grid.rst @@ -10,13 +10,17 @@ becke_numerical_grid This module contains all quantities needed to build the Becke's grid used in general for DFT integration. Note that it can be used for whatever integration in R^3 as long as the functions to be integrated are mostly concentrated near the atomic regions. -This grid is built as the reunion of a spherical grid around each atom. Each spherical grid contains a certain number of radial and angular points. +This grid is built as the reunion of a spherical grid around each atom. Each spherical grid contains +a certain number of radial and angular points. No pruning is done on the angular part of the grid. +The main keyword for that modue is: + +* :option:`becke_numerical_grid grid_type_sgn` which controls the precision of the grid according the standard **SG-n** grids. This keyword controls the two providers `n_points_integration_angular` `n_points_radial_grid`. The main providers of that module are: -* :option:`becke_numerical_grid n_points_integration_angular` which is the number of angular integration points. WARNING: it obeys to specific rules so it cannot be any integer number. Some of the possible values are [ 50 | 74 | 266 | 590 | 1202 | 2030 | 5810 ] for instance. See :file:`angular.f` for more details. -* :option:`becke_numerical_grid n_points_radial_grid` which is the number of radial angular points. This can be any strictly positive integer. Nevertheless, a minimum of 50 is in general necessary. +* `n_points_integration_angular` which is the number of angular integration points. WARNING: it obeys to specific rules so it cannot be any integer number. Some of the possible values are [ 50 | 74 | 170 | 194 | 266 | 302 | 590 | 1202 | 2030 | 5810 ] for instance. See :file:`angular.f` for more details. +* `n_points_radial_grid` which is the number of radial angular points. This can be any strictly positive integer. Nevertheless, a minimum of 50 is in general necessary. * `final_grid_points` which are the (x,y,z) coordinates of the grid points. * `final_weight_at_r_vector` which are the weights at each grid point @@ -78,17 +82,11 @@ See next section for explanations and citation policies. EZFIO parameters ---------------- -.. option:: n_points_integration_angular +.. option:: grid_type_sgn - Number of angular points per atom for 3d numerical integration, needed for DFT for example [ 50 | 74 | 266 | 590 | 1202 | 2030 | 5810 ] + Type of grid used for the Becke's numerical grid. Can be, by increasing accuracy: [ 0 | 1 | 2 | 3 ] - Default: 590 - -.. option:: n_points_radial_grid - - Number of radial points per atom for 3d numerical integration, needed for DFT for example - - Default: 60 + Default: 2 Providers @@ -291,6 +289,38 @@ Providers +.. c:var:: n_points_integration_angular + + .. code:: text + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + File: :file:`grid_becke.irp.f` + + n_points_radial_grid = number of radial grid points per atom + n_points_integration_angular = number of angular grid points per atom + These numbers are automatically set by setting the grid_type_sgn parameter + + + + +.. c:var:: n_points_radial_grid + + .. code:: text + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + File: :file:`grid_becke.irp.f` + + n_points_radial_grid = number of radial grid points per atom + n_points_integration_angular = number of angular grid points per atom + These numbers are automatically set by setting the grid_type_sgn parameter + + + + .. c:var:: weight_at_r .. code:: text diff --git a/docs/source/modules/tools.rst b/docs/source/modules/tools.rst index d9eb8f11..a482ae31 100644 --- a/docs/source/modules/tools.rst +++ b/docs/source/modules/tools.rst @@ -73,6 +73,20 @@ Subroutines / functions +.. c:function:: print_r2 + + .. code:: text + + subroutine print_r2 + + File: :file:`print_r2.irp.f` + + + + + + + .. c:function:: print_wf .. code:: text diff --git a/docs/source/programmers_guide/index_providers.rst b/docs/source/programmers_guide/index_providers.rst index f8c208bb..9712c9d7 100644 --- a/docs/source/programmers_guide/index_providers.rst +++ b/docs/source/programmers_guide/index_providers.rst @@ -258,6 +258,7 @@ Index of Providers * :c:data:`grad_aos_dvx_beta_pbe_w` * :c:data:`grid_points_per_atom` * :c:data:`grid_points_radial` +* :c:data:`grid_type_sgn` * :c:data:`h0_type` * :c:data:`h_apply_buffer_allocated` * :c:data:`h_apply_buffer_lock` @@ -1156,6 +1157,7 @@ Index of Subroutines/Functions * :c:func:`print_generators_bitmasks_particles` * :c:func:`print_generators_bitmasks_particles_for_one_generator` * :c:func:`print_memory_usage` +* :c:func:`print_r2` * :c:func:`print_spindet` * :c:func:`print_summary` * :c:func:`print_wf` diff --git a/docs/source/research.bib b/docs/source/research.bib index 28b072a9..1676cf24 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -177,6 +177,20 @@ title = {Orthogonal Valence Bond Hamiltonians incorporating dynamical correlation effects}, journal = {Computational and Theoretical Chemistry} } + +@article{Giner_2017.3, +author = {Giner, Emmanuel and Tenti, Lorenzo and Angeli, Celestino and Ferré, Nicolas}, +title = {Computation of the Isotropic Hyperfine Coupling Constant: Efficiency and Insights from a New Approach Based on Wave Function Theory}, +journal = {Journal of Chemical Theory and Computation}, +volume = {13}, +number = {2}, +pages = {475-487}, +year = {2017}, +doi = {10.1021/acs.jctc.6b00827}, +note ={PMID: 28094936}, +URL = {https://doi.org/10.1021/acs.jctc.6b00827}, +eprint = {https://doi.org/10.1021/acs.jctc.6b00827} +} @article{Giner2016Mar, author = {Giner, Emmanuel and Angeli, Celestino}, title = {{Spin density and orbital optimization in open shell systems: A rational and computationally efficient proposal}}, diff --git a/src/becke_numerical_grid/grid_becke_vector.irp.f b/src/becke_numerical_grid/grid_becke_vector.irp.f index cf86121a..2655c100 100644 --- a/src/becke_numerical_grid/grid_becke_vector.irp.f +++ b/src/becke_numerical_grid/grid_becke_vector.irp.f @@ -20,7 +20,7 @@ BEGIN_PROVIDER [integer, n_points_final_grid] enddo enddo print*,'n_points_final_grid = ',n_points_final_grid - print*,'n max point = ',n_points_integration_angular*n_points_radial_grid*nucl_num + print*,'n max point = ',n_points_integration_angular*(n_points_radial_grid*nucl_num - 1) END_PROVIDER BEGIN_PROVIDER [double precision, final_grid_points, (3,n_points_final_grid)] diff --git a/src/cis/cis.irp.f b/src/cis/cis.irp.f index fab81736..55d34cce 100644 --- a/src/cis/cis.irp.f +++ b/src/cis/cis.irp.f @@ -18,6 +18,12 @@ subroutine run print *, 'energy = ',CI_energy(i) print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy enddo + print*,'******************************' + print*,'Excitation energy ' + do i = 2, N_states + print*, i ,CI_energy(i) - CI_energy(1) + enddo + call ezfio_set_cis_energy(CI_energy) psi_coef = ci_eigenvectors SOFT_TOUCH psi_coef diff --git a/src/dft_utils_one_e/sr_pot_ao.irp.f b/src/dft_utils_one_e/sr_pot_ao.irp.f index 1b786cac..36fa3f47 100644 --- a/src/dft_utils_one_e/sr_pot_ao.irp.f +++ b/src/dft_utils_one_e/sr_pot_ao.irp.f @@ -52,7 +52,6 @@ call dgemm('N','N',ao_num,ao_num,n_points_final_grid,1.d0,aos_in_r_array,ao_num,aos_sr_vx_beta_LDA_w(1,1,istate) ,n_points_final_grid,0.d0,potential_sr_x_beta_ao_LDA(1,1,istate),ao_num) enddo call wall_time(wall_2) - print*,'time to provide potential_sr_x/c_alpha/beta_ao_LDA = ',wall_2 - wall_1 END_PROVIDER diff --git a/src/hartree_fock/scf.irp.f b/src/hartree_fock/scf.irp.f index 9cf8abcf..d735bb89 100644 --- a/src/hartree_fock/scf.irp.f +++ b/src/hartree_fock/scf.irp.f @@ -58,6 +58,7 @@ subroutine run ! Choose SCF algorithm call Roothaan_Hall_SCF + call ezfio_set_hartree_fock_energy(SCF_energy) end diff --git a/src/kohn_sham_rs/21.rsks.bats b/src/kohn_sham_rs/21.rsks.bats new file mode 100644 index 00000000..e0d62d10 --- /dev/null +++ b/src/kohn_sham_rs/21.rsks.bats @@ -0,0 +1,37 @@ +#!/usr/bin/env bats + +source $QP_ROOT/tests/bats/common.bats.sh + + +function run() { + thresh=1.e-8 + qp_edit -c $1 + ezfio set_file $1 + ezfio set scf_utils thresh_scf 1.e-10 + echo "short_range_PBE" > $1/dft_keywords/exchange_functional + echo "short_range_PBE" > $1/dft_keywords/correlation_functional + echo "0.5" > $1/ao_two_e_erf_integrals/mu_erf + echo "1" > $1/becke_numerical_grid/grid_type_sgn + qp_run rs_ks_scf $1 + energy="$(ezfio get kohn_sham_rs energy)" + eq $energy $2 $thresh +} + + + +@test "H3COH" { + run h3coh.ezfio -115.50238225208 +} + +@test "HCN" { + run hcn.ezfio -93.26674673761752 +} + +@test "N2" { + run n2.ezfio -109.404692225719 +} + +@test "SiH2_3B1" { + run sih2_3b1.ezfio -290.371745382958 +} + diff --git a/src/kohn_sham_rs/rs_ks_scf.irp.f b/src/kohn_sham_rs/rs_ks_scf.irp.f index bb98c22c..1305a2f8 100644 --- a/src/kohn_sham_rs/rs_ks_scf.irp.f +++ b/src/kohn_sham_rs/rs_ks_scf.irp.f @@ -92,10 +92,8 @@ subroutine run mo_label = "Canonical" -! Choose SCF algorithm - -! call damping_SCF ! Deprecated routine call Roothaan_Hall_SCF + call ezfio_set_kohn_sham_rs_energy(SCF_energy) write(*, '(A22,X,F16.10)') 'one_electron_energy = ',one_electron_energy write(*, '(A22,X,F16.10)') 'two_electron_energy = ',two_electron_energy diff --git a/src/scf_utils/roothaan_hall_scf.irp.f b/src/scf_utils/roothaan_hall_scf.irp.f index 460ebcf6..3b217b7e 100644 --- a/src/scf_utils/roothaan_hall_scf.irp.f +++ b/src/scf_utils/roothaan_hall_scf.irp.f @@ -158,8 +158,8 @@ END_DOC call save_mos endif - call write_double(6, Energy_SCF, 'Hartree-Fock energy') - call ezfio_set_hartree_fock_energy(Energy_SCF) + call write_double(6, Energy_SCF, 'SCF energy ') +! call ezfio_set_hartree_fock_energy(Energy_SCF) call write_time(6)