36 lines
880 B
C++
36 lines
880 B
C++
/**********************************************************
|
|
|
|
This software is part of J.-S. Caux's ABACUS library.
|
|
|
|
Copyright (c) J.-S. Caux.
|
|
|
|
-----------------------------------------------------------
|
|
|
|
File: src/LIEBLIN/LiebLin_Chem_Pot.cc
|
|
|
|
Purpose: calculates the chemical potential.
|
|
|
|
***********************************************************/
|
|
|
|
#include "ABACUS.h"
|
|
|
|
using namespace std;
|
|
using namespace ABACUS;
|
|
|
|
namespace ABACUS {
|
|
|
|
DP Chemical_Potential (LiebLin_Bethe_State& RefState)
|
|
{
|
|
// RefState is used here to provide the c_int, L and N parameters.
|
|
|
|
LiebLin_Bethe_State Nplus1State(RefState.c_int, RefState.L, RefState.N + 1);
|
|
LiebLin_Bethe_State Nmin1State(RefState.c_int, RefState.L, RefState.N - 1);
|
|
|
|
Nplus1State.Compute_All(true);
|
|
Nmin1State.Compute_All(true);
|
|
|
|
return(0.5 * (Nplus1State.E - Nmin1State.E));
|
|
}
|
|
|
|
} // namespace ABACUS
|