Skip to content

Commit

Permalink
Merge pull request #187 from RQC-HU/small-nsec
Browse files Browse the repository at this point in the history
small nsec
  • Loading branch information
kohei-noda-qcrg authored Jan 18, 2025
2 parents 67ca3c4 + 69f5287 commit 6837218
Show file tree
Hide file tree
Showing 12 changed files with 3,059 additions and 9 deletions.
Empty file modified src/fockivo.f90
100755 → 100644
Empty file.
2 changes: 0 additions & 2 deletions src/r4dcasci.f90
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ subroutine r4dcasci ! DO CASCI CALC IN THIS PROGRAM!
Call readint2_casci(mdcintnew, nuniq)

if (rank == 0) print *, 'nmo =', nmo
nmo = ninact + nact + nsec

! Print the irreducible representation used to calculate CASCI energy.
if (rank == 0) then
call write_allocated_memory_size
Expand Down
1 change: 0 additions & 1 deletion src/r4dcaspt2_tra.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ subroutine r4dcaspt2_tra ! DO CASPT2 CALC WITH MO TRANSFORMATION
Call divide_2_elec_integral_into_subspaces(mdcintnew)

call write_allocated_memory_size
nmo = ninact + nact + nsec
if (rank == 0) print *, 'nmo =', nmo

call read_cidata
Expand Down
11 changes: 5 additions & 6 deletions src/read_mrconee.f90
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ SUBROUTINE read_1_elec_integrals ! one-electron MO integrals in MRCONEE

Implicit NONE

integer(kind=int64) :: isp, nmom
integer(kind=int64) :: isp
double precision, allocatable :: roner(:, :, :), ronei(:, :, :)

if (debug .and. rank == 0) then
Expand Down Expand Up @@ -582,15 +582,14 @@ SUBROUTINE read_1_elec_integrals ! one-electron MO integrals in MRCONEE

close (unit_mrconee)

nmom = global_sec_end
Allocate (one_elec_int_r(nmom, nmom)); Call memplus(KIND(one_elec_int_r), SIZE(one_elec_int_r), 1)
Allocate (one_elec_int_i(nmom, nmom)); Call memplus(KIND(one_elec_int_i), SIZE(one_elec_int_i), 1)
allocate (one_elec_int_r(nmo, nmo)); call memplus(kind(one_elec_int_r), size(one_elec_int_r), 1)
allocate (one_elec_int_i(nmo, nmo)); call memplus(kind(one_elec_int_i), size(one_elec_int_i), 1)

! Store the one-electron integrals in energy order (CASPT2 order)
! one_elec_int_[r,i] are CASPT2 order
! roner, ronei are DIRAC order
do i0 = 1, nmom
do j0 = 1, nmom
do i0 = 1, nmo
do j0 = 1, nmo
one_elec_int_r(indmo_dirac_to_cas(i0), indmo_dirac_to_cas(j0)) = roner(i0, j0, 1) ! using alpha component for a while
one_elec_int_i(indmo_dirac_to_cas(i0), indmo_dirac_to_cas(j0)) = ronei(i0, j0, 1)
end do
Expand Down
Binary file added test/dev/c32h_n2_small_nsec_dev/MDCINT
Binary file not shown.
Binary file added test/dev/c32h_n2_small_nsec_dev/MRCONEE
Binary file not shown.
19 changes: 19 additions & 0 deletions test/dev/c32h_n2_small_nsec_dev/active.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.ninact
8
.nact
8
.nsec
!44 ! nmo in MRCONEE is 8 + 8 + 44 = 60
40
.nelec
6
.caspt2_ciroots
33 1
.eshift
0.0
.diracver
22
.subprograms
CASCI
CASPT2
.end
35 changes: 35 additions & 0 deletions test/dev/c32h_n2_small_nsec_dev/dirac_data/N2.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
**DIRAC
.TITLE
N2
.WAVE FUNCTION
.ANALYZE
.4INDEX
.PROPERTIES
**INTEGRALS
.NUCMOD
1
*READIN
.UNCONTRACT
**HAMILTONIAN
.X2C
**WAVE FUNCTIONS
.SCF
.RELCCSD
*SCF
.MAXITR
100
.EVCCNV
1.0E-10
.ERGCNV
1.0E-10
**ANALYZE
.MULPOP
.PRIVEC
**PROPERTIES
.RHONUC
**GENERAL
.PCMOUT
**MOLTRA
.ACTIVE
all
*END OF
9 changes: 9 additions & 0 deletions test/dev/c32h_n2_small_nsec_dev/dirac_data/N2.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DIRAC


C 1 A
7. 2
N 0.0000000000 0.0000000000 0.0000000000
N2 0.0000000000 0.0000000000 1.0000000000
LARGE BASIS STO-3G
FINISH
2,244 changes: 2,244 additions & 0 deletions test/dev/c32h_n2_small_nsec_dev/dirac_data/N2_N2.out

Large diffs are not rendered by default.

717 changes: 717 additions & 0 deletions test/dev/c32h_n2_small_nsec_dev/reference.c32h_n2_small_nsec_dev.out

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions test/dev/c32h_n2_small_nsec_dev/test_c32h_n2_small_nsec_dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os
import shutil
import pytest
from module_testing import (
run_test_dcaspt2,
get_caspt2_energy_from_output_file,
)


@pytest.mark.dev
def test_c32h_n2_small_nsec_dev(env_setup_caspt2) -> None:

(test_path, ref_output_path, output_path, latest_passed_path, test_command) = env_setup_caspt2

# Get this files path and change directory to this path
os.chdir(test_path) # Change directory to the path of this file
print(test_path, "test start") # Debug output

run_test_dcaspt2(test_command)

ref_energy = get_caspt2_energy_from_output_file(ref_output_path)
test_energy = get_caspt2_energy_from_output_file(output_path)

# Check whether the output of test run
# matches the reference to 7th decimal places.
assert test_energy == pytest.approx(ref_energy, abs=1e-10)

# If it reaches this point, the result of assert is true.
# The latest passed output file is overwritten by the current output file if assert is True.
shutil.copy(output_path, latest_passed_path)

0 comments on commit 6837218

Please sign in to comment.