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