calc_separate_rdm_labels Subroutine

public pure subroutine calc_separate_rdm_labels(ijkl, ij, kl, i, j, k, l)

Uses

Arguments

Type IntentOptional Attributes Name
integer(kind=int_rdm), intent(in) :: ijkl
integer, intent(out) :: ij
integer, intent(out) :: kl
integer, intent(out) :: i
integer, intent(out) :: j
integer, intent(out) :: k
integer, intent(out) :: l

Contents


Source Code

    pure subroutine calc_separate_rdm_labels(ijkl, ij, kl, i, j, k, l)

        ! Decode the four orbital labels stored in the input ijkl, i.e. do the
        ! opposite of calc_combined_rdm_label.

        use SystemData, only: nbasis

        integer(int_rdm), intent(in) :: ijkl
        integer, intent(out) :: ij, kl, i, j, k, l ! spin or spatial orbitals

        kl = int(mod(ijkl - 1, int(nbasis, int_rdm)**2)) + 1
        ij = int((ijkl - int(kl, int_rdm)) / int(nbasis, int_rdm)**2) + 1

        j = mod(ij - 1, nbasis) + 1
        i = (ij - j) / nbasis + 1

        l = mod(kl - 1, nbasis) + 1
        k = (kl - l) / nbasis + 1

    end subroutine calc_separate_rdm_labels