Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [push]
on:
push:
pull_request:
schedule:
- cron: '0 0 1,15 * *' # JST 9:00 on 1st and 15th every month

jobs:
ctest:
Expand All @@ -15,9 +19,6 @@ jobs:
- os: ubuntu-24.04
mpisize: 1
ompsize: 3
- os: macos-13
mpisize: 1
ompsize: 1
- os: macos-latest
mpisize: 1
ompsize: 1
Expand Down Expand Up @@ -58,7 +59,7 @@ jobs:
shell: bash
run: |
if [ ${{ runner.os }} = "macOS" ] ; then
export FC=gfortran-12
export FC=gfortran-15
fi
cmake -DCMAKE_VERBOSE_MAKEFILE=ON $GITHUB_WORKSPACE

Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.0...3.10)
enable_testing()

project(HPhi NONE)
Expand All @@ -24,7 +24,7 @@ enable_language(C Fortran)
#set(CMAKE_C_FLAGS "-lscalapack -lgfortran -lm")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MACOSX_RPATH 1)

Expand Down Expand Up @@ -56,9 +56,9 @@ endif()

if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
if("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "15.0.0.20140528")
set(OMP_FLAG_Intel "-openmp")
set(OMP_FLAG_Intel "-openmp")
else()
set(OMP_FLAG_Intel "-qopenmp")
set(OMP_FLAG_Intel "-qopenmp")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OMP_FLAG_Intel}")
else()
Expand Down
21 changes: 16 additions & 5 deletions doc/en/source/filespecification/expertmode_en/ModPara_file_en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,22 @@ Common parameters

**Type :** Int (positive integer)

**Description :** If ``CalcHS=1``, an efficient algorithm for generating
the restricted Hilbert space with the specified quantum number is
used (Details of algorithm is shown in
http://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf [in Japanese]). Default
value is 1 and the efficient algorithm is used.
**Description :** Selects the algorithm used to enumerate the
restricted Hilbert space with the specified quantum number.
If ``CalcHS=1``, an efficient algorithm based on bit manipulation
is used (details are given in
http://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf [in Japanese]).
If ``CalcHS=2``, an alternative enumeration path is taken that can
be useful for some large-sector cases by avoiding the full
``sdim = 2^Nsite`` outer loop of ``CalcHS=1``; note, however, that
the current implementation still allocates the auxiliary index
arrays (``list_2_1``, ``list_2_2``, ``list_jb``) at size ``O(sdim)``
and uses an additional ``O(idim_max)`` temporary sort buffer for
the Hubbard branch, so it is not a memory-only large-system fix.
``CalcHS=2`` is currently available only for the ``Hubbard`` and
``HubbardNConserved`` models; passing it with any other model
(e.g. ``Kondo``, ``Spin``) results in an explicit error. Default
value is 1.



Expand Down
12 changes: 10 additions & 2 deletions doc/ja/source/filespecification/expertmode_ja/ModPara_file_ja.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,16 @@ ModParaファイル
**形式 :** int型 (自然数)

**説明 :**
``CalcHS=1``\ で量子数を指定したときのヒルベルト空間生成が高速化されます(詳細は http://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdfを参照)。
デフォルトの値は1で、高速化アルゴリズムが使用されます。
``CalcHS=1``\ ではビット操作による高速化アルゴリズムを使用します
(詳細は http://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf を参照)。
``CalcHS=2``\ は ``CalcHS=1`` の ``sdim = 2^Nsite`` 外側ループを回避する
代替の列挙経路で、一部の大きな sector で有効です。ただし現在の実装では
補助の index 配列 (``list_2_1`` / ``list_2_2`` / ``list_jb``) は依然 ``O(sdim)`` で
確保され、Hubbard 分岐では ``O(idim_max)`` の一時 sort buffer も使用するため、
メモリ面だけで大規模系を解決するものではありません。
``CalcHS=2``\ は現時点で ``Hubbard`` と ``HubbardNConserved`` モデルでのみ利用可能で、
それ以外のモデル (例: ``Kondo``, ``Spin``) で指定した場合はエラーになります。
デフォルト値は 1 です。



Expand Down
3 changes: 1 addition & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# include guard
cmake_minimum_required(VERSION 2.8)
if(${CMAKE_PROJECT_NAME} STREQUAL "Project")
message(FATAL_ERROR "cmake should be executed not for 'src' subdirectory, but for the top directory of HPhi.")
message(FATAL_ERROR "cmake should not be executed directly in subdirectory.")
endif(${CMAKE_PROJECT_NAME} STREQUAL "Project")

add_subdirectory(komega)
Expand Down
20 changes: 20 additions & 0 deletions src/include/sz.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,26 @@ int sz(
long unsigned int *list_2_2_
);

unsigned long int sz_hacker_for_large_systems(
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);

long unsigned int make_true_spin(long unsigned int spin, int shift_offset, int Nsite);

void update_lists(
long unsigned int i, long unsigned int ihfbit,
long unsigned int *list_1_, long unsigned int *list_2_1_, long unsigned int *list_2_2_,
long unsigned int *ja, long unsigned int *jb,
long unsigned int *prev_ib, long unsigned int Nsite
);

int compare_ulong(const void *a, const void *b);

int Read_sz(
struct BindStruct *X,
const long unsigned int irght,
Expand Down
3 changes: 1 addition & 2 deletions src/komega/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# include guard
cmake_minimum_required(VERSION 2.8)
if(${CMAKE_PROJECT_NAME} STREQUAL "Project")
message(FATAL_ERROR "cmake should be executed not for 'src' subdirectory, but for the top directory of HPhi.")
message(FATAL_ERROR "cmake should not be executed directly in subdirectory.")
endif(${CMAKE_PROJECT_NAME} STREQUAL "Project")

add_definitions(-D__NO_ZDOT)
Expand Down
Loading
Loading