calc_n_triples Subroutine

private subroutine calc_n_triples()

Arguments

None

Contents

Source Code


Source Code

    subroutine calc_n_triples()
        ! this routine calculates the number of "important" triples
        ! from the samples singles and doubles amplitudes:
        ! essentiall calulating T1 * T2

        integer :: i, j, ia(2, 1), jk_cd(2, 2)

        do i = 1, cc_ops(1)%n_ops
            ! for each t_i^a i have to check if a double excitation is
            ! possible on top of it..
            if (.not. cc_ops(1)%set_flag(i) == 1) cycle

            ia = cc_ops(1)%get_ex(i)

            do j = 1, cc_ops(2)%n_ops

                ! i also have to check if the amplitute was set
                if (.not. cc_ops(2)%set_flag(j) == 1) cycle

                jk_cd = cc_ops(2)%get_ex(j)

                ! check if the operators fit..
                if (any(ia(1, 1) == jk_cd(1, :)) .or. any(ia(2, 1) == jk_cd(2, :))) then
                    cycle
                end if
                ! if it fits increase the triples counter:
                est_triples = est_triples + 1

            end do
        end do

    end subroutine calc_n_triples