Skip to content

Commit

Permalink
Merge pull request #39 from william-dawson/ReviewDocumentation
Browse files Browse the repository at this point in the history
Fixed a bunch of documentation errors.
  • Loading branch information
william-dawson authored Feb 19, 2018
2 parents b53f7dc + afe751e commit 780ac80
Show file tree
Hide file tree
Showing 64 changed files with 583 additions and 939 deletions.
29 changes: 29 additions & 0 deletions Citations.bib
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,32 @@ @article{exner2002comparison
year={2002},
publisher={ACS Publications}
}

@article{ozaki2001efficient,
title={Efficient recursion method for inverting an overlap matrix},
author={Ozaki, T},
journal={Physical Review B},
volume={64},
number={19},
pages={195110},
year={2001},
publisher={APS}
}

@book{boisvert1996matrix,
title={The matrix market exchange formats: Initial design},
author={Boisvert, Ronald F and Boisvert, Ronald F and Remington, Karin A},
year={1996},
publisher={US Department of Commerce, National Institute of Standards and Technology}
}

@article{jansik2007linear,
title={Linear-scaling symmetric square-root decomposition of the overlap matrix},
author={Jans{\'\i}k, Branislav and H{\o}st, Stinne and J{\o}rgensen, Poul and Olsen, Jeppe and Helgaker, Trygve},
journal={The Journal of chemical physics},
volume={126},
number={12},
pages={124104},
year={2007},
publisher={AIP}
}
2 changes: 1 addition & 1 deletion Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = @CMAKE_SOURCE_DIR@/Source @CMAKE_SOURCE_DIR@/UnitTests @CMAKE_SOURCE_DIR@/ReadMe.md
INPUT = @CMAKE_SOURCE_DIR@/Source/Fortran @CMAKE_SOURCE_DIR@/Source/CPlusPlus @CMAKE_SOURCE_DIR@/ReadMe.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
Expand Down
15 changes: 4 additions & 11 deletions Source/CPlusPlus/DensityMatrixSolvers.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class DistributedSparseMatrix;
class DensityMatrixSolvers : public SolverBase {
public:
//! Compute the density matrix from a Hamiltonian using the TRS2 method.
//! Based on the TRS2 algorithm presented in:
//! Niklasson, Anders MN. "Expansion algorithm for the density matrix."
//! Physical Review B 66, no. 15 (2002): 155115.
//! Based on the TRS2 algorithm presented in: \cite niklasson2002.
//!\param Hamiltonian the matrix to compute the corresponding density from.
//!\param InverseSquareRoot of the overlap matrix.
//!\param nel the number of electrons.
Expand All @@ -26,9 +24,7 @@ class DensityMatrixSolvers : public SolverBase {
double &chemical_potential_out,
const IterativeSolverParameters &solver_parameters);
//! Compute the density matrix from a Hamiltonian using the TRS4 method.
//! Based on the TRS4 algorithm presented in:
//! Niklasson, Anders MN. "Expansion algorithm for the density matrix."
//! Physical Review B 66, no. 15 (2002): 155115.
//! Based on the TRS4 algorithm presented in: \cite niklasson2002 .
//!\param Hamiltonian the matrix to compute the corresponding density from.
//!\param InverseSquareRoot of the overlap matrix.
//!\param nel the number of electrons.
Expand All @@ -40,11 +36,8 @@ class DensityMatrixSolvers : public SolverBase {
DistributedSparseMatrix &Density,
double &chemical_potential_out,
const IterativeSolverParameters &solver_parameters);
//! Compute the density matrix from a Hamiltonian using the TDB method.
//! Based on the algorithm presented in:
//! Truflandier, Lionel A., Rivo M. Dianzinga, and David R. Bowler.
//! "Communication: Generalized canonical purification for density matrix
//! minimization." The Journal of chemical physics 144, no. 9 (2016): 091102
//! Compute the density matrix from a Hamiltonian using the HPCP method.
//! Based on the algorithm presented in: \cite truflandier2016communication
//!\param Hamiltonian the matrix to compute the corresponding density from.
//!\param InverseSquareRoot of the overlap matrix.
//!\param nel the number of electrons.
Expand Down
2 changes: 1 addition & 1 deletion Source/CPlusPlus/DistributedMatrixMemoryPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DistributedMatrixMemoryPool {
public:
// Standard constructor.
DistributedMatrixMemoryPool();
// STandard destructor.
// Standard destructor.
~DistributedMatrixMemoryPool();

private:
Expand Down
2 changes: 1 addition & 1 deletion Source/CPlusPlus/EigenBounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EigenBounds : public SolverBase {
//! Compute a bounds on and maximum eigenvalue of a matrix.
//! Uses The Power Method.
//!\param matrix the matrix to compute the min/max of.
//!\param max_power_eig an uppder bound on the eigenspectrum.
//!\param max_power_eig an upper bound on the eigenspectrum.
//!\param solver_parameters parameters for the solver
static void PowerBounds(const DistributedSparseMatrix &matrix,
double * max_power_eig,
Expand Down
2 changes: 1 addition & 1 deletion Source/CPlusPlus/FixedSolversParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FixedSolverParameters {
public:
//! Constructor.
FixedSolverParameters();
//! Where to have a verbose calculation.
//! Whether to have a verbose calculation.
//!\param new_value
void SetVerbosity(bool new_value);
//! Threshold for flushing small values.
Expand Down
2 changes: 1 addition & 1 deletion Source/CPlusPlus/IterativeSolversParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class IterativeSolverParameters {
//! Max iterations to perform.
//!\param new_value
void SetMaxIterations(int new_value);
//! Where to have a verbose calculation.
//! Whether to have a verbose calculation.
//!\param new_value
void SetVerbosity(bool new_value);
//! Threshold for flushing small values.
Expand Down
2 changes: 1 addition & 1 deletion Source/CPlusPlus/LinearSolvers.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DistributedSparseMatrix;
//! A class for solving matrix equations.
class LinearSolvers : public SolverBase {
public:
//! Solve the matrix equation AX = B using conjugate gradient.
//! Solve the matrix equation AX = B using conjugate gradient method.
//!\param AMat the matrix A, must be symmetric, positive definite.
//!\param XMat the solved for matrix X.
//!\param BMat the right hand side.
Expand Down
11 changes: 3 additions & 8 deletions Source/CPlusPlus/MinimizerSolvers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ class DistributedSparseMatrix;
class MinimizerSolvers : public SolverBase {
public:
//! Compute the density matrix from a Hamiltonian using the CG method.
//! Based on two papers. The first by Scuseria:
//! Millam, John M., and Gustavo E. Scuseria. "Linear scaling conjugate
//! gradient density matrix search as an alternative to diagonalization for
//! first principles electronic structure calculations." The Journal of
//! chemical physics 106, no. 13 (1997): 5569-5577. The second one by
//! Chalacombe: Challacombe, Matt. "A simplified density matrix minimization
//! for linear scaling self-consistent field theory." The Journal of chemical
//! physics 110, no. 5 (1999): 2332-2342.
//! Based on two papers. Based on two papers. The first by Scuseria
//! \cite millam1997linear and then Challacombe
//! \cite challacombe1999simplified
//!\param Hamiltonian the matrix to compute the corresponding density from.
//!\param InverseSquareRoot of the overlap matrix.
//!\param nel the number of electrons.
Expand Down
40 changes: 21 additions & 19 deletions Source/Fortran/ChebyshevSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ MODULE ChebyshevSolversModule
!! @param[in] degree of the polynomial.
PURE SUBROUTINE ConstructChebyshevPolynomial(this, degree)
!! Parameters
TYPE(ChebyshevPolynomial_t), INTENT(inout) :: this
INTEGER, INTENT(in) :: degree
TYPE(ChebyshevPolynomial_t), INTENT(INOUT) :: this
INTEGER, INTENT(IN) :: degree

ALLOCATE(this%coefficients(degree))
this%coefficients = 0
Expand All @@ -44,7 +44,7 @@ END SUBROUTINE ConstructChebyshevPolynomial
!! @param[inout] this the polynomial to destruct.
PURE SUBROUTINE DestructChebyshevPolynomial(this)
!! Parameters
TYPE(ChebyshevPolynomial_t), INTENT(inout) :: this
TYPE(ChebyshevPolynomial_t), INTENT(INOUT) :: this
IF (ALLOCATED(this%coefficients)) THEN
DEALLOCATE(this%coefficients)
END IF
Expand All @@ -56,9 +56,9 @@ END SUBROUTINE DestructChebyshevPolynomial
!! @param[in] coefficient value.
SUBROUTINE SetChebyshevCoefficient(this, degree, coefficient)
!! Parameters
TYPE(ChebyshevPolynomial_t), INTENT(inout) :: this
INTEGER, INTENT(in) :: degree
REAL(NTREAL), INTENT(in) :: coefficient
TYPE(ChebyshevPolynomial_t), INTENT(INOUT) :: this
INTEGER, INTENT(IN) :: degree
REAL(NTREAL), INTENT(IN) :: coefficient

this%coefficients(degree) = coefficient
END SUBROUTINE SetChebyshevCoefficient
Expand All @@ -67,14 +67,14 @@ END SUBROUTINE SetChebyshevCoefficient
!! This method uses the standard Chebyshev Polynomial expansion.
!! @param[in] InputMat the input matrix
!! @param[out] OutputMat = poly(InputMat)
!! @param[in] poly polynomial to compute.
!! @param[in] poly the Chebyshev polynomial to compute.
!! @param[in] solver_parameters_in parameters for the solver (optional).
SUBROUTINE ChebyshevCompute(InputMat, OutputMat, poly, solver_parameters_in)
!! Parameters
TYPE(DistributedSparseMatrix_t), INTENT(in) :: InputMat
TYPE(DistributedSparseMatrix_t), INTENT(inout) :: OutputMat
TYPE(ChebyshevPolynomial_t), INTENT(in) :: poly
TYPE(FixedSolverParameters_t), INTENT(in), OPTIONAL :: solver_parameters_in
TYPE(DistributedSparseMatrix_t), INTENT(IN) :: InputMat
TYPE(DistributedSparseMatrix_t), INTENT(INOUT) :: OutputMat
TYPE(ChebyshevPolynomial_t), INTENT(IN) :: poly
TYPE(FixedSolverParameters_t), INTENT(IN), OPTIONAL :: solver_parameters_in
!! Handling Solver Parameters
TYPE(FixedSolverParameters_t) :: solver_parameters
!! Local Matrices
Expand Down Expand Up @@ -178,7 +178,7 @@ END SUBROUTINE ChebyshevCompute
!! version of the first method in \cite liang2003improved .
!! @param[in] InputMat the input matrix
!! @param[out] OutputMat = poly(InputMat)
!! @param[in] poly polynomial to compute.
!! @param[in] poly the Chebyshev polynomial to compute.
!! @param[in] solver_parameters_in parameters for the solver (optional).
SUBROUTINE FactorizedChebyshevCompute(InputMat, OutputMat, poly, &
& solver_parameters_in)
Expand Down Expand Up @@ -292,17 +292,18 @@ END SUBROUTINE FactorizedChebyshevCompute
!! @param[in] T_Powers the precomputed Chebyshev polynomials.
!! @param[in] poly polynomial coefficients.
!! @param[out] OutputMat = poly(InputMat)
!! @param[in] depth_in the depth of recursion.
!! @param[in] solver_parameters_in parameters for the solver.
!! @param[inout] pool the memory pool.
!! @param[in] depth the depth of recursion.
!! @param[in] solver_parameters parameters for the solver.
RECURSIVE SUBROUTINE ComputeRecursive(T_Powers, poly, OutputMat, pool, &
& depth, solver_parameters)
!! Parameters
TYPE(DistributedSparseMatrix_t), DIMENSION(:), INTENT(in) :: T_Powers
TYPE(ChebyshevPolynomial_t), INTENT(in) :: poly
TYPE(DistributedSparseMatrix_t), INTENT(inout) :: OutputMat
TYPE(DistributedSparseMatrix_t), DIMENSION(:), INTENT(IN) :: T_Powers
TYPE(ChebyshevPolynomial_t), INTENT(IN) :: poly
TYPE(DistributedSparseMatrix_t), INTENT(INOUT) :: OutputMat
INTEGER, INTENT(in) :: depth
TYPE(FixedSolverParameters_t), INTENT(in) :: solver_parameters
TYPE(DistributedMatrixMemoryPool_t), INTENT(inout) :: pool
TYPE(FixedSolverParameters_t), INTENT(IN) :: solver_parameters
TYPE(DistributedMatrixMemoryPool_t), INTENT(INOUT) :: pool
!! Local Data
INTEGER :: coefficient_midpoint
INTEGER :: left_length, right_length
Expand Down Expand Up @@ -359,4 +360,5 @@ RECURSIVE SUBROUTINE ComputeRecursive(T_Powers, poly, OutputMat, pool, &
END IF

END SUBROUTINE ComputeRecursive
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END MODULE ChebyshevSolversModule
3 changes: 0 additions & 3 deletions Source/Fortran/DataTypesModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ MODULE DataTypesModule
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> The precision of floating point numbers we will use in this program.
INTEGER, PARAMETER, PUBLIC :: NTREAL = c_double
!integer, parameter, public :: NTREAL = selected_real_kind( &
! & BITSPERDOUBLE)
!> MPI floating point datatype with the precision we will use in this program.
INTEGER, PUBLIC :: MPINTREAL
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
PUBLIC :: MPITypeInfoInit
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> A subroutine to make a double precision MPI type with the requested
!! precision. Must be called before MPINTREAL is used.
Expand Down
18 changes: 9 additions & 9 deletions Source/Fortran/DenseMatrixModule.f90
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> This (currently under construction) module allows one to convert
!! a sparse matrix to a dense matrix. It also supports dense the dense
!! versions of core matrix routines. This module will be used in situations
!! where matrices become too dense for good sparse matrix performance.
!> This module allows one to convert a sparse matrix to a dense matrix. It also
!! supports dense the dense versions of core matrix routines. This module is
!! used in situations where matrices become too dense for good sparse matrix
!! performance.
MODULE DenseMatrixModule
USE DataTypesModule
USE SparseMatrixModule
Expand All @@ -16,8 +16,8 @@ MODULE DenseMatrixModule
CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> A function that converts a sparse matrix to a dense matrix.
!! @param[in] sparse_matrix a sparse matrix to convert.
!! @param[inout] dense_matrix a preallocated
PURE SUBROUTINE ConstructDenseFromSparse(sparse_matrix,dense_matrix)
!! @param[inout] dense_matrix output. Must be preallocated.
PURE SUBROUTINE ConstructDenseFromSparse(sparse_matrix, dense_matrix)
!! Parameters
TYPE(SparseMatrix_t), INTENT(IN) :: sparse_matrix
REAL(NTREAL), DIMENSION(:,:), INTENT(INOUT) :: dense_matrix
Expand Down Expand Up @@ -46,8 +46,8 @@ END SUBROUTINE ConstructDenseFromSparse
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> A function that converts a dense matrix to a sparse matrix.
!! @param[in] dense_matrix to convert.
!! @param[out] sparse_matrix to build.
!! @param[in] threshold value for pruning.
!! @param[out] sparse_matrix output matrix.
!! @param[in] threshold value for pruning values to zero.
PURE SUBROUTINE ConstructSparseFromDense(dense_matrix,sparse_matrix,threshold)
!! Parameters
REAL(NTREAL), DIMENSION(:,:), INTENT(IN) :: dense_matrix
Expand Down Expand Up @@ -80,7 +80,7 @@ END SUBROUTINE ConstructSparseFromDense
!> A wrapper for multiplying two dense matrices.
!! @param[in] MatA the first matrix.
!! @param[in] MatB the second matrix.
!! @param[inout] MatC = MatA*MatB. Preallocated.
!! @param[inout] MatC = MatA*MatB. MatC must be preallocated.
PURE SUBROUTINE MultiplyDense(MatA,MatB,MatC)
!! Parameters
REAL(NTREAL), DIMENSION(:,:), INTENT(IN) :: MatA
Expand Down
21 changes: 11 additions & 10 deletions Source/Fortran/DensityMatrixSolversModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ MODULE DensityMatrixSolversModule
!! @param[in] InverseSquareRoot of the overlap matrix.
!! @param[in] nel the number of electrons.
!! @param[out] Density the density matrix computed by this routine.
!! @param[out] chemical_potential_out the chemical potential calculated.
!! @param[in] solver_parameters_in parameters for the solver
!! @param[out] chemical_potential_out the chemical potential (optional).
!! @param[in] solver_parameters_in parameters for the solver (optional)
SUBROUTINE TRS2(Hamiltonian, InverseSquareRoot, nel, Density, &
& chemical_potential_out, solver_parameters_in)
!! Parameters
TYPE(DistributedSparseMatrix_t), INTENT(IN) :: Hamiltonian, InverseSquareRoot
TYPE(DistributedSparseMatrix_t), INTENT(IN) :: Hamiltonian
TYPE(DistributedSparseMatrix_t), INTENT(IN) :: InverseSquareRoot
INTEGER, INTENT(IN) :: nel
TYPE(DistributedSparseMatrix_t), INTENT(INOUT) :: Density
REAL(NTREAL), INTENT(OUT), OPTIONAL :: chemical_potential_out
Expand Down Expand Up @@ -233,8 +234,8 @@ END SUBROUTINE TRS2
!! @param[in] InverseSquareRoot of the overlap matrix.
!! @param[in] nel the number of electrons.
!! @param[out] Density the density matrix computed by this routine.
!! @param[out] chemical_potential_out the chemical potential calculated.
!! @param[in] solver_parameters_in parameters for the solver
!! @param[out] chemical_potential_out the chemical potential (optional).
!! @param[in] solver_parameters_in parameters for the solver (optional).
SUBROUTINE TRS4(Hamiltonian, InverseSquareRoot, nel, Density, &
& chemical_potential_out, solver_parameters_in)
!! Parameters
Expand Down Expand Up @@ -466,12 +467,12 @@ END SUBROUTINE TRS4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Compute the density matrix from a Hamiltonian using the HPCP method.
!! Based on the algorithm presented in \cite truflandier2016communication
!! @param[in] Hamiltonian the matrix to compute the corresponding density from.
!! @param[in] Hamiltonian the matrix to compute the corresponding density from
!! @param[in] InverseSquareRoot of the overlap matrix.
!! @param[in] nel the number of electrons.
!! @param[out] Density the density matrix computed by this routine.
!! @param[out] chemical_potential_out the chemical potential calculated.
!! @param[in] solver_parameters_in parameters for the solver
!! @param[out] chemical_potential_out the chemical potential (optional).
!! @param[in] solver_parameters_in parameters for the solver (optional).
SUBROUTINE HPCP(Hamiltonian, InverseSquareRoot, nel, Density, &
& chemical_potential_out, solver_parameters_in)
!! Parameters
Expand Down Expand Up @@ -697,8 +698,8 @@ END SUBROUTINE HPCP
!! @param[in] InverseSquareRoot of the overlap matrix.
!! @param[in] nel the number of electrons.
!! @param[out] Density the density matrix computed by this routine.
!! @param[out] chemical_potential_out the chemical potential calculated.
!! @param[in] solver_parameters_in parameters for the solver
!! @param[out] chemical_potential_out the chemical potential (optional).
!! @param[in] solver_parameters_in parameters for the solver (optional).
SUBROUTINE HPCPPlus(Hamiltonian, InverseSquareRoot, nel, Density, &
& chemical_potential_out, solver_parameters_in)
!! Parameters
Expand Down
9 changes: 4 additions & 5 deletions Source/Fortran/DistributedMatrixMemoryPoolModule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ MODULE DistributedMatrixMemoryPoolModule
!> @param[out] this a constructed Matrix Memory Pool object.
PURE SUBROUTINE ConstructDistributedMatrixMemoryPool(this)
!! Parameters
TYPE(DistributedMatrixMemoryPool_t), INTENT(out) :: this
TYPE(DistributedMatrixMemoryPool_t), INTENT(INOUT) :: this

!! Allocate
CALL DestructDistributedMatrixMemoryPool(this)
Expand All @@ -34,7 +34,7 @@ END SUBROUTINE ConstructDistributedMatrixMemoryPool
!> @param[out] this Distributed Matrix Memory Pool object to destroy.
PURE SUBROUTINE DestructDistributedMatrixMemoryPool(this)
!! Parameters
TYPE(DistributedMatrixMemoryPool_t), INTENT(out) :: this
TYPE(DistributedMatrixMemoryPool_t), INTENT(INOUT) :: this
!! Local Data
INTEGER :: row_counter, column_counter

Expand All @@ -54,10 +54,9 @@ END SUBROUTINE DestructDistributedMatrixMemoryPool
!! handle the given parameters.
!> @param[in] this the memory pool to check.
!> @return true if the memory pool is valid.
PURE FUNCTION CheckDistributedMemoryPoolValidity(this) &
& RESULT(isvalid)
PURE FUNCTION CheckDistributedMemoryPoolValidity(this) RESULT(isvalid)
!! Parameters
TYPE(DistributedMatrixMemoryPool_t), INTENT(in) :: this
TYPE(DistributedMatrixMemoryPool_t), INTENT(IN) :: this
LOGICAL :: isvalid

isvalid = .TRUE.
Expand Down
Loading

0 comments on commit 780ac80

Please sign in to comment.