print_2_states Subroutine

public subroutine print_2_states(left, right, nunit)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(in) :: left(0:niftot)
integer(kind=n_int), intent(in) :: right(0:niftot)
integer, intent(in), optional :: nunit

Contents

Source Code


Source Code

    subroutine print_2_states(left, right, nunit)
        integer(n_int), intent(in) :: left(0:niftot), right(0:niftot)
        integer, intent(in), optional :: nunit

        integer :: iout
        real(dp) :: left_sign(lenof_sign), right_sign(lenof_sign)

        if (present(nUnit)) then
            iout = nunit
        else
            iout = stdout
        end if

        call extract_sign(left, left_sign)
        call extract_sign(right, right_sign)
        ! print the left side
        if (all(left == 0_n_int)) then
            call print_null_det(iout)
        else
            call writeDetBit(iout, left, .false.)
        end if
        write(iout, '(A1)', advance='no') "|"
        write(iout, '(f16.7)', advance='no') left_sign(1)
        write(iout, '(A1)', advance='no') "|"
        write(iout, '(f16.7)', advance='no') right_sign(1)
        write(iout, '(A1)', advance='no') "|"

        ! then print right side
        if (all(right == 0_n_int)) then
            call print_null_det(iout, .true.)
        else
            call writeDetBit(iout, right, .true.)
        end if

    end subroutine print_2_states