orthogonalise_against_previous_basis_vectors Subroutine

public subroutine orthogonalise_against_previous_basis_vectors(this, basis_index)

Arguments

Type IntentOptional Attributes Name
type(HamiltonianCalcType), intent(inout) :: this
integer, intent(in) :: basis_index

Contents


Source Code

    subroutine orthogonalise_against_previous_basis_vectors(this, basis_index)
        type(HamiltonianCalcType), intent(inout) :: this
        integer, intent(in) :: basis_index
        integer :: i

        associate(v => this%basis_vectors(:, basis_index))
        do i = 1, basis_index - 1
            v = v - this%basis_vectors(:, i) * inner_product(v, this%basis_vectors(:, i)) &
                / inner_product(this%basis_vectors(:, i), this%basis_vectors(:, i))
        end do
        !v = v/euclidean_norm(v)
        end associate

    end subroutine orthogonalise_against_previous_basis_vectors