Skip to content

Commit

Permalink
Merge remote-tracking branch 'aa/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
beddalumia committed Jun 26, 2024
2 parents c965c20 + e854781 commit 0eed9e0
Show file tree
Hide file tree
Showing 46 changed files with 579 additions and 233 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/PushWorkflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI LIB_DMFT_ED test workflow
name: CI EDIpack2 test workflow

on: push

Expand All @@ -7,7 +7,7 @@ defaults:
shell: bash -l {0}

jobs:
test-QcmP:
test-EDIpack2:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -32,20 +32,20 @@ jobs:

# Build SciFortran
- name: Cloning SciFortran
run: git clone https://github.com/QcmPlab/SciFortran.git scifor
run: git clone https://github.com/aamaricci/SciFortran.git scifor
- name: Install SciFortran
run: scifor/bin/ci_setup_scifor.sh

# Build LIB_DMFT_ED
- name: Cloning LIB_DMFT_ED
run: git clone https://github.com/QcmPlab/LIB_DMFT_ED.git LIB_DMFT_ED
- name: Install LIB_DMFT_ED
# Build EDIpack2
- name: Cloning EDIpack2
run: git clone https://github.com/aamaricci/EDIpack2.0.git EDIpack2
- name: Install EDIpack2
run: |
source ~/.scifor_config_user
export PKG_CONFIG_PATH=~/.pkgconfig.d
export GLOB_INC=$( pkg-config --cflags scifor )
export GLOB_LIB=$( pkg-config --libs scifor | sed "s/;/ /g" | sed 's/\\/ /g' )
LIB_DMFT_ED/bin/ci_setup_dmft_ed.sh
EDIpack2/bin/ci_setup_edipack2.sh
Expand All @@ -55,17 +55,17 @@ jobs:
- name: Building tests
run: |
source ~/.scifor_config_user
source ~/.dmft_ed_config_user
source ~/.edipack2_config_user
export PKG_CONFIG_PATH=~/.pkgconfig.d
export GLOB_INC=$( pkg-config --cflags scifor dmft_ed)
export GLOB_LIB=$( pkg-config --libs scifor dmft_ed | sed "s/;/ /g" | sed 's/\\/ /g' )
cd LIB_DMFT_ED/test
export GLOB_INC=$( pkg-config --cflags scifor edipack2)
export GLOB_LIB=$( pkg-config --libs scifor edipack2 | sed "s/;/ /g" | sed 's/\\/ /g' )
cd EDIpack2/test
export TERM=xterm
make all
- name: Testing...
run: |
cd LIB_DMFT_ED/test
cd EDIpack2/test
make test
# - name: Install LCOV
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# DMFTED PROJECT
##################################################
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(dmft_ed Fortran)
PROJECT(edipack2 Fortran)
SET(VERSION 0.4.7)


Expand Down Expand Up @@ -122,7 +122,7 @@ ADD_SUBDIRECTORY(${LIB_SRC}/ED_NONSU2)

ADD_SUBDIRECTORY(${LIB_SRC})

ADD_LIBRARY(dmft_ed STATIC
ADD_LIBRARY(edipack2 STATIC
$<TARGET_OBJECTS:ED_INIT_LIB>
$<TARGET_OBJECTS:ED_BATH_LIB>
$<TARGET_OBJECTS:ED_IO_LIB>
Expand Down
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Exact Diagonalization for Quantum Impurity problems
# EDIpack2.0: Massively parallel Exact Diagonalization for generic Quantum Impurity problems

[![TestSuite](https://img.shields.io/github/actions/workflow/status/QcmPlab/LIB_DMFT_ED/PushWorkflow.yml?label=TestSuite&logo=Fortran&style=flat-square)](https://github.com/QcmPlab/LIB_DMFT_ED/actions/workflows/PushWorkflow.yml)
[![TestSuite](https://img.shields.io/github/actions/workflow/status/QcmPlab/EDIpack2.0/PushWorkflow.yml?label=TestSuite&logo=Fortran&style=flat-square)](https://github.com/QcmPlab/EDIpack2/actions/workflows/PushWorkflow.yml)

<!-- TO BE SETUP ASAP
[![Coverage]()]()
[![api docs](https://img.shields.io/static/v1?label=API&message=documentation&color=734f96&logo=read-the-docs&logoColor=white&style=flat-square)](https://qcmplab.github.io/DMFT_ED)
-->
A serial/parallel Lanczos based method for the solution of single-site Quantum Impurity problems, with a special application as Dynamical Mean-Field Theory solver.

This library provides a simple, yet generic, interface to the solution of single-site, multi-orbital quantum impurity models with a finite, discrete electronic bath. The solution is obtained in either for *normal*, *superconducting* (s-wave) or *Sz-non-conserving* (e.g. with Spin-Orbit Coupling or in-plane magnetization) phases. The code works at zero and low temperatures.

A suitable extension of [EDIpack](https://arxiv.org/abs/2105.06806): a Lanczos based method
for the solution of generic Quantum Impurity problems, exploiting distributed memory MPI parallelization.
This updated version, aims to solve single-site, multi-orbital models, in either *normal*, *superconducting* (s-wave) or *Spin-non-conserving* (e.g. with Spin-Orbit Coupling or in-plane magnetization) phases, including electron-phonons coupling. The code works at zero and low temperatures.

See [j.cpc.2021.108261](https://doi.org/10.1016/j.cpc.2021.108261) for further information about the underlying algorithms. Yet, suitable modifications have been developed to address the Superconducting and non-SU(2) channels.


### Dependencies

The code is based on:

* SciFortran [https://github.com/aamaricci/SciFortran](https://github.com/aamaricci/SciFortran)
* SciFortran [https://github.com/QcmPlab/SciFortran](https://github.com/QcmPlab/SciFortran)

* MPI

Expand All @@ -25,13 +26,14 @@ The code is based on:

### Installation

Installation is available using CMake. In the current v0.0.1 API are only provided in Fortran.
Installation is available using CMake. In the current version API are only provided in Fortran. In a future release Python and C/C++ API will be included.
The software gives acces to the static library `libedipack2.a` and the related modules `EDIPACK2`

Clone the repo:

`git clone https://github.com/aamaricci/lib_dmft_ed scifor`
`git clone https://github.com/QcmPlab/EDIpack2.0 EDIpack2`

And from the repository directory (`cd lib_dmft_ed`) make a standard out-of-source CMake compilation:
And from the repository directory (`cd EDIpack2`) make a standard out-of-source CMake compilation:

`mkdir build`
`cd build`
Expand All @@ -43,41 +45,30 @@ And from the repository directory (`cd lib_dmft_ed`) make a standard out-of-sour
Please follow the instructions on the screen to complete installation on your environment.
The library can be loaded using one of the following, automatically generated, files :

* pkg-config file in `~/.pkg-config.d/dmft_ed.pc`
* environment module file `~/.modules.d/dmft_ed/<PLAT>`
* pkg-config file in `~/.pkg-config.d/EDIpack2.pc`
* environment module file `~/.modules.d/EDIpack2/<PLAT>`
* homebrew `bash` script `<PREFIX>/bin/configvars.sh`


The `CMake` compilation can be controlled using the following additional variables, default values between `< >`:

* `-DPREFIX=prefix directory <~/opt/dmft_ed/VERSION/PLAT/[GIT_BRANCH]>`
* `-DPREFIX=prefix directory <~/opt/EDIpack2/VERSION/PLAT/[GIT_BRANCH]>`

* `-DUSE_MPI=<yes>/no`

* `-DVERBOSE=yes/<no> `

* `-DBUILD_TYPE=<RELEASE>/TESTING/DEBUG`


For any information contact the author as:
adriano DOT amaricci @ gmail DOT com

--

***LICENSE***
Copyright 2020- (C) Adriano Amaricci, Lorenzo Crippa, Alberto Scazzola, Gabriele Bellomia, Samuele Giuli, Giacomo Mazza, Francesco Petocchi, Luca de Medici and Massimo Capone.
Copyright 2020- (C) Adriano Amaricci, Lorenzo Crippa, Alberto Scazzola, Gabriele Bellomia, Samuele Giuli, Giacomo Mazza, Francesco Petocchi, Luca de Medici and Massimo Capone

The software is provided with no license, as such it is protected by copyright.
The software is provided as it is and can be read and copied, in agreement with
the Terms of Service of GITHUB. Use of the code is constrained to author agreement.

<!--This program is free software: you can redistribute it and/or modify-->
<!--it under the terms of the GNU General Public License as published by-->
<!--the Free Software Foundation, either version 3 of the License, or-->
<!--(at your option) any later version.-->

<!--You should have received a copy of the GNU General Public License-->
<!--along with this program. If not, see <http://www.gnu.org/licenses/>.-->

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
Expand Down
20 changes: 0 additions & 20 deletions bin/ci_setup_dmft_ed.sh

This file was deleted.

20 changes: 20 additions & 0 deletions bin/ci_setup_edipack2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#Building EDIpack2
#Errors
set -e

cd EDIpack2
mkdir build
cd build

echo "cmake .."
cmake ..

echo "make"
make

echo "make install"
make install

echo "source ~/opt/EDIpack2/gnu/*/bin/edipack2_config_user.sh" >> ~/.edipack2_config_user
echo -e "\e[32m EDIpack2 installed and sourced \e[0m"

6 changes: 3 additions & 3 deletions etc/dmft_ed.pc.in → etc/edipack2.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ exec_prefix=${prefix}/bin
includedir=${prefix}/include
libdir=${prefix}/lib

Name: dmft_ed
Description: The DMFT_ED library
Name: edipack2
Description: The EDIpack2.0 library
Cflags: -I${includedir}
Libs: -L${libdir} -ldmft_ed
Libs: -L${libdir} -ledipack2
Version:@VERSION@


File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions etc/environment_modules/module.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ set version "(@FULL_VER@)"
set compiler @CMAKE_Fortran_COMPILER@

proc ModulesHelp { } {
puts stderr "\tThis module provides access to DMFT_ED library\n";
puts stderr "\tThis module provides access to EDIpack2.0 library\n";
puts stderr "\tVersion $version\n"
puts stderr "\t compiled with $compiler\n"
}

module-whatis "DMFT_ED library in Fortran"
module-whatis "EDIpack2.0 library in Fortran"


setenv DMFT_ED_ROOT $root
setenv EDIPACK2_ROOT $root
setenv FC $compiler
setenv F90 $compiler
prepend-path LD_LIBRARY_PATH "$root/lib"
prepend-path LIBRARY_PATH "$root/lib"
prepend-path PATH "$root/bin"
prepend-path PKG_CONFIG_PATH "$root/etc"

puts stderr " > (un)load DMFT_ED $version"
puts stderr " > (un)load EDIpack2.0 $version"
#EOF
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# # DMFT_ED library
# EDIPACK2 library
#Generate version module:
CONFIGURE_FILE(${LIB_SRC}/revision.in ${LIB_SRC}/ED_VERSION.f90 @ONLY)

Expand All @@ -24,6 +24,6 @@ FILE(GLOB ED_GLOB_SRC
ED_CHI_FUNCTIONS.f90
ED_OBSERVABLES.f90
ED_MAIN.f90
DMFT_ED.f90
EDIPACK2.f90
)
ADD_LIBRARY(ED_GLOB_LIB OBJECT ${ED_GLOB_SRC})
6 changes: 3 additions & 3 deletions src/DMFT_ED.f90 → src/EDIPACK2.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MODULE DMFT_ED
MODULE EDIPACK2
USE ED_INPUT_VARS , only: &
ed_read_input , &
ed_update_input,&
Expand Down Expand Up @@ -76,7 +76,7 @@ MODULE DMFT_ED
ed_get_eknot , &
ed_get_doubles , &
ed_get_density_matrix


USE ED_MAIN, only: &
ed_init_solver , &
Expand All @@ -86,5 +86,5 @@ MODULE DMFT_ED
USE ED_BATH_FIT, only: ed_chi2_fitgf


END MODULE DMFT_ED
END MODULE EDIPACK2

2 changes: 1 addition & 1 deletion src/ED_AUX_FUNX.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MODULE ED_AUX_FUNX
USE ED_VARS_GLOBAL
USE SF_TIMER
USE SF_LINALG, only: eye
USE SF_PAULI
USE SF_SPIN
USE SF_MISC, only: assert_shape
USE SF_IOTOOLS, only:free_unit,reg,txtfy
USE SF_ARRAYS, only: arange,linspace
Expand Down
2 changes: 1 addition & 1 deletion src/ED_BATH/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DMFT_ED library
# EDIpack2 library
FILE(GLOB ED_BATH_SRC
ED_BATH_AUX.f90
ED_BATH_DIM.f90
Expand Down
2 changes: 1 addition & 1 deletion src/ED_BATH/ED_BATH_AUX.f90
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function Hgeneral_build(lambdavec) result(H)
complex(8),dimension(Nnambu*Nspin,Nnambu*Nspin,Norb,Norb) :: H
!
if(.not.Hgeneral_status)STOP "ERROR Hgeneral_build: Hgeneral_basis is not setup"
allocate(lambda(size(Hreplica_basis)));lambda=1d0
allocate(lambda(size(Hgeneral_basis)));lambda=1d0
if(present(lambdavec))then
if(size(lambdavec)/=size(Hgeneral_basis)) STOP "ERROR Hgeneral_build: Wrong coefficient vector size"
lambda = lambdavec
Expand Down
6 changes: 3 additions & 3 deletions src/ED_BATH/ED_BATH_DMFT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ subroutine init_dmft_bath(dmft_bath_,used)
diagonal_hsym = is_diagonal(Hreplica_basis(isym)%O)
one_lambdaval = Hreplica_lambda(Nbath,isym)
all_lambdas_are_equal = all(Hreplica_lambda(:,isym)==one_lambdaval)
if(diagonal_hsym.AND.all_lambdas_are_equal)then
if(diagonal_hsym.AND.all_lambdas_are_equal.AND.Nbath>1)then
offset=linspace(-ed_offset_bath,ed_offset_bath,Nbath)
if(is_identity(Hreplica_basis(isym)%O).AND.mod(Nbath,2)==0)then
offset(Nbath/2) = max(-1.d-1,offset(Nbath/2))
Expand Down Expand Up @@ -274,7 +274,7 @@ subroutine init_dmft_bath(dmft_bath_,used)
diagonal_hsym = is_diagonal(Hgeneral_basis(isym)%O)
one_lambdaval = Hgeneral_lambda(Nbath,isym)
all_lambdas_are_equal = all(Hgeneral_lambda(:,isym)==one_lambdaval)
if(diagonal_hsym.AND.all_lambdas_are_equal)then
if(diagonal_hsym.AND.all_lambdas_are_equal.AND.Nbath>1)then
offset=linspace(-ed_offset_bath,ed_offset_bath,Nbath)
if(is_identity(Hgeneral_basis(isym)%O).AND.mod(Nbath,2)==0)then
offset(Nbath/2) = max(-1.d-1,offset(Nbath/2))
Expand Down Expand Up @@ -462,7 +462,7 @@ subroutine write_dmft_bath(dmft_bath_,unit)
"Vbk_l"//reg(str(iorb))//"_s"//reg(str(ispin)),&
iorb=1,Norb), ispin=1,Nspin)
do i=1,Nbath
write(unit,"(90(ES21.12,1X))")((&
write(unit_,"(90(ES21.12,1X))")((&
dmft_bath_%e(ispin,iorb,i),&
dmft_bath_%v(ispin,iorb,i),&
dmft_bath_%u(ispin,iorb,i),&
Expand Down
2 changes: 1 addition & 1 deletion src/ED_BATH/ED_BATH_FUNCTIONS.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE ED_BATH_FUNCTIONS
USE SF_CONSTANTS, only: zero
USE SF_IOTOOLS, only:free_unit,reg,file_length,txtfy,str
USE SF_LINALG, only: eye,inv,diag,zeye,inv_her,kron
USE SF_PAULI, only: pauli_sigma_z
USE SF_SPIN, only: pauli_sigma_z
USE ED_INPUT_VARS
USE ED_VARS_GLOBAL
USE ED_AUX_FUNX
Expand Down
Loading

0 comments on commit 0eed9e0

Please sign in to comment.