Skip to content

Commit

Permalink
Merge pull request #80 from issp-center-dev/develop
Browse files Browse the repository at this point in the history
Version 2.1.0
  • Loading branch information
k-yoshimi authored Jan 22, 2020
2 parents c012167 + 87c5d54 commit 821291c
Show file tree
Hide file tree
Showing 32 changed files with 436 additions and 92 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Version number of the application
set (DCORE_VERSION "2.0.2")
set (DCORE_VERSION "2.1.0")

# Append triqs installed files to the cmake load path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

option(BUILD_DCORE "Build DCore" ON)

option(MPIEXEC "Default value of mpi.command" OFF)
if(NOT MPIEXEC)
set(MPIEXEC "mpirun -np \#")
endif()

# start configuration
cmake_minimum_required(VERSION 2.8)
project(DCore NONE)
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ file(GLOB_RECURSE all_doc_files RELATIVE ${CMAKE_SOURCE_DIR}/doc * EXCLUDE *.swp
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/doc_source.tar DEPENDS ${all_doc_files} COMMAND ${CMAKE_COMMAND} -E tar cf ${CMAKE_BINARY_DIR}/doc_source.tar ${all_doc_files} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc)
add_custom_target(make_doc_local_copy_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/doc_source)
add_custom_target(copy_tar_doc ALL DEPENDS ${CMAKE_BINARY_DIR}/doc_source.tar make_doc_local_copy_dir COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_BINARY_DIR}/doc_source.tar WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc_source)
add_custom_target(make_option_tables ALL DEPENDS copy_tar_doc COMMAND ${PYTHON_INTERPRETER} ${CMAKE_SOURCE_DIR}/python/option_tables.py ${CMAKE_BINARY_DIR}/doc_source/reference)
add_custom_target(make_option_tables ALL DEPENDS copy_tar_doc COMMAND ${PYTHON_INTERPRETER} ${CMAKE_BINARY_DIR}/python/dcore/option_tables.py ${CMAKE_BINARY_DIR}/doc_source/reference)
add_custom_target(make_doc_local_copy ALL DEPENDS make_option_tables)

# create documentation target
Expand Down
34 changes: 34 additions & 0 deletions doc/impuritysolvers/pomerol/dmft_square_pomerol.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[model]
seedname = square
lattice = square
norb = 1
nelec = 1.0
t = -1.0
kanamori = [(4.0, 0.0, 0.0)]
nk = 8

[system]
T = 0.1
n_iw = 1000
mu = 2.0
fix_mu = True

[impurity_solver]
name = pomerol
exec_path{str} = pomerol2dcore
n_bath{int} = 3
fit_gtol{float} = 1e-6

[control]
max_step = 100
sigma_mix = 0.5
time_reversal = True
converge_tol = 1e-5

[tool]
broadening = 0.4
knode = [(G,0.0,0.0,0.0),(X,0.5,0.0,0.0),(M,0.5,0.5,0.0),(G,0.0,0.0,0.0)]
nk_line = 100
omega_max =6.0
omega_min =-5.0
Nomega = 400
54 changes: 46 additions & 8 deletions doc/impuritysolvers/pomerol/pomerol.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Hubbard-I approximation: ``pomerol``
====================================
Exact diagonalization solver: ``pomerol``
=========================================

``pomerol`` is an exact diagonalization library implemented in c++.
``DCore`` provides an interface to ``pomerol`` library to use it as a solver for the Hubbard-I approximation.
``pomerol`` is an exact diagonalization (ED) library implemented in c++.
``DCore`` provides an interface to ``pomerol`` library to compute an approximate solution of DMFT with discritized hybridization function.

Features
--------

- All interactions available in ``DCore`` are supported.

- [todo] tail evaluation of Gf
- Arbitrary temperature

- [todo] dynamical susceptibility
- All interactions available in ``DCore`` are supported.

- [experimental] two-particle Green's function

- [todo] tail evaluation of Gf

Install
-------

Expand All @@ -27,8 +27,46 @@ The following library/program needs to be installed:
How to use
----------

Mandatory parameters:

::

[impurity_solver]
name = pomerol
exec_path{str} = /install_directory/bin/pomerol2dcore

Optional parameters:

::

n_bath{int} = 3 # 0 for default
fit_gtol{float} = 1e-6 # 1e-5 for default

The default value of ``n_bath`` is 0, namely, no bath site is taken into account (Hubbard-I approximation).
For ``n_bath>0``, hybridization function Delta(iw) is fitted by

.. math::
\Delta^{n_\mathrm{bath}}_{o_1 o_2}(i\omega) = \sum_{l=1}^{n_\mathrm{bath}} \frac{V_{o_1 l} V_{l o_2}}{i\omega - \epsilon_l}
Then, the finite-size system consisting of the impurity site and ``n_bath`` bath sites are solve by ED method.
The size of the Hilbert space increases exponentially according to :math:`2^{n_\textrm{spn-orb}}` where :math:`n_\textrm{spn-orb}=2*n_\mathrm{orb} + 2*n_\mathrm{bath}`.
Because of storage limitation, :math:`n_\textrm{spn-orb} \simeq 16` is the limits in this solver.

Example
-------

:doc:`The square-lattice model in tutorial <../../tutorial/square/square>` is solved by the pomerol solver using the following input parameter set:

:download:`dmft_square_pomerol.ini <dmft_square_pomerol.ini>`

.. literalinclude:: dmft_square_pomerol.ini
:language: ini

It is recommended to set ``convergence_tol`` parameter in [control] block to stop the DMFT loop automatically.
The figure below shows the renormalization factor as a function of ``n_bath``.
Convergence to the CTHYB result is obtained around ``n_bath=3``.

.. image:: renorm.png
:width: 700
:align: center
Binary file added doc/impuritysolvers/pomerol/renorm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
Installation
============

Install script
--------------
You may use `MateriAppsInstaller <https://github.com/wistaria/MateriAppsInstaller>`_, a collection of install scripts, to install prerequisites (TRIQS 1.4.x) and DCore.

Download
--------

Expand Down Expand Up @@ -34,7 +38,7 @@ You can download the source files in two ways.
Prerequisites
-------------

#. `TRIQS <https://triqs.github.io/triqs/>`_ and `DFTTools/TRIQS <https://triqs.github.io/dft_tools/>`_.
#. `TRIQS <https://triqs.github.io/triqs/>`_ and `TRIQS/DFTTools <https://triqs.github.io/dft_tools/>`_.
They must be installed prior to installing all other programs.
If not, please install them following our instruction for :doc:`TRIQS 1.4.x <install_triqs14x>` or :doc:`TRIQS 2.1.x <install_triqs21x>`.

Expand Down Expand Up @@ -82,6 +86,11 @@ Installation steps
Please set CMAKE_INSTALL_PREFIX to the directory where DCore will be installed.
If the cmake command succeeded, you will see the following message.

DCore invokes some MPI parallelized impurity solver in a DMFT loop.
If your system MPI command is not "mpirun", please provide the name of the correct one to DCore through cmake by using the flag "-DMPIEXEC".
The default value is "mpirun -np #" (# is replaced by the number of processors).
For instance, if your wrapper is "mpijob" and you do not need to specify the number of processors explicitly, please use ``-DMPIEXEC="mpijob"``.

::

-- Build files have been written to: /.../dcore.build
Expand All @@ -98,9 +107,7 @@ Installation steps

$ make test

If your system MPI wrapper is not "mpirun", please provide the name of the correct one to DCore through cmake by using the flag "-DMPIEXEC".
The default value is "mpirun -np #" (# is replaced by the number of processors).
For instance, if your wrapper is "mpijob" and you do not need to specify the number of processors explicitly, please use -DMPIEXEC=mpijob.
Some of tests invoke an MPI parallelized impourity solver.
Note that it is not allowed to run MPI programs interactively on some system.
In this case, please run tests as a job.

Expand Down
3 changes: 3 additions & 0 deletions doc/reference/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,6 @@ This block includes parameters that are solely used by ``dcore_post``.
This block includes parameters which are read by ``dcore`` and ``dcore_post``.

.. include:: mpi_desc.txt

When an option ``-DMPIEXEC=<MPIRUN>`` is passed to the ``cmake`` command,
The default value of ``command`` will be replaced with ``<MPIRUN>``.
2 changes: 1 addition & 1 deletion doc/tutorial/square/square.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ We can plot it using gnuplot as follows:
:align: center

Another impurity solver: CTHYB-SEG
---------------------------
----------------------------------

The input file for ALPS/cthyb-seg is given as below.

Expand Down
5 changes: 4 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/sitecustomize.py ${CMAKE_CURRENT_BINARY

# Install path
install(DIRECTORY ${CMAKE_SOURCE_DIR}/python/ DESTINATION
${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/dcore FILES_MATCHING PATTERN *.py)
${DCORE_SITE_PACKAGES}/dcore FILES_MATCHING PATTERN *.py)

# Copy all Python files for ctest into a build directory
file(GLOB_RECURSE all_py_files RELATIVE ${CMAKE_SOURCE_DIR}/python *.py)
Expand All @@ -21,6 +21,9 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/py_source.tar

add_custom_target(copy_tar_py ALL DEPENDS ${CMAKE_BINARY_DIR}/py_source.tar)

configure_file(mpi_command.py.in ${CMAKE_CURRENT_BINARY_DIR}/dcore/mpi_command.py @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dcore/mpi_command.py DESTINATION ${DCORE_SITE_PACKAGES}/dcore)

# add version file
configure_file(version.py.in version.py)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${DCORE_SITE_PACKAGES}/dcore)
3 changes: 2 additions & 1 deletion python/dcore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# DCore -- Integrated DMFT software for correlated electrons
# Copyright (C) 2017 The University of Tokyo
Expand Down Expand Up @@ -53,6 +52,7 @@ def dcore(filename, np=1):
if __name__ == '__main__':
from .option_tables import generate_all_description
import argparse
from .version import version

parser = argparse.ArgumentParser(
prog='dcore.py',
Expand All @@ -69,6 +69,7 @@ def dcore(filename, np=1):
type=str,
help="input file name.")
parser.add_argument('--np', default=1, help='Number of MPI processes', required=True)
parser.add_argument('--version', action='version', version='DCore {}'.format(version))

args = parser.parse_args()
if os.path.isfile(args.path_input_file) is False:
Expand Down
7 changes: 4 additions & 3 deletions python/dcore_bse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# DCore -- Integrated DMFT software for correlated electrons
# Copyright (C) 2017 The University of Tokyo
Expand Down Expand Up @@ -74,9 +73,9 @@ def calc_g2_in_impurity_model(solver_name, solver_params, mpirun_command, basis_

# Solve the model
if flag_box:
xloc, chiloc = sol.calc_Xloc_ph(rot, mpirun_command, num_wf, num_wb, s_params)
xloc, chiloc = sol.calc_G2loc_ph(rot, mpirun_command, num_wf, num_wb, s_params)
else:
xloc, chiloc = sol.calc_Xloc_ph_sparse(rot, mpirun_command, freqs, num_wb, s_params)
xloc, chiloc = sol.calc_G2loc_ph_sparse(rot, mpirun_command, freqs, num_wb, s_params)

# Check results for x_loc
print("\n checking x_loc...")
Expand Down Expand Up @@ -663,6 +662,7 @@ def dcore_bse(filename, np=1):
if __name__ == '__main__':
import argparse
from .option_tables import generate_all_description
from .version import version

parser = argparse.ArgumentParser(
prog='dcore_bse.py',
Expand All @@ -678,6 +678,7 @@ def dcore_bse(filename, np=1):
help="input file name."
)
parser.add_argument('--np', help='Number of MPI processes', required=True)
parser.add_argument('--version', action='version', version='DCore {}'.format(version))

args = parser.parse_args()
if os.path.isfile(args.path_input_file) is False:
Expand Down
5 changes: 2 additions & 3 deletions python/dcore_check.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# DCore -- Integrated DMFT software for correlated electrons
# Copyright (C) 2017 The University of Tokyo
Expand All @@ -18,8 +17,6 @@
#
from __future__ import print_function

from itertools import *

from .pytriqs_gf_compat import *

from dmft_core import DMFTCoreSolver
Expand Down Expand Up @@ -300,6 +297,7 @@ def dcore_check(ini_file, prefix, fig_ext, max_n_iter):
if __name__ == '__main__':
from .option_tables import generate_all_description
import argparse
from .version import version

parser = argparse.ArgumentParser(
prog='dcore_check.py',
Expand Down Expand Up @@ -331,6 +329,7 @@ def dcore_check(ini_file, prefix, fig_ext, max_n_iter):
type=int,
help='Max number of iterations to be processed'
)
parser.add_argument('--version', action='version', version='DCore {}'.format(version))
# for backward compatibility
# parser.add_argument('--output',
# action='store',
Expand Down
3 changes: 2 additions & 1 deletion python/dcore_post.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# DCore -- Integrated DMFT software for correlated electrons
# Copyright (C) 2017 The University of Tokyo
Expand Down Expand Up @@ -442,6 +441,7 @@ def dcore_post(filename, np=1, prefix="./"):
if __name__ == '__main__':
from .option_tables import generate_all_description
import argparse
from .version import version

parser = argparse.ArgumentParser(
prog='dcore_post.py',
Expand All @@ -458,6 +458,7 @@ def dcore_post(filename, np=1, prefix="./"):
help="input file name."
)
parser.add_argument('--np', help='Number of MPI processes', required=True)
parser.add_argument('--version', action='version', version='DCore {}'.format(version))
parser.add_argument('--prefix',
action='store',
default='post/',
Expand Down
7 changes: 4 additions & 3 deletions python/dcore_pre.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# DCore -- Integrated DMFT software for correlated electrons
# Copyright (C) 2017 The University of Tokyo
Expand Down Expand Up @@ -262,8 +261,8 @@ def __generate_local_potential(p):
# set factor
try:
fac = ast.literal_eval(local_potential_factor)
if isinstance(fac, float):
fac = [fac] * n_inequiv_shells
if isinstance(fac, float) or isinstance(fac, int):
fac = [float(fac)] * n_inequiv_shells
elif isinstance(fac, list) or isinstance(fac, tuple):
assert len(fac) == n_inequiv_shells
else:
Expand Down Expand Up @@ -390,6 +389,7 @@ def dcore_pre(filename):
if __name__ == '__main__':
from .option_tables import generate_all_description
import argparse
from .version import version

parser = argparse.ArgumentParser(
prog='dcore_pre.py',
Expand All @@ -405,6 +405,7 @@ def dcore_pre(filename):
type=str,
help="input file name."
)
parser.add_argument('--version', action='version', version='DCore {}'.format(version))

args = parser.parse_args()
if os.path.isfile(args.path_input_file) is False:
Expand Down
Loading

0 comments on commit 821291c

Please sign in to comment.