Skip to content

Commit

Permalink
Merge pull request #134 from issp-center-dev/develop
Browse files Browse the repository at this point in the history
For releasing 3.4.0
  • Loading branch information
shinaoka authored Sep 29, 2022
2 parents 7769e46 + 2e865bf commit bcab83d
Show file tree
Hide file tree
Showing 17 changed files with 3,520 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run all tests
name: Run tests with triqs
on: [push, pull_request]
jobs:
all-tests:
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/ci_dcorelib.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build/test suite
name: Run tests with dcorelib
on: [push, pull_request]
jobs:
build:
Expand All @@ -19,6 +19,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: apt
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt update
sudo apt install liblapack-dev openmpi-bin libopenmpi-dev libscalapack-openmpi-dev
- uses: mpi4py/setup-mpi@v1

- name: Set up python ${{ matrix.python }}
Expand All @@ -35,8 +40,27 @@ jobs:
run: |
pip install .[dev]
- name: make workspace [HPhi]
run: |
pwd
cmake -E make_directory ${{runner.workspace}}/HPhi/build
- name: download [HPhi]
working-directory: ${{runner.workspace}}/HPhi
run: |
wget https://github.com/issp-center-dev/HPhi/releases/download/v3.5.0/HPhi-3.5.0.tar.gz
tar zxvf HPhi-3.5.0.tar.gz
- name: cmake [HPhi]
working-directory: ${{runner.workspace}}/HPhi/build
shell: bash
run: |
cmake -DCMAKE_VERBOSE_MAKEFILE=ON $GITHUB_WORKSPACE ../HPhi-3.5.0 -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/HPhi
make install
- name: Test with pytest
run: |
export DCORE_TRIQS_COMPAT=1
export PATH=${{runner.workspace}}/HPhi/bin:$PATH
pytest tests/non-mpi/*/*.py
mpirun -np 2 pytest tests/mpi/*/*.py
mpirun -np 2 pytest tests/mpi/*/*.py
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# Import h5py imports mpi4py automatically.
'h5py!=2.10.0',
'toml>=0.10',
'dcorelib>=0.7.1',
'dcorelib>=0.9.1',
'sympy',
],

Expand Down
2 changes: 1 addition & 1 deletion src/dcore/dcore_bse.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def calc_num_flavors(_ish):
print(" skip")
return

Gloc_iw_sh, _ = self.calc_Gloc()
Gloc_iw_sh, _, _ = self.calc_Gloc()
solver_name = self._params['impurity_solver']['name']

# generate sampling points of Matsubara frequencies
Expand Down
2 changes: 1 addition & 1 deletion src/dcore/dcore_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def calc_Sigma_w(self, mesh):
solver_name = self._params['impurity_solver']['name']
Solver = impurity_solvers.solver_classes[solver_name]
if Solver.is_gf_realomega_available():
Gloc_iw_sh, _ = self.calc_Gloc()
Gloc_iw_sh, _, _ = self.calc_Gloc()
_, _, sigma_w = self.solve_impurity_models(Gloc_iw_sh, -1, mesh)
return sigma_w
else:
Expand Down
7 changes: 5 additions & 2 deletions src/dcore/dmft_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def calc_Gloc(self):
diff = make_hermite_conjugate(g)
if diff > 1e-8:
print('Warning Gloc_iw at ish {} is not hermite conjugate: {}'.format(ish, diff))
return r['Gloc_iw_sh'], r['dm_sh']
return r['Gloc_iw_sh'], r['dm_sh'], r['total_charge']


def print_density_matrix(self, dm_sh, smoment_sh):
Expand Down Expand Up @@ -821,7 +821,10 @@ def print_time(comment):
sys.stdout.flush()

# Compute Gloc_iw where the chemical potential is adjusted if needed
Gloc_iw_sh, dm_sh = self.calc_Gloc()
Gloc_iw_sh, dm_sh, total_charge = self.calc_Gloc()
print("\n Total charge : %.6f" % total_charge)
self._quant_to_save_history['total_charge'] = total_charge

smoment_sh = spin_moments_sh(dm_sh)
self.print_density_matrix(dm_sh, smoment_sh)
self._quant_to_save_history['density_matrix'] = dm_sh
Expand Down
4 changes: 4 additions & 0 deletions src/dcore/impurity_solvers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from .null_solver import NullSolver
from .alps_cthyb_seg import ALPSCTHYBSEGSolver
from .pomerol import PomerolSolver
from .hphi import HPhiSolver
from .jo_cthyb_seg import JOCTHYBSEGSolver
from .base import compute_basis_rot

solver_classes = {
Expand All @@ -15,4 +17,6 @@
'null': NullSolver,
'ALPS/cthyb-seg': ALPSCTHYBSEGSolver,
'pomerol': PomerolSolver,
'HPhi': HPhiSolver,
'JO/cthyb-seg': JOCTHYBSEGSolver,
}
4 changes: 2 additions & 2 deletions src/dcore/impurity_solvers/alps_cthyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ def conv(i):
G_l = make_block_gf(GfLegendre, self.gf_struct, self.beta, n_points=Nl)
assign_from_numpy_array_legendre(G_l, gl_data, self.block_names)

# G_iw with 1/iwn tail
# G_iw
for name in self.block_names:
self._Gimp_iw[name] << LegendreToMatsubara(G_l[name])
legendre_to_matsubara(G_l[name], self._Gimp_iw[name])
make_hermite_conjugate(self._Gimp_iw)

# Two-particle GF
Expand Down
Loading

0 comments on commit bcab83d

Please sign in to comment.