NanoStructures  1.0
DMFT solver for layered, strongly correlated nanostructures
nrg.h
Go to the documentation of this file.
1 #ifndef NRG_H
2 #define NRG_H
3 
12 /*
13  * Copyright (c) 2014 Christoph Schuette.
14  *
15  * The license and distribution terms for this file may be
16  * found in the file LICENSE in this distribution
17  */
18 
19 #include "../config/configuration.h"
20 #include "chainprovider.h"
21 #include "hilbertspacetable.h"
22 #include "broadener.h"
23 
24 namespace nrg {
138  class NRG {
139 
140  enum STATES {
141  KEPT, DISCARDED, BOTH
142  };
143 
144  public:
160  NRG(ChainProvider& chainProvider, Broadener& broadener);
161 
166  ~NRG();
167 
168 
175  void configure(config::Configuration& configuration);
176 
177  // setters and getters -- physical parameters
178 
183  double getU() const {
184  return m_U;
185  }
186 
191  void setU(double U) {
192  m_U = U;
193  }
194 
199  double getEpsF() const {
200  return m_epsF;
201  }
202 
207  void setEpsF(double epsF) {
208  m_epsF = epsF;
209  }
210 
215  double getTemperature() const {
216  return m_temperature;
217  }
218 
223  void setTemperature(double T) {
224  m_temperature = T;
225  }
226 
227  //setters and getters -- numerical parameters
228 
240  double getClusterEnergy() const {
241  return m_clusterEnergy;
242  }
248  void setClusterEnergy(double clusterEnergy) {
249  m_clusterEnergy = clusterEnergy;
250  }
251 
257  double getEnergyCutOff() const {
258  return m_energyCutOff;
259  }
260 
266  void setEnergyCutOff(double energyCutOff) {
267  m_energyCutOff = energyCutOff;
268  }
269 
276  return m_maxHSdimension;
277  }
278 
288  void setMaxHilbertSpaceDimension(int maxHSdimension) {
289  m_maxHSdimension = maxHSdimension;
290  }
291 
298  return m_maxIterations;
299  }
300 
306  void setMaxIterations(int maxIterations) {
307  m_maxIterations = maxIterations;
308  }
309 
316  inline double getOccupationUp() {
317  return m_n_Up;
318  }
319 
326  inline double getOccupationDown() {
327  return m_n_Down;
328  }
329 
337  inline double getOccupation() {
338  return m_n_Up + m_n_Down;
339  }
340 
349  inline double getMagnetization() {
350  return m_n_Up - m_n_Down;
351  }
352 
353  // nrg
367  void init();
368 
378  void setupInitialState();
379 
395  void setupHamiltonian(int iteration); // iteration >= 0
396 
418  void truncateStates(int iteration);
419 
420 
445  void propagateLocalMatrixElementUp(int iteration);
446 
451  void propagateLocalMatrixElementDown(int iteration);
452 
500  void propagateLocalMatrixElementUp2(int iteration);
501 
506  void propagateLocalMatrixElementDown2(int iteration);
507 
539  void propagateChainOperatorElementsUp(int iteration);
540 
546  void propagateChainOperatorElementsDown(int iteration);
547 
557  void createPolesG_Up(int iteration);
558 
564  void createPolesG_Down(int iteration);
565 
577  void createPolesF_Up(int iteration);
578 
584  void createPolesF_Down(int iteration);
585 
622  void solve(bool silent = false);
623 
629  void solve_symmetric_SZ(bool silent = false);
630 
635  void builDM();
636 
641  void showInfo();
642 
643  // clean-up code
648  void deleteChainOperatorElements(int iteration);
649 
654  void deleteTransformationMatrices(int iteration);
655 
660  void deleteDensityMatrices(int iteration);
661 
666  void deleteImpurityMatrixElements(int iteration);
667 
674  SUp = m_F_S_Up;
675  SDown = m_F_S_Down;
676  }
677 
683  S = m_F_S_Up;
684  }
685 
692  GUp = m_F_G_Up;
693  GDown = m_F_G_Down;
694  }
695 
701  G = m_F_G_Up;
702  }
703 
710  FUp = m_F_F_Up;
711  FDown = m_F_F_Down;
712  }
713 
719  F = m_F_F_Up;
720  }
721 
722  protected:
723  ChainProvider& m_chainProvider;
724  Broadener& m_broadener;
725  Broadener* m_G_Up;
726  Broadener* m_G_Down;
727  Broadener* m_F_Up;
728  Broadener* m_F_Down;
729 
730  math::CFunction m_F_S_Up;
731  math::CFunction m_F_S_Down;
732  math::CFunction m_F_G_Up;
733  math::CFunction m_F_G_Down;
734  math::CFunction m_F_F_Up;
735  math::CFunction m_F_F_Down;
736 
737  double m_n_Up;
738  double m_n_Down;
739 
740  double m_epsF;
741  double m_U;
742  double m_temperature;
743  int m_maxIterations;
744  std::mathbfor<double> m_energies;
745 
746  HilbertSpaceTable m_hilbertSpaces;
747 
748  // numerical parameters
749  double m_clusterEnergy;
750  double m_energyCutOff;
751  int m_maxHSdimension;
752  int m_nFirstTruncated;
753 
754  // helper fields
755  int signLME[4];
756  int dQ[4];
757  int dSz[4];
758 
759  };
760 }
761 #endif // NRG_H
void getFFunction(math::CFunction &F)
returns the correlator for the self-energy trick
Definition: nrg.h:718
void getGreensFunction(math::CFunction &GUp, math::CFunction &GDown)
returns the impurity Green's function.
Definition: nrg.h:691
void propagateLocalMatrixElementDown(int iteration)
see propagateLocalMatrixElementUp(int iteration). This is the spin- version.
Definition: nrg.cpp:999
void propagateChainOperatorElementsUp(int iteration)
calculates the chain matrix elements for spin- for a given iteration.
Definition: nrg.cpp:569
void propagateChainOperatorElementsDown(int iteration)
see propagateChainOperatorElementsUp(int iteration). This is the spin- version.
Definition: nrg.cpp:647
void setMaxIterations(int maxIterations)
Definition: nrg.h:306
void setEnergyCutOff(double energyCutOff)
sets the high energy cut-off for state truncation
Definition: nrg.h:266
void showInfo()
lists the physical and numerical parameters for the NRG instance. Also dumps info about the Broadener...
Definition: nrg.cpp:1836
void setTemperature(double T)
sets the system temperature T
Definition: nrg.h:223
void setClusterEnergy(double clusterEnergy)
sets the cluster energy to the indicated value. see getClusterEnergy().
Definition: nrg.h:248
double getOccupationUp()
returns the exp. value for spin- electrons on the impurity. The actual calculation is performed in c...
Definition: nrg.h:316
void getSelfEnergy(math::CFunction &SUp, math::CFunction &SDown)
returns the impurity selfenergy.
Definition: nrg.h:673
Definition: chainprovider.h:19
void propagateLocalMatrixElementUp(int iteration)
calculates the local impurity matrix elements or spin- for a given iteration.
Definition: nrg.cpp:1236
void createPolesF_Down(int iteration)
see createPolesF_Down(int iteration). This is the spin- version.
Definition: nrg.cpp:1404
void solve(bool silent=false)
solves the impurity problem.
Definition: nrg.cpp:1738
void getSelfEnergy(math::CFunction &S)
returns the impurity selfenergy.
Definition: nrg.h:682
void configure(config::Configuration &configuration)
configures the NRG instance with information in the configuration object.
Definition: nrg.cpp:46
void createPolesF_Up(int iteration)
calculates delta peaks for the spin- impurity correlator used in the self-energy trick...
Definition: nrg.cpp:1315
HilbertSpaceTable: Manages the table of HilbertSubSpace instances.
Definition: hilbertspacetable.h:31
void solve_symmetric_SZ(bool silent=false)
Version of solve(bool silent) for a Wilson chain with Sz symmetry.
Definition: nrg.cpp:1667
void createPolesG_Down(int iteration)
see createPolesG_Up(int iteration). This is the spin- version.
Definition: nrg.cpp:1581
double getClusterEnergy() const
returns the cluster energy.
Definition: nrg.h:240
int getMaxIterations()
Definition: nrg.h:297
void setU(double U)
sets the strength of the on-site impurity interaction U
Definition: nrg.h:191
void truncateStates(int iteration)
marks all eigenstates above a cut-off energy as discarded.
Definition: nrg.cpp:317
double getOccupationDown()
returns the exp. value for spin- electrons on the impurity. The actual calculation is performed in c...
Definition: nrg.h:326
void deleteChainOperatorElements(int iteration)
deletes all chain operator matrix elements for the indicated iteration.
Definition: nrg.cpp:485
void propagateLocalMatrixElementUp2(int iteration)
calculates other local impurity matrix elements or spin- for a given iteration.
Definition: nrg.cpp:1078
double getU() const
retrieves the strength of the on-site impurity interaction U
Definition: nrg.h:183
double getEnergyCutOff() const
returns the high energy cut-off for state truncation
Definition: nrg.h:257
double getTemperature() const
retrieves the system temperature T
Definition: nrg.h:215
double getOccupation()
returns the exp. value for electrons on the impurity. The actual calculation is performed in createPo...
Definition: nrg.h:337
A configuration object which is populated from a configuration file and allows to query and modify co...
Definition: configuration.h:46
void builDM()
performs a backward run to construct the reduced density matrices
Definition: nrg.cpp:728
void setupInitialState()
initializes the impurity Hamiltonian .
Definition: nrg.cpp:107
void propagateLocalMatrixElementDown2(int iteration)
see propagateLocalMatrixElementUp2(int iteration). This is the spin- version.
Definition: nrg.cpp:1157
void deleteTransformationMatrices(int iteration)
deletes all transformation matrices for the indicated iteration.
Definition: nrg.cpp:506
void setupHamiltonian(int iteration)
iterates over all possible quantum number Q and Sz for iteration N and constructs the Hamiltonian for...
Definition: nrg.cpp:178
void init()
prepares the NRG instance for the iterative diagonalization.
Definition: nrg.cpp:67
Hilbert subspace table for charge quantum number Q and spin S.
double getEpsF() const
retrieves the on-site impurity energy
Definition: nrg.h:199
NRG(ChainProvider &chainProvider, Broadener &broadener)
constructs an NRG algorithm instance The Wilson chain is provided by an implementation of the ChainPr...
Definition: nrg.cpp:14
double getMagnetization()
returns the exp. value for the magnetization
Definition: nrg.h:349
void setEpsF(double epsF)
sets the on-site impurity energy
Definition: nrg.h:207
void getGreensFunction(math::CFunction &G)
returns the Green's function.
Definition: nrg.h:700
Density matrix implementation of the numerical renormalization group.
Definition: nrg.h:138
void deleteDensityMatrices(int iteration)
deletes all chain operator matrix elements for the indicated iteration.
Definition: nrg.cpp:526
Definition: broadener.h:23
~NRG()
destructs the NRG algorithm object and frees all previously allocated memory.
Definition: nrg.cpp:1862
Discretized complex-valued function for real arguments.
Definition: cfunction.h:34
int getMaxHilbertSpaceDimension()
returns the maximum allowed size of the HilberSpace. See truncateStates(int n).
Definition: nrg.h:275
void deleteImpurityMatrixElements(int iteration)
deletes all impurity operator matrix elements for the indicated iteration.
Definition: nrg.cpp:547
void createPolesG_Up(int iteration)
calculates delta peaks for the spin- impurity Green's function.
Definition: nrg.cpp:1494
void getFFunction(math::CFunction &FUp, math::CFunction &FDown)
returns the correlator for the self-energy trick
Definition: nrg.h:709
void setMaxHilbertSpaceDimension(int maxHSdimension)
sets the maximum allowed size of the HilberSpace. See truncateStates(int n).
Definition: nrg.h:288