From 44861db08c4c585a19d8e2c6cf340e3b5e2efbb1 Mon Sep 17 00:00:00 2001 From: RenkeHuang Date: Thu, 4 May 2023 18:23:40 -0400 Subject: [PATCH 1/3] doc for external solver --- docs/source/howto.rst | 1 + docs/source/methods/external_solver.rst | 149 ++++++++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 docs/source/methods/external_solver.rst diff --git a/docs/source/howto.rst b/docs/source/howto.rst index e9acaca20..e751602ec 100644 --- a/docs/source/howto.rst +++ b/docs/source/howto.rst @@ -12,3 +12,4 @@ HOWTOs methods/avas utils/plotting nb_api_intro + methods/external_solver diff --git a/docs/source/methods/external_solver.rst b/docs/source/methods/external_solver.rst new file mode 100644 index 000000000..af1d49f11 --- /dev/null +++ b/docs/source/methods/external_solver.rst @@ -0,0 +1,149 @@ +.. _`sec:methods:external`: + +Read external RDMs, Export integrals +==================================== + +.. sectionauthor:: Renke Huang + +Forte implements the ``ExternalActiveSpaceMethod`` class to provide users with more flexilibity with the correlation computations. + + +Read external RDMs for correlation computations +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The Forte external solver will check if there is a json file named ``rdms.json`` present in the current working directory. +See `the test case `_ for the data format used in ``rdms.json``. +If the file is present, the external solver will read the RDMs and compute the reference energy. +Here is the simplet input for a DSRG-MRPT2 computation using external RDMs:: + + molecule h2{ + 0 1 + H + H 1 0.7 + } + + set { + basis cc-pVDZ + scf_type pk + e_convergence 12 + } + + set forte { + active_space_solver external # read rdms.json, generate as_ints.json + active [1, 0, 0, 0, 0, 1, 0, 0] + restricted_docc [0, 0, 0, 0, 0, 0, 0, 0] + correlation_solver dsrg-mrpt2 + dsrg_s 0.5 + } + + energy('forte') + + + +Export integrals to disk +^^^^^^^^^^^^^^^^^^^^^^^^ + +Forte can export two types of integrals: +1) active space integrals from an ``ActiveSpaceSolver`` (which define a bare Hamiltonian), +2) DSRG-dressed integrals. +The minimal input for writing active space integrals to disk (save as ``as_ints.json``):: + + molecule h2{ + 0 1 + H + H 1 0.7 + } + + set { + basis cc-pVDZ + scf_type pk + e_convergence 12 + } + + set forte { + active_space_solver external # generate as_ints.json + write_wfn true # save coeff.json + active [1, 0, 0, 0, 0, 1, 0, 0] + restricted_docc [0, 0, 0, 0, 0, 0, 0, 0] + } + + energy('forte') + +Note that saving the ``wfn.Ca()`` to ``coeff.json`` is always recommended to avoid sign flips and confusions in defining orbitals. + +For DSRG-dressed integrals, to enable the pipeline of the external active space solver and a correlation solver (computes the dressed integrals) that follows, +two files ``rdms.json`` and ``coeff.json`` are required in the working directory. +Then run the following input to export DSRG-dressed integrals to disk (save as ``dsrg_ints.json``):: + + molecule h2{ + 0 1 + H + H 1 0.7 + } + + set { + basis cc-pVDZ + scf_type pk + e_convergence 12 + } + + set forte { + active_space_solver external # read rdms.json, generate as_ints.json + read_wfn true # read coeff.json + active [1, 0, 0, 0, 0, 1, 0, 0] + restricted_docc [0, 0, 0, 0, 0, 0, 0, 0] + correlation_solver dsrg-mrpt2 + dsrg_s 0.5 + relax_ref once # generate dsrg_ints.json + external_partial_relax true + } + + energy('forte') + + + +Options +~~~~~~~ + +**WRITE_RDM** + +Save RDMs to ``ref_rdms.json`` for external computations. + +* Type: bool +* Default: False + +**WRITE_WFN** + +Save ``ref_wfn.Ca()`` to ``coeff.json`` for external computations. + +* Type: bool +* Default: False + +**READ_WFN** + +Read ``ref_wfn.Ca()/ref_wfn.Cb()`` from ``coeff.json`` for external active space solver. + +* Type: bool +* Default: False + +**EXTERNAL_PARTIAL_RELAX** + +Perform one relaxation step after building the DSRG effective Hamiltonian when using external active space solver. + +* Type: bool +* Default: False + +**EXT_RELAX_SOLVER** + +Active space solver used in the relaxation when using external active space solver. + +* Type: string +* Options: FCI, DETCI, CAS +* Default: FCI + +**SAVE_SA_DSRG_INTS** + +Save SA-DSRG dressed integrals to ``dsrg_ints.json``. + +* Type: bool +* Default: False From b6e7db46d80dfe87c37b1b7d4ca84b2bf830a76f Mon Sep 17 00:00:00 2001 From: RenkeHuang Date: Fri, 5 May 2023 14:08:10 -0400 Subject: [PATCH 2/3] add point group label in ints json file --- forte/proc/external_active_space_solver.py | 5 +- tests/methods/external_solver-1/as_ints.json | 92 ++++---- tests/methods/external_solver-1/coeff.json | 2 +- tests/methods/external_solver-1/input.dat | 6 +- tests/methods/external_solver-1/output.ref | 191 ++++++++-------- tests/methods/external_solver-1/rdms.json | 46 ++-- tests/methods/external_solver-2/as_ints.json | 92 ++++---- tests/methods/external_solver-2/coeff.json | 2 +- .../methods/external_solver-2/dsrg_ints.json | 94 ++++---- tests/methods/external_solver-2/input.dat | 4 +- tests/methods/external_solver-2/output.ref | 213 +++++++++--------- tests/methods/external_solver-2/rdms.json | 46 ++-- 12 files changed, 415 insertions(+), 378 deletions(-) diff --git a/forte/proc/external_active_space_solver.py b/forte/proc/external_active_space_solver.py index 84f911073..3f6215fb0 100644 --- a/forte/proc/external_active_space_solver.py +++ b/forte/proc/external_active_space_solver.py @@ -44,11 +44,14 @@ def read_wavefunction(ref_wfn): def write_external_active_space_file(as_ints, state_map, mo_space_info, json_file="forte_ints.json"): ndocc = mo_space_info.size("INACTIVE_DOCC") + # `state_map` only contains one state. for state, nroots in state_map.items(): file = {} nmo = as_ints.nmo() + file['point_group'] = {"data": mo_space_info.point_group_label(), "description": "Point group of the system"} + file['state_symmetry'] = {"data": state.irrep(), "description": "Symmetry of the state"} file['na'] = {"data": state.na() - ndocc, "description": "number of alpha electrons in the active space"} @@ -140,7 +143,7 @@ def make_hamiltonian(as_ints, state_map): H[I][J] = as_ints.slater_rules(detI,detJ) # if I == J: # H[I][J] += scalar_e - + print(f'\n==> Active Space Hamiltonian <==\n') print(f'\n{H}') diff --git a/tests/methods/external_solver-1/as_ints.json b/tests/methods/external_solver-1/as_ints.json index 4643c8a78..851c97a44 100644 --- a/tests/methods/external_solver-1/as_ints.json +++ b/tests/methods/external_solver-1/as_ints.json @@ -16,7 +16,7 @@ [ 0, 0, - -1.2796255434474166 + -1.2780734354814192 ], [ 0, @@ -31,12 +31,12 @@ [ 2, 2, - -0.48166902418882074 + -0.5069808360680935 ], [ 1, 1, - -1.2796255434474166 + -1.2780734354814192 ], [ 1, @@ -51,11 +51,15 @@ [ 3, 3, - -0.48166902418882074 + -0.5069808360680935 ] ], "description": "one-electron integrals as a list of tuples (i,j,)" }, + "point_group": { + "data": "D2H", + "description": "Point group of the system" + }, "scalar_energy": { "data": 0.7559674438142859, "description": "scalar energy (sum of nuclear repulsion, frozen core, and scalar contributions" @@ -96,28 +100,28 @@ 1, 0, 1, - 0.6765736461896368 + 0.6732547348211969 ], [ 0, 1, 1, 0, - -0.6765736461896368 + -0.6732547348211969 ], [ 1, 0, 0, 1, - -0.6765736461896368 + -0.6732547348211969 ], [ 1, 0, 1, 0, - 0.6765736461896368 + 0.6732547348211969 ], [ 1, @@ -222,28 +226,28 @@ 1, 2, 3, - 0.16821010144697315 + 0.05211974074239376 ], [ 0, 1, 3, 2, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 0, 2, 3, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 0, 3, 2, - 0.16821010144697315 + 0.05211974074239376 ], [ 1, @@ -299,84 +303,84 @@ 2, 0, 2, - 0.49280030531832963 + 0.32992215283119786 ], [ 0, 3, 0, 3, - 0.6610104067653028 + 0.38204189357359164 ], [ 0, 3, 3, 0, - -0.6610104067653028 + -0.38204189357359164 ], [ 3, 0, 0, 3, - -0.6610104067653028 + -0.38204189357359164 ], [ 3, 0, 3, 0, - 0.6610104067653028 + 0.38204189357359164 ], [ 1, 3, 1, 3, - 0.49280030531832963 + 0.32992215283119786 ], [ 0, 2, 2, 0, - -0.49280030531832963 + -0.32992215283119786 ], [ 0, 3, 2, 1, - 0.16821010144697315 + 0.05211974074239376 ], [ 0, 3, 1, 2, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 0, 2, 1, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 0, 1, 2, - 0.16821010144697315 + 0.05211974074239376 ], [ 1, 3, 3, 1, - -0.49280030531832963 + -0.32992215283119786 ], [ 0, @@ -467,84 +471,84 @@ 0, 0, 2, - -0.49280030531832963 + -0.32992215283119786 ], [ 2, 1, 0, 3, - 0.16821010144697315 + 0.05211974074239376 ], [ 2, 1, 3, 0, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 2, 0, 3, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 2, 3, 0, - 0.16821010144697315 + 0.05211974074239376 ], [ 3, 1, 1, 3, - -0.49280030531832963 + -0.32992215283119786 ], [ 2, 0, 2, 0, - 0.49280030531832963 + 0.32992215283119786 ], [ 2, 1, 2, 1, - 0.6610104067653028 + 0.38204189357359164 ], [ 2, 1, 1, 2, - -0.6610104067653028 + -0.38204189357359164 ], [ 1, 2, 2, 1, - -0.6610104067653028 + -0.38204189357359164 ], [ 1, 2, 1, 2, - 0.6610104067653028 + 0.38204189357359164 ], [ 3, 1, 3, 1, - 0.49280030531832963 + 0.32992215283119786 ], [ 2, @@ -600,28 +604,28 @@ 3, 0, 1, - 0.16821010144697315 + 0.05211974074239376 ], [ 2, 3, 1, 0, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 2, 0, 1, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 2, 1, 0, - 0.16821010144697315 + 0.05211974074239376 ], [ 3, @@ -726,28 +730,28 @@ 3, 2, 3, - 0.7020059773728193 + 0.33254824455408644 ], [ 2, 3, 3, 2, - -0.7020059773728193 + -0.33254824455408644 ], [ 3, 2, 2, 3, - -0.7020059773728193 + -0.33254824455408644 ], [ 3, 2, 3, 2, - 0.7020059773728193 + 0.33254824455408644 ], [ 3, diff --git a/tests/methods/external_solver-1/coeff.json b/tests/methods/external_solver-1/coeff.json index ff3e6e7a2..a1d933fb0 100644 --- a/tests/methods/external_solver-1/coeff.json +++ b/tests/methods/external_solver-1/coeff.json @@ -1 +1 @@ -{"Ca": [[[0.5878957888622718, 0.9686510118504073, 0.6334083373777376], [0.223258988807243, -1.027214438840554, -0.3179210751926419], [0.026961628623142216, 0.004725029809502175, -1.0670106958720451]], [], [[1.457679395756173]], [[1.457679395756173]], [], [[1.4269588161434716, 0.5935064980150216, 4.250913259120527], [0.2832498579000938, -3.744601980721877, -0.025466100339308406], [-0.05699829506024395, -0.39545703823115, 3.056239858463695]], [[0.8086175387594432]], [[0.8086175387594432]]]} \ No newline at end of file +{"Ca": [[[0.5774927712537636, 0.9724148342248428, 0.6372000098160395], [0.2323206971196327, -1.025392233335057, -0.31731018105850806], [0.03276587569292466, 0.0055994763981520035, -1.066844001569208]], [], [[1.457679395756173]], [[1.457679395756173]], [], [[0.20192648043929112, 1.0016130699002461, 4.406214011759375], [2.948737955622244, -2.3250691246100206, -0.04382959218438526], [0.021882074800704587, -0.6256189907147947, 3.018005831745176]], [[0.8086175387594432]], [[0.8086175387594432]]]} \ No newline at end of file diff --git a/tests/methods/external_solver-1/input.dat b/tests/methods/external_solver-1/input.dat index aa7b9a53d..f3289fa67 100644 --- a/tests/methods/external_solver-1/input.dat +++ b/tests/methods/external_solver-1/input.dat @@ -2,7 +2,7 @@ import forte -refe = -1.155656745568920 +refe = -1.153758380556 molecule { 0 1 @@ -11,7 +11,7 @@ H 1 0.7 } set { - basis cc-pvdz + basis cc-pVDZ scf_type pk e_convergence 12 } @@ -28,4 +28,4 @@ set forte { } energy('forte') -compare_values(refe, variable("CURRENT ENERGY"),10, "DSRG-MRPT2 unrelaxed energy (external RDM)") +compare_values(refe, variable("CURRENT ENERGY"), 10, "DSRG-MRPT2 unrelaxed energy (external RDM)") diff --git a/tests/methods/external_solver-1/output.ref b/tests/methods/external_solver-1/output.ref index da60ca137..05e86db8a 100644 --- a/tests/methods/external_solver-1/output.ref +++ b/tests/methods/external_solver-1/output.ref @@ -31,9 +31,9 @@ ----------------------------------------------------------------------- - Psi4 started on: Wednesday, 03 May 2023 03:13PM + Psi4 started on: Friday, 05 May 2023 02:02PM - Process ID: 90010 + Process ID: 10745 Host: renke-mbp15.wireless.emory.edu PSIDATADIR: /Users/renkehuang/source/psi4/objdir/stage/share/psi4 Memory: 500.0 MiB @@ -46,7 +46,7 @@ import forte -refe = -1.155656745568920 +refe = -1.153758380556 molecule { 0 1 @@ -55,7 +55,7 @@ H 1 0.7 } set { - basis cc-pvdz + basis cc-pVDZ scf_type pk e_convergence 12 } @@ -68,11 +68,11 @@ set forte { dsrg_s 0.5 active [1, 0, 0, 0, 0, 1, 0, 0] restricted_docc [0, 0, 0, 0, 0, 0, 0, 0] - + } energy('forte') -compare_values(refe, variable("CURRENT ENERGY"),10, "DSRG-MRPT2 unrelaxed energy (external RDM)") +compare_values(refe, variable("CURRENT ENERGY"), 10, "DSRG-MRPT2 unrelaxed energy (external RDM)") -------------------------------------------------------------------------- Scratch directory: /tmp/ @@ -95,7 +95,7 @@ Scratch directory: /tmp/ No reference wave function provided for Forte. Computing SCF orbitals using Psi4 ... *** tstart() called on renke-mbp15.wireless.emory.edu -*** at Wed May 3 15:13:57 2023 +*** at Fri May 5 14:02:39 2023 => Loading Basis Set <= @@ -218,8 +218,8 @@ Scratch directory: /tmp/ @RHF iter 2: -1.12682912617525 -2.78136e-03 1.95941e-03 ADIIS/DIIS @RHF iter 3: -1.12692456489430 -9.54387e-05 9.38746e-05 DIIS @RHF iter 4: -1.12692469225421 -1.27360e-07 1.72031e-06 DIIS - @RHF iter 5: -1.12692469232735 -7.31419e-11 3.93495e-09 DIIS - @RHF iter 6: -1.12692469232735 -2.22045e-16 4.41662e-12 DIIS + @RHF iter 5: -1.12692469232735 -7.31413e-11 3.93495e-09 DIIS + @RHF iter 6: -1.12692469232735 -4.44089e-16 4.41349e-12 DIIS Energy and wave function converged. @@ -249,9 +249,9 @@ Scratch directory: /tmp/ => Energetics <= Nuclear Repulsion Energy = 0.7559674438142859 - One-Electron Energy = -2.5561468709735706 - Two-Electron Energy = 0.6732547348319302 - Total Energy = -1.1269246923273546 + One-Electron Energy = -2.5561468709735617 + Two-Electron Energy = 0.6732547348319214 + Total Energy = -1.1269246923273544 Computation Completed @@ -275,14 +275,14 @@ Properties computed using the SCF density matrix ------------------------------------------------------------------------------------ -*** tstop() called on renke-mbp15.wireless.emory.edu at Wed May 3 15:13:58 2023 +*** tstop() called on renke-mbp15.wireless.emory.edu at Fri May 5 14:02:40 2023 Module time: - user time = 0.79 seconds = 0.01 minutes - system time = 0.18 seconds = 0.00 minutes + user time = 0.66 seconds = 0.01 minutes + system time = 0.11 seconds = 0.00 minutes total time = 1 seconds = 0.02 minutes Total time: - user time = 0.79 seconds = 0.01 minutes - system time = 0.18 seconds = 0.00 minutes + user time = 0.66 seconds = 0.01 minutes + system time = 0.11 seconds = 0.00 minutes total time = 1 seconds = 0.02 minutes Read options for space RESTRICTED_DOCC @@ -373,12 +373,12 @@ Total time: Starting second half-transformation. Two-electron integral transformation complete. - Integral transformation done. 0.01280547 s + Integral transformation done. 0.01043669 s Reading the two-electron integrals from disk Size of two-electron integrals: 0.000224 GB - Timing for conventional integral transformation: 0.054 s. + Timing for conventional integral transformation: 0.031 s. Timing for freezing core and virtual orbitals: 0.000 s. - Timing for computing conventional integrals: 0.055 s. + Timing for computing conventional integrals: 0.032 s. ==> Summary of Active Space Solver Input <== @@ -401,7 +401,7 @@ External solver: save active space integrals to as_ints.json Multi.(2ms) Irrep. No. Energy -------------------------------------------------------- - 1 ( 0) Ag 0 -1.143977430764 n/a + 1 ( 0) Ag 0 -1.129181390402 n/a -------------------------------------------------------- ==> Semicanonicalize Orbitals <== @@ -417,13 +417,28 @@ External solver: save active space integrals to as_ints.json Off-Diag. Elements Max 2-Norm ------------------------------------------------ GAS1 0.0000000000 0.0000000000 - RESTRICTED_UOCC 0.0000000000 0.0000000000 + RESTRICTED_UOCC 0.0003263893 0.0005082115 ------------------------------------------------ - Canonicalization test passed + Canonicalization test failed - Orbitals are already semicanonicalized. - Timing for orbital canonicalization: 0.016 s. + Integrals are about to be updated. + Computing Conventional Integrals Presorting SO-basis two-electron integrals. + Sorting File: SO Ints (nn|nn) nbuckets = 1 + Constructing frozen core operators + Starting first half-transformation. + Sorting half-transformed integrals. + First half integral transformation complete. + Starting second half-transformation. + Two-electron integral transformation complete. + + Integral transformation done. 0.01118366 s + Reading the two-electron integrals from disk + Size of two-electron integrals: 0.000224 GB + Timing for conventional integral transformation: 0.041 s. + Timing for freezing core and virtual orbitals: 0.000 s. + Integrals update took 0.041 s. + Timing for orbital canonicalization: 0.043 s. ==> Multireference Driven Similarity Renormalization Group <== @@ -467,18 +482,18 @@ External solver: save active space integrals to as_ints.json ==> Computing DSRG-MRPT2 ... <== - Computing T2 amplitudes ... Done. Timing 0.005736 s - Computing T1 amplitudes ... Done. Timing 0.006801 s - Renormalizing two-electron integrals ... Done. Timing 0.001152 s - Renormalizing Fock matrix elements ... Done. Timing 0.008923 s - Computing <[F, T1]> ... Done. Timing 0.003932 s - Computing <[F, T2]> ... Done. Timing 0.008847 s - Computing <[V, T1]> ... Done. Timing 0.010583 s - Computing <[V, T2]> (C_2)^4 ... Done. Timing 0.081912 s - Computing <[V, T2]> C_4 (C_2)^2 HH ... Done. Timing 0.019087 s - Computing <[V, T2]> C_4 (C_2)^2 PP ... Done. Timing 0.017845 s - Computing <[V, T2]> C_4 (C_2)^2 PH ... Done. Timing 0.077183 s - Computing <[V, T2]> C_6 C_2 ... Done. Timing 0.027359 s + Computing T2 amplitudes ... Done. Timing 0.003186 s + Computing T1 amplitudes ... Done. Timing 0.008558 s + Renormalizing two-electron integrals ... Done. Timing 0.000800 s + Renormalizing Fock matrix elements ... Done. Timing 0.006531 s + Computing <[F, T1]> ... Done. Timing 0.003631 s + Computing <[F, T2]> ... Done. Timing 0.008504 s + Computing <[V, T1]> ... Done. Timing 0.008512 s + Computing <[V, T2]> (C_2)^4 ... Done. Timing 0.053021 s + Computing <[V, T2]> C_4 (C_2)^2 HH ... Done. Timing 0.013525 s + Computing <[V, T2]> C_4 (C_2)^2 PP ... Done. Timing 0.013451 s + Computing <[V, T2]> C_4 (C_2)^2 PH ... Done. Timing 0.057653 s + Computing <[V, T2]> C_6 C_2 ... Done. Timing 0.025516 s ==> Excitation Amplitudes Summary <== @@ -486,108 +501,100 @@ External solver: save active space integrals to as_ints.json Largest T1 amplitudes for spin case A: i a i a i a -------------------------------------------------------------------------------- - [ 5 7 ]-0.127465 [ 5 6 ] 0.021252 [ 0 2 ]-0.004193 - [ 0 1 ]-0.002807 + [ 5 6 ] 0.000101 [ 0 1 ] 0.000055 [ 0 2 ]-0.000034 + [ 5 7 ] 0.000017 -------------------------------------------------------------------------------- - Norm of T1A vector: (nonzero elements: 4) 0.129323314790068. + Norm of T1A vector: (nonzero elements: 4) 0.000120510799952. -------------------------------------------------------------------------------- Largest T1 amplitudes for spin case B: _ _ _ _ _ _ i a i a i a -------------------------------------------------------------------------------- - [ 5 7 ]-0.127465 [ 5 6 ] 0.021252 [ 0 2 ]-0.004193 - [ 0 1 ]-0.002807 + [ 5 6 ] 0.000101 [ 0 1 ] 0.000055 [ 0 2 ]-0.000034 + [ 5 7 ] 0.000017 -------------------------------------------------------------------------------- - Norm of T1B vector: (nonzero elements: 4) 0.129323314790068. + Norm of T1B vector: (nonzero elements: 4) 0.000120510799952. -------------------------------------------------------------------------------- Largest T2 amplitudes for spin case AA: i j a b i j a b i j a b -------------------------------------------------------------------------------- - [ 0 5 2 5] 0.040812 [ 0 5 1 5]-0.037744 [ 0 5 0 7]-0.020614 - [ 0 5 3 9] 0.013435 [ 0 5 4 8] 0.013435 [ 0 5 1 6]-0.009523 - [ 0 5 2 6] 0.007949 [ 0 5 2 7] 0.007325 [ 0 5 1 7]-0.007258 - [ 0 5 0 6] 0.003915 + [ 0 5 0 6]-0.023744 [ 0 5 1 6]-0.023617 [ 0 5 1 5]-0.023224 + [ 0 5 2 6] 0.014902 [ 0 5 2 5] 0.009399 [ 0 5 3 9] 0.007343 + [ 0 5 4 8] 0.007343 [ 0 5 2 7] 0.003824 [ 0 5 1 7]-0.000602 + [ 0 5 0 7]-0.000314 -------------------------------------------------------------------------------- - Norm of T2AA vector: (nonzero elements: 40) 0.128866878247692. + Norm of T2AA vector: (nonzero elements: 40) 0.091525190041527. -------------------------------------------------------------------------------- Largest T2 amplitudes for spin case AB: _ _ _ _ _ _ i j a b i j a b i j a b -------------------------------------------------------------------------------- - [ 0 0 0 1]-0.064689 [ 0 5 1 5]-0.061573 [ 5 5 2 2]-0.045360 - [ 0 0 1 1]-0.034745 [ 0 0 8 8]-0.033036 [ 0 0 9 9]-0.033036 - [ 5 5 3 3]-0.032944 [ 5 5 4 4]-0.032944 [ 0 5 0 7]-0.030506 - [ 5 5 0 1] 0.026285 [ 0 0 0 2] 0.021026 [ 5 5 8 8]-0.020666 - [ 5 5 9 9]-0.020666 [ 5 5 5 7]-0.019695 [ 0 5 1 6]-0.019404 + [ 0 0 0 1]-0.065321 [ 0 5 0 6]-0.045860 [ 0 0 6 6]-0.038369 + [ 0 0 1 1]-0.035350 [ 0 0 8 8]-0.032988 [ 0 0 9 9]-0.032988 + [ 0 0 5 6]-0.026426 [ 5 5 6 6]-0.026239 [ 0 5 1 6]-0.022712 + [ 0 0 0 2] 0.020834 [ 5 5 0 2]-0.016950 [ 5 5 5 6]-0.015893 + [ 0 0 2 2]-0.014867 [ 5 5 2 2]-0.013738 [ 0 5 1 5]-0.012927 -------------------------------------------------------------------------------- - Norm of T2AB vector: (nonzero elements: 80) 0.206499845293523. + Norm of T2AB vector: (nonzero elements: 80) 0.168170084659699. -------------------------------------------------------------------------------- Largest T2 amplitudes for spin case BB: _ _ _ _ _ _ _ _ _ _ _ _ i j a b i j a b i j a b -------------------------------------------------------------------------------- - [ 0 5 2 5] 0.040812 [ 0 5 1 5]-0.037744 [ 0 5 0 7]-0.020614 - [ 0 5 3 9] 0.013435 [ 0 5 4 8] 0.013435 [ 0 5 1 6]-0.009523 - [ 0 5 2 6] 0.007949 [ 0 5 2 7] 0.007325 [ 0 5 1 7]-0.007258 - [ 0 5 0 6] 0.003915 + [ 0 5 0 6]-0.023744 [ 0 5 1 6]-0.023617 [ 0 5 1 5]-0.023224 + [ 0 5 2 6] 0.014902 [ 0 5 2 5] 0.009399 [ 0 5 3 9] 0.007343 + [ 0 5 4 8] 0.007343 [ 0 5 2 7] 0.003824 [ 0 5 1 7]-0.000602 + [ 0 5 0 7]-0.000314 -------------------------------------------------------------------------------- - Norm of T2BB vector: (nonzero elements: 40) 0.128866878247692. + Norm of T2BB vector: (nonzero elements: 40) 0.091525190041527. -------------------------------------------------------------------------------- ==> Possible Intruders <== - T1 amplitudes larger than 0.1000 for spin case A: - Amplitude Value Denominator - ---------------------------------------------------------------------- - [ 5 7 ] -0.12746529 ( 0.667430 - 3.835286 = -3.167856) - ---------------------------------------------------------------------- - T1 amplitudes larger than 0.1000 for spin case B: - Amplitude Value Denominator - ---------------------------------------------------------------------- - [ 5 7 ] -0.12746529 ( 0.667430 - 3.835286 = -3.167856) - ---------------------------------------------------------------------- + T1 amplitudes larger than 0.1000 for spin case A: NULL + T1 amplitudes larger than 0.1000 for spin case B: NULL T2 amplitudes larger than 0.1000 for spin case AA: NULL T2 amplitudes larger than 0.1000 for spin case AB: NULL T2 amplitudes larger than 0.1000 for spin case BB: NULL ==> DSRG-MRPT2 Energy Summary <== - E0 (reference) = -1.143977430763697 - <[F, T1]> = -0.000906192213893 - <[F, T2]> = 0.002630686262774 - <[V, T1]> = 0.001121703247208 - <[V, T2]> (C_2)^4 = -0.017293986299711 + E0 (reference) = -1.129181390402433 + <[F, T1]> = -0.000000029423301 + <[F, T2]> = -0.000001283090089 + <[V, T1]> = -0.000000286268613 + <[V, T2]> (C_2)^4 = -0.024304562802958 <[V, T2]> C_4 (C_2)^2 HH = 0.000000000000000 - <[V, T2]> C_4 (C_2)^2 PP = 0.003776386885707 - <[V, T2]> C_4 (C_2)^2 PH = -0.000158962932292 - <[V, T2]> C_6 C_2 = -0.000848949755016 - <[V, T2]> = -0.014525512101311 - DSRG-MRPT2 correlation energy = -0.011679314805223 - DSRG-MRPT2 total energy = -1.155656745568920 - max(T1) = 0.127465290391824 - max(T2) = 0.064688733093830 - ||T1|| = 0.182890785707159 - ||T2|| = 0.451422295687315 + <[V, T2]> C_4 (C_2)^2 PP = 0.001000024276417 + <[V, T2]> C_4 (C_2)^2 PH = -0.001219193218239 + <[V, T2]> C_6 C_2 = -0.000051659626285 + <[V, T2]> = -0.024575391371065 + DSRG-MRPT2 correlation energy = -0.024576990153068 + DSRG-MRPT2 total energy = -1.153758380555501 + max(T1) = 0.000100506507355 + max(T2) = 0.065320926540899 + ||T1|| = 0.000170428007704 + ||T2|| = 0.360386501303914 - Energy took 0.279 s + Energy took 0.208 s ==> Total Timings (s) for Computing Commutators <== [H1, T1] [H1, T2] [H2, T1] [H2, T2] ----------------------------------------------------- - -> C0 0.004 0.009 0.011 0.224 + -> C0 0.004 0.009 0.009 0.163 -> C1 0.000 0.000 0.000 0.000 -> C2 0.000 0.000 0.000 ----------------------------------------------------- - Time to prepare integrals: 0.149 seconds - Time to run job : 0.423 seconds - Total : 0.572 seconds - DSRG-MRPT2 energy (external RDM)......................................................PASSED + Time to prepare integrals: 0.055 seconds + Time to run job : 0.339 seconds + Total : 0.394 seconds + DSRG-MRPT2 unrelaxed energy (external RDM)............................................PASSED - Psi4 stopped on: Wednesday, 03 May 2023 03:13PM - Psi4 wall time for execution: 0:00:03.40 + Psi4 stopped on: Friday, 05 May 2023 02:02PM + Psi4 wall time for execution: 0:00:01.80 *** Psi4 exiting successfully. Buy a developer a beer! diff --git a/tests/methods/external_solver-1/rdms.json b/tests/methods/external_solver-1/rdms.json index 152045008..2d705a7cd 100644 --- a/tests/methods/external_solver-1/rdms.json +++ b/tests/methods/external_solver-1/rdms.json @@ -1,6 +1,6 @@ { "energy": { - "data": -1.1439774307636976, + "data": -1.1291813904024326, "description": "energy" }, "gamma1": { @@ -8,7 +8,7 @@ [ 0, 0, - 0.9895720514791457 + 0.998128762148389 ], [ 0, @@ -23,12 +23,12 @@ [ 2, 2, - 0.010427948520854444 + 0.001871237851611146 ], [ 1, 1, - 0.9895720514791457 + 0.998128762148389 ], [ 1, @@ -43,7 +43,7 @@ [ 3, 3, - 0.010427948520854444 + 0.001871237851611146 ] ], "description": "one-body density matrix as a list of tuples (i,j,)" @@ -62,28 +62,28 @@ 1, 0, 1, - 0.9895720514791457 + 0.998128762148389 ], [ 0, 1, 1, 0, - -0.9895720514791457 + -0.998128762148389 ], [ 1, 0, 0, 1, - -0.9895720514791457 + -0.998128762148389 ], [ 1, 0, 1, 0, - 0.9895720514791457 + 0.998128762148389 ], [ 1, @@ -188,28 +188,28 @@ 1, 2, 3, - -0.10158349477400773 + -0.04321731505442979 ], [ 0, 1, 3, 2, - 0.10158349477400773 + 0.04321731505442979 ], [ 1, 0, 2, 3, - 0.10158349477400773 + 0.04321731505442979 ], [ 1, 0, 3, 2, - -0.10158349477400773 + -0.04321731505442979 ], [ 1, @@ -566,28 +566,28 @@ 3, 0, 1, - -0.10158349477400773 + -0.04321731505442979 ], [ 2, 3, 1, 0, - 0.10158349477400773 + 0.04321731505442979 ], [ 3, 2, 0, 1, - 0.10158349477400773 + 0.04321731505442979 ], [ 3, 2, 1, 0, - -0.10158349477400773 + -0.04321731505442979 ], [ 3, @@ -692,28 +692,28 @@ 3, 2, 3, - 0.010427948520854444 + 0.001871237851611146 ], [ 2, 3, 3, 2, - -0.010427948520854444 + -0.001871237851611146 ], [ 3, 2, 2, 3, - -0.010427948520854444 + -0.001871237851611146 ], [ 3, 2, 3, 2, - 0.010427948520854444 + 0.001871237851611146 ], [ 3, @@ -12249,5 +12249,9 @@ ] ], "description": "three-body density matrix as a list of tuples (i,j,k,l,m,n )" + }, + "nso": { + "data": 4, + "description": "number of active spin orbitals" } } \ No newline at end of file diff --git a/tests/methods/external_solver-2/as_ints.json b/tests/methods/external_solver-2/as_ints.json index 4643c8a78..851c97a44 100644 --- a/tests/methods/external_solver-2/as_ints.json +++ b/tests/methods/external_solver-2/as_ints.json @@ -16,7 +16,7 @@ [ 0, 0, - -1.2796255434474166 + -1.2780734354814192 ], [ 0, @@ -31,12 +31,12 @@ [ 2, 2, - -0.48166902418882074 + -0.5069808360680935 ], [ 1, 1, - -1.2796255434474166 + -1.2780734354814192 ], [ 1, @@ -51,11 +51,15 @@ [ 3, 3, - -0.48166902418882074 + -0.5069808360680935 ] ], "description": "one-electron integrals as a list of tuples (i,j,)" }, + "point_group": { + "data": "D2H", + "description": "Point group of the system" + }, "scalar_energy": { "data": 0.7559674438142859, "description": "scalar energy (sum of nuclear repulsion, frozen core, and scalar contributions" @@ -96,28 +100,28 @@ 1, 0, 1, - 0.6765736461896368 + 0.6732547348211969 ], [ 0, 1, 1, 0, - -0.6765736461896368 + -0.6732547348211969 ], [ 1, 0, 0, 1, - -0.6765736461896368 + -0.6732547348211969 ], [ 1, 0, 1, 0, - 0.6765736461896368 + 0.6732547348211969 ], [ 1, @@ -222,28 +226,28 @@ 1, 2, 3, - 0.16821010144697315 + 0.05211974074239376 ], [ 0, 1, 3, 2, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 0, 2, 3, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 0, 3, 2, - 0.16821010144697315 + 0.05211974074239376 ], [ 1, @@ -299,84 +303,84 @@ 2, 0, 2, - 0.49280030531832963 + 0.32992215283119786 ], [ 0, 3, 0, 3, - 0.6610104067653028 + 0.38204189357359164 ], [ 0, 3, 3, 0, - -0.6610104067653028 + -0.38204189357359164 ], [ 3, 0, 0, 3, - -0.6610104067653028 + -0.38204189357359164 ], [ 3, 0, 3, 0, - 0.6610104067653028 + 0.38204189357359164 ], [ 1, 3, 1, 3, - 0.49280030531832963 + 0.32992215283119786 ], [ 0, 2, 2, 0, - -0.49280030531832963 + -0.32992215283119786 ], [ 0, 3, 2, 1, - 0.16821010144697315 + 0.05211974074239376 ], [ 0, 3, 1, 2, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 0, 2, 1, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 0, 1, 2, - 0.16821010144697315 + 0.05211974074239376 ], [ 1, 3, 3, 1, - -0.49280030531832963 + -0.32992215283119786 ], [ 0, @@ -467,84 +471,84 @@ 0, 0, 2, - -0.49280030531832963 + -0.32992215283119786 ], [ 2, 1, 0, 3, - 0.16821010144697315 + 0.05211974074239376 ], [ 2, 1, 3, 0, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 2, 0, 3, - -0.16821010144697315 + -0.05211974074239376 ], [ 1, 2, 3, 0, - 0.16821010144697315 + 0.05211974074239376 ], [ 3, 1, 1, 3, - -0.49280030531832963 + -0.32992215283119786 ], [ 2, 0, 2, 0, - 0.49280030531832963 + 0.32992215283119786 ], [ 2, 1, 2, 1, - 0.6610104067653028 + 0.38204189357359164 ], [ 2, 1, 1, 2, - -0.6610104067653028 + -0.38204189357359164 ], [ 1, 2, 2, 1, - -0.6610104067653028 + -0.38204189357359164 ], [ 1, 2, 1, 2, - 0.6610104067653028 + 0.38204189357359164 ], [ 3, 1, 3, 1, - 0.49280030531832963 + 0.32992215283119786 ], [ 2, @@ -600,28 +604,28 @@ 3, 0, 1, - 0.16821010144697315 + 0.05211974074239376 ], [ 2, 3, 1, 0, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 2, 0, 1, - -0.16821010144697315 + -0.05211974074239376 ], [ 3, 2, 1, 0, - 0.16821010144697315 + 0.05211974074239376 ], [ 3, @@ -726,28 +730,28 @@ 3, 2, 3, - 0.7020059773728193 + 0.33254824455408644 ], [ 2, 3, 3, 2, - -0.7020059773728193 + -0.33254824455408644 ], [ 3, 2, 2, 3, - -0.7020059773728193 + -0.33254824455408644 ], [ 3, 2, 3, 2, - 0.7020059773728193 + 0.33254824455408644 ], [ 3, diff --git a/tests/methods/external_solver-2/coeff.json b/tests/methods/external_solver-2/coeff.json index ff3e6e7a2..a1d933fb0 100644 --- a/tests/methods/external_solver-2/coeff.json +++ b/tests/methods/external_solver-2/coeff.json @@ -1 +1 @@ -{"Ca": [[[0.5878957888622718, 0.9686510118504073, 0.6334083373777376], [0.223258988807243, -1.027214438840554, -0.3179210751926419], [0.026961628623142216, 0.004725029809502175, -1.0670106958720451]], [], [[1.457679395756173]], [[1.457679395756173]], [], [[1.4269588161434716, 0.5935064980150216, 4.250913259120527], [0.2832498579000938, -3.744601980721877, -0.025466100339308406], [-0.05699829506024395, -0.39545703823115, 3.056239858463695]], [[0.8086175387594432]], [[0.8086175387594432]]]} \ No newline at end of file +{"Ca": [[[0.5774927712537636, 0.9724148342248428, 0.6372000098160395], [0.2323206971196327, -1.025392233335057, -0.31731018105850806], [0.03276587569292466, 0.0055994763981520035, -1.066844001569208]], [], [[1.457679395756173]], [[1.457679395756173]], [], [[0.20192648043929112, 1.0016130699002461, 4.406214011759375], [2.948737955622244, -2.3250691246100206, -0.04382959218438526], [0.021882074800704587, -0.6256189907147947, 3.018005831745176]], [[0.8086175387594432]], [[0.8086175387594432]]]} \ No newline at end of file diff --git a/tests/methods/external_solver-2/dsrg_ints.json b/tests/methods/external_solver-2/dsrg_ints.json index 93e0ee068..ead8f3c2c 100644 --- a/tests/methods/external_solver-2/dsrg_ints.json +++ b/tests/methods/external_solver-2/dsrg_ints.json @@ -16,7 +16,7 @@ [ 0, 0, - -1.294157060378582 + -1.295442640085946 ], [ 0, @@ -31,12 +31,12 @@ [ 2, 2, - -0.44130879303420983 + -0.507373140593764 ], [ 1, 1, - -1.294157060378582 + -1.295442640085946 ], [ 1, @@ -51,13 +51,17 @@ [ 3, 3, - -0.44130879303420983 + -0.507373140593764 ] ], "description": "one-electron integrals as a list of tuples (i,j,)" }, + "point_group": { + "data": "D2H", + "description": "Point group of the system" + }, "scalar_energy": { - "data": 0.7519948111691328, + "data": 0.7556750453237706, "description": "scalar energy (sum of nuclear repulsion, frozen core, and scalar contributions" }, "spin": { @@ -96,28 +100,28 @@ 1, 0, 1, - 0.6922779923932214 + 0.6839405254137968 ], [ 0, 1, 1, 0, - -0.6922779923932214 + -0.6839405254137968 ], [ 1, 0, 0, 1, - -0.6922779923932214 + -0.6839405254137968 ], [ 1, 0, 1, 0, - 0.6922779923932214 + 0.6839405254137968 ], [ 1, @@ -222,28 +226,28 @@ 1, 2, 3, - 0.1426226500565767 + 0.05511015851619027 ], [ 0, 1, 3, 2, - -0.1426226500565767 + -0.05511015851619027 ], [ 1, 0, 2, 3, - -0.1426226500565767 + -0.05511015851619027 ], [ 1, 0, 3, 2, - 0.1426226500565767 + 0.05511015851619027 ], [ 1, @@ -299,84 +303,84 @@ 2, 0, 2, - 0.441424830669231 + 0.32675407778120646 ], [ 0, 3, 0, 3, - 0.5897358195853005 + 0.3758979995718118 ], [ 0, 3, 3, 0, - -0.5897358195853005 + -0.3758979995718118 ], [ 3, 0, 0, 3, - -0.5897358195853005 + -0.3758979995718118 ], [ 3, 0, 3, 0, - 0.5897358195853005 + 0.3758979995718118 ], [ 1, 3, 1, 3, - 0.441424830669231 + 0.32675407778120646 ], [ 0, 2, 2, 0, - -0.441424830669231 + -0.32675407778120646 ], [ 0, 3, 2, 1, - 0.1483109889160695 + 0.04914392179060532 ], [ 0, 3, 1, 2, - -0.1483109889160695 + -0.04914392179060532 ], [ 3, 0, 2, 1, - -0.1483109889160695 + -0.04914392179060532 ], [ 3, 0, 1, 2, - 0.1483109889160695 + 0.04914392179060532 ], [ 1, 3, 3, 1, - -0.441424830669231 + -0.32675407778120646 ], [ 0, @@ -467,84 +471,84 @@ 0, 0, 2, - -0.441424830669231 + -0.32675407778120646 ], [ 2, 1, 0, 3, - 0.1483109889160695 + 0.04914392179060532 ], [ 2, 1, 3, 0, - -0.1483109889160695 + -0.04914392179060532 ], [ 1, 2, 0, 3, - -0.1483109889160695 + -0.04914392179060532 ], [ 1, 2, 3, 0, - 0.1483109889160695 + 0.04914392179060532 ], [ 3, 1, 1, 3, - -0.441424830669231 + -0.32675407778120646 ], [ 2, 0, 2, 0, - 0.441424830669231 + 0.32675407778120646 ], [ 2, 1, 2, 1, - 0.5897358195853005 + 0.3758979995718118 ], [ 2, 1, 1, 2, - -0.5897358195853005 + -0.3758979995718118 ], [ 1, 2, 2, 1, - -0.5897358195853005 + -0.3758979995718118 ], [ 1, 2, 1, 2, - 0.5897358195853005 + 0.3758979995718118 ], [ 3, 1, 3, 1, - 0.441424830669231 + 0.32675407778120646 ], [ 2, @@ -600,28 +604,28 @@ 3, 0, 1, - 0.1426226500565767 + 0.05511015851619027 ], [ 2, 3, 1, 0, - -0.1426226500565767 + -0.05511015851619027 ], [ 3, 2, 0, 1, - -0.1426226500565767 + -0.05511015851619027 ], [ 3, 2, 1, 0, - 0.1426226500565767 + 0.05511015851619027 ], [ 3, @@ -726,28 +730,28 @@ 3, 2, 3, - 0.6514138113093619 + 0.3234433773319672 ], [ 2, 3, 3, 2, - -0.6514138113093619 + -0.3234433773319672 ], [ 3, 2, 2, 3, - -0.6514138113093619 + -0.3234433773319672 ], [ 3, 2, 3, 2, - 0.6514138113093619 + 0.3234433773319672 ], [ 3, diff --git a/tests/methods/external_solver-2/input.dat b/tests/methods/external_solver-2/input.dat index 1af6ab924..f7bd9edd2 100644 --- a/tests/methods/external_solver-2/input.dat +++ b/tests/methods/external_solver-2/input.dat @@ -2,7 +2,7 @@ import forte -refe = -1.156171120024 +refe = -1.153762971093 molecule { 0 1 @@ -11,7 +11,7 @@ H 1 0.7 } set { - basis cc-pvdz + basis cc-pVDZ scf_type pk e_convergence 12 } diff --git a/tests/methods/external_solver-2/output.ref b/tests/methods/external_solver-2/output.ref index 536c2cf0b..d4142c51f 100644 --- a/tests/methods/external_solver-2/output.ref +++ b/tests/methods/external_solver-2/output.ref @@ -31,9 +31,9 @@ ----------------------------------------------------------------------- - Psi4 started on: Wednesday, 03 May 2023 03:37PM + Psi4 started on: Friday, 05 May 2023 02:03PM - Process ID: 91235 + Process ID: 10771 Host: renke-mbp15.wireless.emory.edu PSIDATADIR: /Users/renkehuang/source/psi4/objdir/stage/share/psi4 Memory: 500.0 MiB @@ -46,7 +46,7 @@ import forte -refe = -1.156171120024 +refe = -1.153762971093 molecule { 0 1 @@ -55,7 +55,7 @@ H 1 0.7 } set { - basis cc-pvdz + basis cc-pVDZ scf_type pk e_convergence 12 } @@ -96,7 +96,7 @@ Scratch directory: /tmp/ No reference wave function provided for Forte. Computing SCF orbitals using Psi4 ... *** tstart() called on renke-mbp15.wireless.emory.edu -*** at Wed May 3 15:37:54 2023 +*** at Fri May 5 14:03:29 2023 => Loading Basis Set <= @@ -219,8 +219,8 @@ Scratch directory: /tmp/ @RHF iter 2: -1.12682912617525 -2.78136e-03 1.95941e-03 ADIIS/DIIS @RHF iter 3: -1.12692456489430 -9.54387e-05 9.38746e-05 DIIS @RHF iter 4: -1.12692469225421 -1.27360e-07 1.72031e-06 DIIS - @RHF iter 5: -1.12692469232735 -7.31428e-11 3.93495e-09 DIIS - @RHF iter 6: -1.12692469232735 -2.22045e-16 4.41115e-12 DIIS + @RHF iter 5: -1.12692469232735 -7.31415e-11 3.93495e-09 DIIS + @RHF iter 6: -1.12692469232736 -2.22045e-15 4.43504e-12 DIIS Energy and wave function converged. @@ -245,14 +245,14 @@ Scratch directory: /tmp/ NA [ 1, 0, 0, 0, 0, 0, 0, 0 ] NB [ 1, 0, 0, 0, 0, 0, 0, 0 ] - @RHF Final Energy: -1.12692469232735 + @RHF Final Energy: -1.12692469232736 => Energetics <= Nuclear Repulsion Energy = 0.7559674438142859 - One-Electron Energy = -2.5561468709735569 - Two-Electron Energy = 0.6732547348319164 - Total Energy = -1.1269246923273546 + One-Electron Energy = -2.5561468709736159 + Two-Electron Energy = 0.6732547348319745 + Total Energy = -1.1269246923273557 Computation Completed @@ -276,14 +276,14 @@ Properties computed using the SCF density matrix ------------------------------------------------------------------------------------ -*** tstop() called on renke-mbp15.wireless.emory.edu at Wed May 3 15:37:55 2023 +*** tstop() called on renke-mbp15.wireless.emory.edu at Fri May 5 14:03:30 2023 Module time: - user time = 0.62 seconds = 0.01 minutes - system time = 0.11 seconds = 0.00 minutes + user time = 0.66 seconds = 0.01 minutes + system time = 0.09 seconds = 0.00 minutes total time = 1 seconds = 0.02 minutes Total time: - user time = 0.62 seconds = 0.01 minutes - system time = 0.11 seconds = 0.00 minutes + user time = 0.66 seconds = 0.01 minutes + system time = 0.09 seconds = 0.00 minutes total time = 1 seconds = 0.02 minutes Read options for space RESTRICTED_DOCC @@ -374,12 +374,12 @@ Total time: Starting second half-transformation. Two-electron integral transformation complete. - Integral transformation done. 0.01221576 s + Integral transformation done. 0.01021944 s Reading the two-electron integrals from disk Size of two-electron integrals: 0.000224 GB - Timing for conventional integral transformation: 0.034 s. + Timing for conventional integral transformation: 0.029 s. Timing for freezing core and virtual orbitals: 0.000 s. - Timing for computing conventional integrals: 0.035 s. + Timing for computing conventional integrals: 0.029 s. ==> Summary of Active Space Solver Input <== @@ -402,7 +402,7 @@ External solver: save active space integrals to as_ints.json Multi.(2ms) Irrep. No. Energy -------------------------------------------------------- - 1 ( 0) Ag 0 -1.143977430764 n/a + 1 ( 0) Ag 0 -1.129181390402 n/a -------------------------------------------------------- ==> Semicanonicalize Orbitals <== @@ -418,13 +418,28 @@ External solver: save active space integrals to as_ints.json Off-Diag. Elements Max 2-Norm ------------------------------------------------ GAS1 0.0000000000 0.0000000000 - RESTRICTED_UOCC 0.0000000000 0.0000000000 + RESTRICTED_UOCC 0.0003263893 0.0005082115 ------------------------------------------------ - Canonicalization test passed + Canonicalization test failed - Orbitals are already semicanonicalized. - Timing for orbital canonicalization: 0.007 s. + Integrals are about to be updated. + Computing Conventional Integrals Presorting SO-basis two-electron integrals. + Sorting File: SO Ints (nn|nn) nbuckets = 1 + Constructing frozen core operators + Starting first half-transformation. + Sorting half-transformed integrals. + First half integral transformation complete. + Starting second half-transformation. + Two-electron integral transformation complete. + + Integral transformation done. 0.00944857 s + Reading the two-electron integrals from disk + Size of two-electron integrals: 0.000224 GB + Timing for conventional integral transformation: 0.033 s. + Timing for freezing core and virtual orbitals: 0.000 s. + Integrals update took 0.033 s. + Timing for orbital canonicalization: 0.034 s. ==> Multireference Driven Similarity Renormalization Group <== @@ -468,18 +483,18 @@ External solver: save active space integrals to as_ints.json ==> Computing DSRG-MRPT2 ... <== - Computing T2 amplitudes ... Done. Timing 0.003785 s - Computing T1 amplitudes ... Done. Timing 0.006108 s - Renormalizing two-electron integrals ... Done. Timing 0.000886 s - Renormalizing Fock matrix elements ... Done. Timing 0.007346 s - Computing <[F, T1]> ... Done. Timing 0.003848 s - Computing <[F, T2]> ... Done. Timing 0.008826 s - Computing <[V, T1]> ... Done. Timing 0.008724 s - Computing <[V, T2]> (C_2)^4 ... Done. Timing 0.050799 s - Computing <[V, T2]> C_4 (C_2)^2 HH ... Done. Timing 0.013174 s - Computing <[V, T2]> C_4 (C_2)^2 PP ... Done. Timing 0.012941 s - Computing <[V, T2]> C_4 (C_2)^2 PH ... Done. Timing 0.056902 s - Computing <[V, T2]> C_6 C_2 ... Done. Timing 0.022738 s + Computing T2 amplitudes ... Done. Timing 0.003803 s + Computing T1 amplitudes ... Done. Timing 0.005974 s + Renormalizing two-electron integrals ... Done. Timing 0.001242 s + Renormalizing Fock matrix elements ... Done. Timing 0.006399 s + Computing <[F, T1]> ... Done. Timing 0.003246 s + Computing <[F, T2]> ... Done. Timing 0.007905 s + Computing <[V, T1]> ... Done. Timing 0.008717 s + Computing <[V, T2]> (C_2)^4 ... Done. Timing 0.051802 s + Computing <[V, T2]> C_4 (C_2)^2 HH ... Done. Timing 0.016473 s + Computing <[V, T2]> C_4 (C_2)^2 PP ... Done. Timing 0.018752 s + Computing <[V, T2]> C_4 (C_2)^2 PH ... Done. Timing 0.070707 s + Computing <[V, T2]> C_6 C_2 ... Done. Timing 0.023715 s ==> Excitation Amplitudes Summary <== @@ -487,101 +502,93 @@ External solver: save active space integrals to as_ints.json Largest T1 amplitudes for spin case A: i a i a i a -------------------------------------------------------------------------------- - [ 5 7 ]-0.127465 [ 5 6 ] 0.021252 [ 0 2 ]-0.004193 - [ 0 1 ]-0.002807 + [ 5 6 ] 0.000101 [ 0 1 ] 0.000055 [ 0 2 ]-0.000034 + [ 5 7 ] 0.000017 -------------------------------------------------------------------------------- - Norm of T1A vector: (nonzero elements: 4) 0.129323314790068. + Norm of T1A vector: (nonzero elements: 4) 0.000120510799952. -------------------------------------------------------------------------------- Largest T1 amplitudes for spin case B: _ _ _ _ _ _ i a i a i a -------------------------------------------------------------------------------- - [ 5 7 ]-0.127465 [ 5 6 ] 0.021252 [ 0 2 ]-0.004193 - [ 0 1 ]-0.002807 + [ 5 6 ] 0.000101 [ 0 1 ] 0.000055 [ 0 2 ]-0.000034 + [ 5 7 ] 0.000017 -------------------------------------------------------------------------------- - Norm of T1B vector: (nonzero elements: 4) 0.129323314790068. + Norm of T1B vector: (nonzero elements: 4) 0.000120510799952. -------------------------------------------------------------------------------- Largest T2 amplitudes for spin case AA: i j a b i j a b i j a b -------------------------------------------------------------------------------- - [ 0 5 2 5] 0.040812 [ 0 5 1 5]-0.037744 [ 0 5 0 7]-0.020614 - [ 0 5 3 9] 0.013435 [ 0 5 4 8] 0.013435 [ 0 5 1 6]-0.009523 - [ 0 5 2 6] 0.007949 [ 0 5 2 7] 0.007325 [ 0 5 1 7]-0.007258 - [ 0 5 0 6] 0.003915 + [ 0 5 0 6]-0.023744 [ 0 5 1 6]-0.023617 [ 0 5 1 5]-0.023224 + [ 0 5 2 6] 0.014902 [ 0 5 2 5] 0.009399 [ 0 5 3 9] 0.007343 + [ 0 5 4 8] 0.007343 [ 0 5 2 7] 0.003824 [ 0 5 1 7]-0.000602 + [ 0 5 0 7]-0.000314 -------------------------------------------------------------------------------- - Norm of T2AA vector: (nonzero elements: 40) 0.128866878247692. + Norm of T2AA vector: (nonzero elements: 40) 0.091525190041527. -------------------------------------------------------------------------------- Largest T2 amplitudes for spin case AB: _ _ _ _ _ _ i j a b i j a b i j a b -------------------------------------------------------------------------------- - [ 0 0 0 1]-0.064689 [ 0 5 1 5]-0.061573 [ 5 5 2 2]-0.045360 - [ 0 0 1 1]-0.034745 [ 0 0 8 8]-0.033036 [ 0 0 9 9]-0.033036 - [ 5 5 3 3]-0.032944 [ 5 5 4 4]-0.032944 [ 0 5 0 7]-0.030506 - [ 5 5 0 1] 0.026285 [ 0 0 0 2] 0.021026 [ 5 5 8 8]-0.020666 - [ 5 5 9 9]-0.020666 [ 5 5 5 7]-0.019695 [ 0 5 1 6]-0.019404 + [ 0 0 0 1]-0.065321 [ 0 5 0 6]-0.045860 [ 0 0 6 6]-0.038369 + [ 0 0 1 1]-0.035350 [ 0 0 8 8]-0.032988 [ 0 0 9 9]-0.032988 + [ 0 0 5 6]-0.026426 [ 5 5 6 6]-0.026239 [ 0 5 1 6]-0.022712 + [ 0 0 0 2] 0.020834 [ 5 5 0 2]-0.016950 [ 5 5 5 6]-0.015893 + [ 0 0 2 2]-0.014867 [ 5 5 2 2]-0.013738 [ 0 5 1 5]-0.012927 -------------------------------------------------------------------------------- - Norm of T2AB vector: (nonzero elements: 80) 0.206499845293523. + Norm of T2AB vector: (nonzero elements: 80) 0.168170084659699. -------------------------------------------------------------------------------- Largest T2 amplitudes for spin case BB: _ _ _ _ _ _ _ _ _ _ _ _ i j a b i j a b i j a b -------------------------------------------------------------------------------- - [ 0 5 2 5] 0.040812 [ 0 5 1 5]-0.037744 [ 0 5 0 7]-0.020614 - [ 0 5 3 9] 0.013435 [ 0 5 4 8] 0.013435 [ 0 5 1 6]-0.009523 - [ 0 5 2 6] 0.007949 [ 0 5 2 7] 0.007325 [ 0 5 1 7]-0.007258 - [ 0 5 0 6] 0.003915 + [ 0 5 0 6]-0.023744 [ 0 5 1 6]-0.023617 [ 0 5 1 5]-0.023224 + [ 0 5 2 6] 0.014902 [ 0 5 2 5] 0.009399 [ 0 5 3 9] 0.007343 + [ 0 5 4 8] 0.007343 [ 0 5 2 7] 0.003824 [ 0 5 1 7]-0.000602 + [ 0 5 0 7]-0.000314 -------------------------------------------------------------------------------- - Norm of T2BB vector: (nonzero elements: 40) 0.128866878247692. + Norm of T2BB vector: (nonzero elements: 40) 0.091525190041527. -------------------------------------------------------------------------------- ==> Possible Intruders <== - T1 amplitudes larger than 0.1000 for spin case A: - Amplitude Value Denominator - ---------------------------------------------------------------------- - [ 5 7 ] -0.12746529 ( 0.667430 - 3.835286 = -3.167856) - ---------------------------------------------------------------------- - T1 amplitudes larger than 0.1000 for spin case B: - Amplitude Value Denominator - ---------------------------------------------------------------------- - [ 5 7 ] -0.12746529 ( 0.667430 - 3.835286 = -3.167856) - ---------------------------------------------------------------------- + T1 amplitudes larger than 0.1000 for spin case A: NULL + T1 amplitudes larger than 0.1000 for spin case B: NULL T2 amplitudes larger than 0.1000 for spin case AA: NULL T2 amplitudes larger than 0.1000 for spin case AB: NULL T2 amplitudes larger than 0.1000 for spin case BB: NULL ==> DSRG-MRPT2 Energy Summary <== - E0 (reference) = -1.143977430763697 - <[F, T1]> = -0.000906192213893 - <[F, T2]> = 0.002630686262774 - <[V, T1]> = 0.001121703247208 - <[V, T2]> (C_2)^4 = -0.017293986299711 + E0 (reference) = -1.129181390402433 + <[F, T1]> = -0.000000029423301 + <[F, T2]> = -0.000001283090089 + <[V, T1]> = -0.000000286268613 + <[V, T2]> (C_2)^4 = -0.024304562802958 <[V, T2]> C_4 (C_2)^2 HH = 0.000000000000000 - <[V, T2]> C_4 (C_2)^2 PP = 0.003776386885707 - <[V, T2]> C_4 (C_2)^2 PH = -0.000158962932292 - <[V, T2]> C_6 C_2 = -0.000848949755016 - <[V, T2]> = -0.014525512101311 - DSRG-MRPT2 correlation energy = -0.011679314805223 - DSRG-MRPT2 total energy = -1.155656745568920 - max(T1) = 0.127465290391824 - max(T2) = 0.064688733093830 - ||T1|| = 0.182890785707159 - ||T2|| = 0.451422295687315 + <[V, T2]> C_4 (C_2)^2 PP = 0.001000024276417 + <[V, T2]> C_4 (C_2)^2 PH = -0.001219193218239 + <[V, T2]> C_6 C_2 = -0.000051659626285 + <[V, T2]> = -0.024575391371065 + DSRG-MRPT2 correlation energy = -0.024576990153068 + DSRG-MRPT2 total energy = -1.153758380555501 + max(T1) = 0.000100506507355 + max(T2) = 0.065320926540899 + ||T1|| = 0.000170428007704 + ||T2|| = 0.360386501303914 - Energy took 0.208 s + Energy took 0.224 s ==> De-Normal-Order DSRG Transformed Hamiltonian <== - Computing the scalar term ... Done. Timing 0.003 s + Computing the scalar term ... Done. Timing 0.004 s Computing the 1-body term ... Done. Timing 0.002 s ==> Rotate DSRG Transformed Hamiltonian back to Original Basis <== Rotating 1-body term to original basis ... Done. Timing 0.001 s - Rotating 2-body term to original basis ... Done. Timing 0.030 sExternal solver: save DSRG dressed integrals to dsrg_ints.json + Rotating 2-body term to original basis ... Done. Timing 0.032 sExternal solver: save DSRG dressed integrals to dsrg_ints.json ==> Summary of Active Space Solver Input <== @@ -627,10 +634,10 @@ External solver: save active space integrals to as_ints.json --------------------------------------------- Root Energy Spin --------------------------------------------- - 0 -1.156171120024 0.000 singlet - 1 0.532920839239 0.000 singlet + 0 -1.153762971093 0.000 singlet + 1 0.066865403127 0.000 singlet --------------------------------------------- - Timing for initial guess = 0.001 s + Timing for initial guess = 0.000 s ==> Diagonalizing Hamiltonian <== @@ -640,22 +647,22 @@ External solver: save active space integrals to as_ints.json ----------------------------------------------------- Iter. Avg. Energy Delta_E Res. Norm ----------------------------------------------------- - 1 -1.156171120024 -1.156e+00 +1.156e+00 - 2 -1.156171120024 +0.000e+00 +2.225e-16 + 1 -1.153762971093 -1.154e+00 +1.154e+00 + 2 -1.153762971093 +0.000e+00 +4.441e-16 ----------------------------------------------------- The Davidson-Liu algorithm converged in 3 iterations. ==> Root No. 0 <== - 2 0 -0.99640290 + 2 0 -0.99897818 - Total Energy: -1.156171120024, : 0.000000 + Total Energy: -1.153762971093, : -0.000000 ==> Energy Summary <== Multi.(2ms) Irrep. No. Energy -------------------------------------------------------- - 1 ( 0) Ag 0 -1.156171120024 0.000000 + 1 ( 0) Ag 0 -1.153762971093 -0.000000 -------------------------------------------------------- => DSRG-MRPT2 Reference Relaxation Energy Summary <= @@ -664,25 +671,25 @@ External solver: save active space integrals to as_ints.json ------------------------------- ------------------------------- Iter. Total Energy Delta Total Energy Delta ----------------------------------------------------------------------- - 1 -1.155656745569 -1.156e+00 -1.156171120024 -1.156e+00 + 1 -1.153758380556 -1.154e+00 -1.153762971093 -1.154e+00 ----------------------------------------------------------------------- ==> Total Timings (s) for Computing Commutators <== [H1, T1] [H1, T2] [H2, T1] [H2, T2] ----------------------------------------------------- - -> C0 0.004 0.009 0.009 0.157 - -> C1 0.003 0.023 0.015 0.314 - -> C2 0.016 0.015 0.109 + -> C0 0.003 0.008 0.009 0.182 + -> C1 0.003 0.021 0.015 0.339 + -> C2 0.017 0.017 0.116 ----------------------------------------------------- - Time to prepare integrals: 0.064 seconds - Time to run job : 0.867 seconds - Total : 0.931 seconds + Time to prepare integrals: 0.052 seconds + Time to run job : 0.901 seconds + Total : 0.953 seconds DSRG-MRPT2 partial relaxed energy (external RDM)......................................PASSED - Psi4 stopped on: Wednesday, 03 May 2023 03:37PM - Psi4 wall time for execution: 0:00:02.60 + Psi4 stopped on: Friday, 05 May 2023 02:03PM + Psi4 wall time for execution: 0:00:02.29 *** Psi4 exiting successfully. Buy a developer a beer! diff --git a/tests/methods/external_solver-2/rdms.json b/tests/methods/external_solver-2/rdms.json index 152045008..2d705a7cd 100644 --- a/tests/methods/external_solver-2/rdms.json +++ b/tests/methods/external_solver-2/rdms.json @@ -1,6 +1,6 @@ { "energy": { - "data": -1.1439774307636976, + "data": -1.1291813904024326, "description": "energy" }, "gamma1": { @@ -8,7 +8,7 @@ [ 0, 0, - 0.9895720514791457 + 0.998128762148389 ], [ 0, @@ -23,12 +23,12 @@ [ 2, 2, - 0.010427948520854444 + 0.001871237851611146 ], [ 1, 1, - 0.9895720514791457 + 0.998128762148389 ], [ 1, @@ -43,7 +43,7 @@ [ 3, 3, - 0.010427948520854444 + 0.001871237851611146 ] ], "description": "one-body density matrix as a list of tuples (i,j,)" @@ -62,28 +62,28 @@ 1, 0, 1, - 0.9895720514791457 + 0.998128762148389 ], [ 0, 1, 1, 0, - -0.9895720514791457 + -0.998128762148389 ], [ 1, 0, 0, 1, - -0.9895720514791457 + -0.998128762148389 ], [ 1, 0, 1, 0, - 0.9895720514791457 + 0.998128762148389 ], [ 1, @@ -188,28 +188,28 @@ 1, 2, 3, - -0.10158349477400773 + -0.04321731505442979 ], [ 0, 1, 3, 2, - 0.10158349477400773 + 0.04321731505442979 ], [ 1, 0, 2, 3, - 0.10158349477400773 + 0.04321731505442979 ], [ 1, 0, 3, 2, - -0.10158349477400773 + -0.04321731505442979 ], [ 1, @@ -566,28 +566,28 @@ 3, 0, 1, - -0.10158349477400773 + -0.04321731505442979 ], [ 2, 3, 1, 0, - 0.10158349477400773 + 0.04321731505442979 ], [ 3, 2, 0, 1, - 0.10158349477400773 + 0.04321731505442979 ], [ 3, 2, 1, 0, - -0.10158349477400773 + -0.04321731505442979 ], [ 3, @@ -692,28 +692,28 @@ 3, 2, 3, - 0.010427948520854444 + 0.001871237851611146 ], [ 2, 3, 3, 2, - -0.010427948520854444 + -0.001871237851611146 ], [ 3, 2, 2, 3, - -0.010427948520854444 + -0.001871237851611146 ], [ 3, 2, 3, 2, - 0.010427948520854444 + 0.001871237851611146 ], [ 3, @@ -12249,5 +12249,9 @@ ] ], "description": "three-body density matrix as a list of tuples (i,j,k,l,m,n )" + }, + "nso": { + "data": 4, + "description": "number of active spin orbitals" } } \ No newline at end of file From 4f05619f5fce2b64639af64c8a740173a71234c0 Mon Sep 17 00:00:00 2001 From: RenkeHuang Date: Fri, 5 May 2023 14:54:41 -0400 Subject: [PATCH 3/3] add section of how to save rdms in manual --- docs/source/methods/external_solver.rst | 45 ++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/docs/source/methods/external_solver.rst b/docs/source/methods/external_solver.rst index af1d49f11..ebb368f75 100644 --- a/docs/source/methods/external_solver.rst +++ b/docs/source/methods/external_solver.rst @@ -12,10 +12,11 @@ Read external RDMs for correlation computations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Forte external solver will check if there is a json file named ``rdms.json`` present in the current working directory. -See `the test case `_ for the data format used in ``rdms.json``. +See `the test case `_ for the data format used in ``rdms.json``. If the file is present, the external solver will read the RDMs and compute the reference energy. -Here is the simplet input for a DSRG-MRPT2 computation using external RDMs:: +Here is the simplest input for a DSRG-MRPT2 computation using external RDMs:: + import forte molecule h2{ 0 1 H @@ -46,8 +47,9 @@ Export integrals to disk Forte can export two types of integrals: 1) active space integrals from an ``ActiveSpaceSolver`` (which define a bare Hamiltonian), 2) DSRG-dressed integrals. -The minimal input for writing active space integrals to disk (save as ``as_ints.json``):: +The minimal input for writing active space integrals to disk (save as ``as_ints.json``) is:: + import forte molecule h2{ 0 1 H @@ -69,12 +71,14 @@ The minimal input for writing active space integrals to disk (save as ``as_ints. energy('forte') +See `this example `_ for the data and the data format used in ``as_ints.json`` Note that saving the ``wfn.Ca()`` to ``coeff.json`` is always recommended to avoid sign flips and confusions in defining orbitals. For DSRG-dressed integrals, to enable the pipeline of the external active space solver and a correlation solver (computes the dressed integrals) that follows, two files ``rdms.json`` and ``coeff.json`` are required in the working directory. Then run the following input to export DSRG-dressed integrals to disk (save as ``dsrg_ints.json``):: + import forte molecule h2{ 0 1 H @@ -100,10 +104,43 @@ Then run the following input to export DSRG-dressed integrals to disk (save as ` energy('forte') +Note that the data format used in JSON file is the same for both types of integrals (``as_ints.json`` and ``dsrg_ints.json``). + + +Save RDMs to disk +^^^^^^^^^^^^^^^^^ +Forte also provides the functionality of exporting the reference RDMs (from an ``ActiveSpaceSolver``) to disk (save as ``ref_rdms.json``). +This file shares the same data format as ``rdms.json``, so you can simply rename it for the purpose of quick testing of the external solver. +Note that the external solver is only an I/O interface and cannot compute the RDMs on its own. +To generate RDMs, we need to use another active space solver that implements the RDM calculations (for example, ``FCI``, ``CAS``, ``ACI``). +:: + + import forte + molecule h2{ + 0 1 + H + H 1 0.7 + } + + set { + basis cc-pVDZ + scf_type pk + e_convergence 12 + } + + set forte { + active_space_solver fci # use: fci, cas, aci + write_rdm true # save ref_rdms.json + write_wfn true # save coeff.json + active [1, 0, 0, 0, 0, 1, 0, 0] + restricted_docc [0, 0, 0, 0, 0, 0, 0, 0] + } + + energy('forte') Options -~~~~~~~ +^^^^^^^ **WRITE_RDM**