Git Product home page Git Product logo

edlib's Introduction

DOI

Overview

EDLib is a C++ template finite temperature Exact diagonalization solver for quantum electron models. The central class of the library is Hamiltonian<Storage, Model>, that is parametrized by Storage and Model:

  • There exists a following set of implementation of models for common purposes:

    • HubbardModel<precision>. The finite Hubbard model cluster.
    • SingleImpurityAndersonModel<precision>. The single multi-orbital impurity Anderson Model.
  • For the Hamiltonian matrix storage there are three implementation of sparse matrix storages:

    • SpinResolvedStorage<Model>. A storage that takes into account the case when hopping Hamiltonian can be expressed as Kronecker sum for each spin. This storage is implemented with MPI support.
    • SOCRSStorage<Model>. A storage that store only fermion signs for each element in Hamiltonian. This storage is implemented with OpenMP support.
    • CRSStorage<Model>. A simple CRS storage.

The resluting eigenpairs are stored as a set of EigenPair<precision, SymmetrySectorType> structures in the Hamiltonian object.

The following observable can be computed by means of Lanczos continuous fraction (Lanczos<Hamiltonian, Mesh, MeshArguments...> class template) of the Lehmann representation:

  • Single-particle Green's function (GreensFunction<Hamiltonian, Mesh, MeshArguments...> class template).
  • Spin suseptibility (ChiLoc<Hamiltonian, Mash, MeshArguments...> class template). Greens functions are implemented on top of ALPSCore Greens functions module and can use either positive Matsubara frequency mesh or Real frequency mesh.

Look for examples in the "examples/" directory for a detailed information.

Installation

The code is is provided as a header-only library with a set of examples and tests. At least the edlib/Hamiltonian.h should be included in any derivative projects. To compile examples and tests create a build directory and run

  1. cmake -DARPACK_DIR=<path to ARPACK-ng library dir> -DExamples=ON -DTesting=ON {path_to_edlib}
  2. make
  3. make test (for running tests)
  4. example will be build in examples subdirectory

To build with MPI support add -DUSE_MPI=ON CMake flag. MPI library should be installed and ALPSCore library should be compiled with MPI support. To build with a specific ALPSCore library -DALPSCore_DIR=<path to ALPSCore> CMake flag. Since the critical for current library implementation MPI-related ARPACK-ng bug was recenlty fixed it is stricly recommended to use the latest version of ARPACK-ng from github repository.

Dependencies
  • c++11-compatible compiler (tested with clang >= 3.1, gcc >= 4.8.2, icpc >= 14.0.2)
  • ALPSCore library >= 0.5.6-alpha3
  • arpack-ng >= 3.5.0
  • MPI standard >= 2.1 (optional)
  • git to fetch the code
  • cmake to build tests and examples (optional)
Authors
  • Sergei Iskakov, iskakoff[at]q-solvers.ru, 2016-now
  • Michael Danilov, 2016-now
Distribution

Open-source under MIT License.

edlib's People

Contributors

iskakoff avatar katherlee avatar mike402 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edlib's Issues

General static observables

Hi! As I see correctly, the static observables implemented so far are all observables which can be expressed in density operators. I would like to implement <L^2> and <J^2> for a multi-orbital anderson model but don't imidialtly see how to do so straightforwardly. Are there any plans to implement this? Or could you give any advice on how to proceed?
Thanks!

compilation fails at Lanczos_Test

Dear Developer, I encounter the following error message while compiling the code. I use gcc-10 and g++-10 and the current version of ALPSCore on Github. I am wondering if you know how to resolve this error? Thank you!

[ 77%] Building CXX object test/CMakeFiles/LanczosTest.dir/Lanczos_Test.cpp.o
In file included from /home/henhans/Git/EDLib/include/edlib/GreensFunction.h:10,
                 from /home/henhans/Git/EDLib/test/Lanczos_Test.cpp:11:
/home/henhans/Git/EDLib/include/edlib/Lanczos.h: In instantiation of ‘class EDLib::gf::Lanczos<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’:
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:26:11:   required from ‘class EDLib::gf::GreensFunction<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:69:129:   required from here
/home/henhans/Git/EDLib/include/edlib/Lanczos.h:20:13: error: no type named ‘MeshType’ in ‘class alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>’
   20 |       using Mesh=typename MeshFactory::MeshType;
      |             ^~~~
In file included from /home/henhans/Git/EDLib/test/Lanczos_Test.cpp:11:
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h: In instantiation of ‘class EDLib::gf::GreensFunction<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:69:129:   required from here
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:29:60: error: ‘omega’ has not been declared in ‘EDLib::gf::Lanczos<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’
   29 |       using Lanczos < Hamiltonian, MeshFactory, Args... >::omega;
      |                                                            ^~~~~
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp: In member function ‘virtual void HubbardModelTest_ReferenceTest_Test::TestBody()’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:71:27: error: ‘class EDLib::gf::GreensFunction<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’ has no member named ‘G’
   71 |   auto G = greensFunction.G();
      |                           ^
In file included from /home/henhans/Git/EDLib/test/Lanczos_Test.cpp:12:
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h: In instantiation of ‘class EDLib::gf::ChiLoc<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:74:109:   required from here
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:106:60: error: ‘omega’ has not been declared in ‘EDLib::gf::Lanczos<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’
  106 |       using Lanczos < Hamiltonian, MeshFactory, Args... >::omega;
      |                                                            ^~~~~
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:82:21: error: ‘class EDLib::gf::ChiLoc<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’ has no member named ‘G’
   82 |   auto ChiSz = susc.G();
      |                     ^
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:90:20: error: ‘class EDLib::gf::ChiLoc<EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >, alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>, alps::gf::statistics::statistics_type>’ has no member named ‘G’
   90 |   auto ChiN = susc.G();
      |                    ^
In file included from /home/henhans/Git/EDLib/test/Lanczos_Test.cpp:11:
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h: In instantiation of ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::GreensFunction(alps::params&, Hamiltonian&, Args ...) [with Hamiltonian = EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >; MeshFactory = alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>; Args = {alps::gf::statistics::statistics_type}; alps::params = alps::params_ns::params]’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:69:184:   required from here
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:61:91: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_g’
   61 |                                                         _cutoff(p["lanc.BOLTZMANN_CUTOFF"]) {
      |                                                                                           ^
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:55:67: error: ‘omega’ was not declared in this scope
   55 |                                                         _G_g(omega(), alps::gf::index_mesh(h.model().interacting_orbitals()), alps::gf::index_mesh(p["NSPINS"].as<int>())),
      |                                                              ~~~~~^~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:61:91: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_l’
   61 |                                                         _cutoff(p["lanc.BOLTZMANN_CUTOFF"]) {
      |                                                                                           ^
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:61:91: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G’
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:61:91: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_g_ij’
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:61:91: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_l_ij’
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:61:91: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_ij’
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h: In instantiation of ‘void EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::compute() [with Hamiltonian = EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >; MeshFactory = alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>; Args = {alps::gf::statistics::statistics_type}]’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:70:26:   required from here
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:111:9: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_g’
  111 |         _G_g *= 0.0;
      |         ^~~~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:112:9: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_l’
  112 |         _G_l *= 0.0;
      |         ^~~~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:149:9: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_g’
  149 |         _G_g /= _Z;
      |         ^~~~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:150:9: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_l’
  150 |         _G_l /= _Z;
      |         ^~~~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:151:9: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_g_ij’
  151 |         _G_g_ij /= _Z;
      |         ^~~~~~~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:152:9: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_l_ij’
  152 |         _G_l_ij /= _Z;
      |         ^~~~~~~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:157:9: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G’
  157 |         _G = _G_g + _G_l;
      |         ^~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:157:14: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_g’
  157 |         _G = _G_g + _G_l;
      |              ^~~~
/home/henhans/Git/EDLib/include/edlib/GreensFunction.h:157:21: error: using invalid field ‘EDLib::gf::GreensFunction<Hamiltonian, MeshFactory, Args>::_G_l’
  157 |         _G = _G_g + _G_l;
      |                     ^~~~
In file included from /home/henhans/Git/EDLib/test/Lanczos_Test.cpp:12:
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h: In instantiation of ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::ChiLoc(alps::params&, Hamiltonian&, Args ...) [with Hamiltonian = EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >; MeshFactory = alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>; Args = {alps::gf::statistics::statistics_type}; alps::params = alps::params_ns::params]’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:74:163:   required from here
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:126:104: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf’
  126 |                                                         _cutoff(p["lanc.BOLTZMANN_CUTOFF"]), _type("Sz") {
      |                                                                                                        ^
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:124:65: error: ‘omega’ was not declared in this scope
  124 |                                                         gf(omega(), alps::gf::index_mesh(h.model().interacting_orbitals())),
      |                                                            ~~~~~^~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:126:104: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf_ij’
  126 |                                                         _cutoff(p["lanc.BOLTZMANN_CUTOFF"]), _type("Sz") {
      |                                                                                                        ^
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h: In instantiation of ‘void EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::compute(const double*) [with Op = EDLib::gf::SzOperator<double>; Hamiltonian = EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >; MeshFactory = alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>; Args = {alps::gf::statistics::statistics_type}]’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:81:51:   required from here
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:184:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf’
  184 |         gf *= 0.0;
      |         ^~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:185:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf_ij’
  185 |         gf_ij *= 0.0;
      |         ^~~~~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:224:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf’
  224 |         gf /= _Z;
      |         ^~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:225:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf_ij’
  225 |         gf_ij /= _Z;
      |         ^~~~~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h: In instantiation of ‘void EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::compute(const double*) [with Op = EDLib::gf::NOperator<double>; Hamiltonian = EDLib::Hamiltonian<EDLib::Storage::SOCRSStorage<EDLib::Model::HubbardModel<double> > >; MeshFactory = alps::gf::matsubara_mesh<alps::gf::mesh::POSITIVE_ONLY>; Args = {alps::gf::statistics::statistics_type}]’:
/home/henhans/Git/EDLib/test/Lanczos_Test.cpp:89:50:   required from here
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:184:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf’
  184 |         gf *= 0.0;
      |         ^~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:185:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf_ij’
  185 |         gf_ij *= 0.0;
      |         ^~~~~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:224:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf’
  224 |         gf /= _Z;
      |         ^~
/home/henhans/Git/EDLib/include/edlib/ChiLoc.h:225:9: error: using invalid field ‘EDLib::gf::ChiLoc<Hamiltonian, MeshFactory, Args>::gf_ij’
  225 |         gf_ij /= _Z;
      |         ^~~~~
test/CMakeFiles/LanczosTest.dir/build.make:75: recipe for target 'test/CMakeFiles/LanczosTest.dir/Lanczos_Test.cpp.o' failed
make[2]: *** [test/CMakeFiles/LanczosTest.dir/Lanczos_Test.cpp.o] Error 1
CMakeFiles/Makefile2:547: recipe for target 'test/CMakeFiles/LanczosTest.dir/all' failed
make[1]: *** [test/CMakeFiles/LanczosTest.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.