46 #ifndef _PEXSI_PPEXSI_HPP_
47 #define _PEXSI_PPEXSI_HPP_
72 std::vector<Complex> zshift_;
73 std::vector<Complex> zweightRho_;
74 std::vector<Complex> zweightRhoDrvMu_;
75 std::vector<Complex> zweightRhoDrvT_;
76 std::vector<Complex> zweightHelmholtz_;
77 std::vector<Complex> zweightForce_;
79 const GridType* gridPole_;
80 const GridType* gridSelInv_;
81 const SuperLUGrid<Complex>* zGridSuperLU_;
82 const SuperLUGrid<Real>* dGridSuperLU_;
86 DistSparseMatrix<Real> rhoMat_;
87 DistSparseMatrix<Real> rhoDrvMuMat_;
88 DistSparseMatrix<Real> rhoDrvTMat_;
89 DistSparseMatrix<Real> freeEnergyDensityMat_;
90 DistSparseMatrix<Real> energyDensityMat_;
95 std::vector<Int> diagIdxLocal_;
102 Real CalculateChemicalPotentialNewtonFD(
104 const Real numElectronExact,
105 const Real numElectronTolerance,
106 const std::vector<Real>& muList,
107 const std::vector<Real>& numElectronList );
119 Real CalculateChemicalPotentialNewtonBisection(
120 const Real numElectronExact,
121 const Real numElectron,
122 const Real numElectronDrvMu,
178 Real numElectronExact,
184 const DistSparseMatrix<Real>& HMat,
185 const DistSparseMatrix<Real>& SMat,
187 Real numElectronTolerance,
190 bool isFreeEnergyDensityMatrix,
191 bool isEnergyDensityMatrix,
192 bool isDerivativeTMatrix,
193 std::vector<Real>& muList,
194 std::vector<Real>& numElectronList,
195 std::vector<Real>& numElectronDrvMuList,
320 const std::vector<Real>& shiftVec,
321 std::vector<Real>& inertiaVec,
325 Int numProcSymbFact );
331 const std::vector<Real>& shiftVec,
332 std::vector<Real>& inertiaVec,
336 Int numProcSymbFact );
382 #endif //_PEXSI_PPEXSI_HPP_
DistSparseMatrix< Real > & FreeEnergyDensityMatrix()
DensityMatrix returns the free energy density matrix.
Definition: ppexsi_old.hpp:205
Real CalculateNumElectronDrvMu(const DistSparseMatrix< Real > &SMat)
CalculateNumElectronDrvMu computes the derivative of the number of electrons with respect to the chem...
Definition: ppexsi_old.cpp:946
DistSparseMatrix< Real > & EnergyDensityMatrix()
DensityMatrix returns the energy density matrix for computing the force.
Definition: ppexsi_old.hpp:209
Real CalculateForce(const DistSparseMatrix< Real > &HDerivativeMat, const DistSparseMatrix< Real > &SDerivativeMat)
CalculateFreeEnergy computes the force, including the Hellman-Feynman force and the Pulay force...
Definition: ppexsi_old.cpp:1084
DistSparseMatrix< Real > & DensityMatrix()
DensityMatrix returns the single particle density matrix.
Definition: ppexsi_old.hpp:202
void EstimateSpectralRadius(Int method, const DistSparseMatrix< Real > &HMat, const DistSparseMatrix< Real > &SMat, const NumVec< Real > &v0, Real tol, Int maxNumIter, Int &numIter, Real &sigma)
Estimate the spectral radius of the matrix stencil (H,S).
Definition: ppexsi_old.cpp:1371
Interface with SuperLU_Dist (version 3.0 and later)
Main file for parallel selected inversion.
Sparse matrix and Distributed sparse matrix in compressed column format.
GridType is the PSelInv way of defining the grid.
Definition: pselinv.hpp:85
Interface with MPI to facilitate communication.
void CalculateNegativeInertiaReal(const std::vector< Real > &shiftVec, std::vector< Real > &inertiaVec, Int verbosity)
Compute the negative inertia (the number of eigenvalues below a shift) for real symmetric matrices...
Definition: ppexsi.cpp:748
Various utility subroutines.
void Solve(Int numPole, Real temperature, Real numElectronExact, Real gap, Real deltaE, Real &mu, Real &muMin, Real &muMax, const DistSparseMatrix< Real > &HMat, const DistSparseMatrix< Real > &SMat, Int muMaxIter, Real numElectronTolerance, std::string ColPerm, Int numProcSymbFact, bool isFreeEnergyDensityMatrix, bool isEnergyDensityMatrix, bool isDerivativeTMatrix, std::vector< Real > &muList, std::vector< Real > &numElectronList, std::vector< Real > &numElectronDrvMuList, bool &isConverged)
Solve is the main subroutine for PPEXSI.
Definition: ppexsi_old.cpp:194
Real CalculateFreeEnergy(const DistSparseMatrix< Real > &SMat)
CalculateFreeEnergy computes the total Helmholtz free energy (band energy part only).
Definition: ppexsi_old.cpp:1045
Real EstimateZeroTemperatureChemicalPotential(Real temperature, Real mu, const DistSparseMatrix< Real > &SMat)
Estimate the chemical potential at zero temperature using quadratic approximation.
Definition: ppexsi_old.cpp:1124
Interface subroutines of PEXSI that can be called by C.
Real CalculateTotalEnergy(const DistSparseMatrix< Real > &HMat)
CalculateTotalEnergy computes the total energy (band energy part only).
Definition: ppexsi_old.cpp:1019
void CalculateNegativeInertia(const std::vector< Real > &shiftVec, std::vector< Real > &inertiaVec, const DistSparseMatrix< Real > &HMat, const DistSparseMatrix< Real > &SMat, std::string ColPerm, Int numProcSymbFact)
Compute the negative inertia (the number of eigenvalues below a shift).
Definition: ppexsi_old.cpp:1154
Real CalculateNumElectronDrvT(const DistSparseMatrix< Real > &SMat)
CalculateNumElectronDrvT computes the derivative of the number of electrons with respect to the tempe...
Definition: ppexsi_old.cpp:983
Real CalculateNumElectron(const DistSparseMatrix< Real > &SMat)
CalculateNumElectron computes the number of electrons given the current density matrix.
Definition: ppexsi_old.cpp:909
Pole expansion subroutines.