matrix_util Module



Contents


Interfaces

public interface linspace

  • private function linspace_sp(start_val, end_val, n_opt) result(vec)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: start_val
    real(kind=sp), intent(in) :: end_val
    integer, intent(in), optional :: n_opt

    Return Value real(kind=sp), allocatable, (:)

  • private function linspace_dp(start_val, end_val, n_opt) result(vec)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: start_val
    real(kind=dp), intent(in) :: end_val
    integer, intent(in), optional :: n_opt

    Return Value real(kind=dp), allocatable, (:)

public interface eig

  • private subroutine eig_cmplx(matrix, e_values, e_vectors, t_left_ev)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=dp), intent(in) :: matrix(:,:)
    real(kind=dp), intent(out) :: e_values(size(matrix,1))
    complex(kind=dp), intent(out), optional :: e_vectors(size(matrix,1),size(matrix,1))
    logical, intent(in), optional :: t_left_ev
  • private subroutine eig_real(matrix, e_values, e_vectors, t_left_ev)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: matrix(:,:)
    real(kind=dp), intent(out) :: e_values(size(matrix,1))
    real(kind=dp), intent(out), optional :: e_vectors(size(matrix,1),size(matrix,1))
    logical, intent(in), optional :: t_left_ev

public interface calc_eigenvalues

  • private function calc_eigenvalues_real(matrix) result(e_values)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: matrix(:,:)

    Return Value real(kind=dp), (size(matrix,1))

  • private function calc_eigenvalues_cmplx(matrix) result(e_values)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=dp), intent(in) :: matrix(:,:)

    Return Value real(kind=dp), (size(matrix,1))


Functions

private function calc_eigenvalues_real(matrix) result(e_values)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)

Return Value real(kind=dp), (size(matrix,1))

private function calc_eigenvalues_cmplx(matrix) result(e_values)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: matrix(:,:)

Return Value real(kind=dp), (size(matrix,1))

public function check_symmetric(matrix)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)

Return Value logical

public function det(matrix)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)

Return Value real(kind=dp)

public function blas_matmul(A, B) result(C)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: A(:,:)
real(kind=dp), intent(in) :: B(:,:)

Return Value real(kind=dp), (size(A,1),size(A,2))

private function linspace_sp(start_val, end_val, n_opt) result(vec)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: start_val
real(kind=sp), intent(in) :: end_val
integer, intent(in), optional :: n_opt

Return Value real(kind=sp), allocatable, (:)

private function linspace_dp(start_val, end_val, n_opt) result(vec)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: start_val
real(kind=dp), intent(in) :: end_val
integer, intent(in), optional :: n_opt

Return Value real(kind=dp), allocatable, (:)

public function matrix_exponential(matrix) result(exp_matrix)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)

Return Value real(kind=dp), (size(matrix,1),size(matrix,2))

private function matrix_diag(vector) result(diag)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vector(:)

Return Value real(kind=dp), (size(vector),size(vector))

public function matrix_inverse(matrix) result(inverse)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)

Return Value real(kind=dp), (size(matrix,1),size(matrix,2))

public function norm(vec, p_in)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vec(:)
integer, intent(in), optional :: p_in

Return Value real(kind=dp)

public pure function my_minval(vec, target_state)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vec(:)
integer, intent(in), optional :: target_state

Return Value real(kind=dp)

public pure function my_minloc(vec, target_state)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vec(:)
integer, intent(in), optional :: target_state

Return Value integer

public function norm_cmplx(vec, p_in)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: vec(:)
integer, intent(in), optional :: p_in

Return Value real(kind=dp)


Subroutines

public subroutine print_vec(vec, filename, t_index, t_zero)

Arguments

Type IntentOptional Attributes Name
class(*), intent(in) :: vec(:)
character(len=*), intent(in), optional :: filename
logical, intent(in), optional :: t_index
logical, intent(in), optional :: t_zero

private subroutine eig_real(matrix, e_values, e_vectors, t_left_ev)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)
real(kind=dp), intent(out) :: e_values(size(matrix,1))
real(kind=dp), intent(out), optional :: e_vectors(size(matrix,1),size(matrix,1))
logical, intent(in), optional :: t_left_ev

private subroutine eig_cmplx(matrix, e_values, e_vectors, t_left_ev)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: matrix(:,:)
real(kind=dp), intent(out) :: e_values(size(matrix,1))
complex(kind=dp), intent(out), optional :: e_vectors(size(matrix,1),size(matrix,1))
logical, intent(in), optional :: t_left_ev

public subroutine eig_sym(matrix, e_values, e_vectors)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)
real(kind=dp), intent(out) :: e_values(size(matrix,1))
real(kind=dp), intent(out), optional :: e_vectors(size(matrix,1),size(matrix,2))

public subroutine print_matrix(matrix, iunit)

Arguments

Type IntentOptional Attributes Name
class(*), intent(in) :: matrix(:,:)
integer, intent(in), optional :: iunit

public subroutine store_hf_coeff(e_values, e_vecs, target_state, hf_coeff, hf_ind, gs_ind)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: e_values(:)
real(kind=dp), intent(in) :: e_vecs(:,:)
integer, intent(in), optional :: target_state
real(kind=dp), intent(out) :: hf_coeff
integer, intent(out) :: hf_ind
integer, intent(out) :: gs_ind

public subroutine find_degeneracies(e_values, ind, pairs)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: e_values(:)
integer, intent(out), allocatable :: ind(:,:)
integer, intent(out), allocatable :: pairs(:,:)