Skip to content

Commit

Permalink
Merge branch 'develop' into revert-65-revert-10-lanczos-fix-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tmisawa authored Oct 1, 2024
2 parents ca0a4ac + 5ba89e0 commit 1410872
Show file tree
Hide file tree
Showing 164 changed files with 11,005 additions and 723 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- develop
- gh_actions # test branch
- '!gh-pages'
tags: '*'
Expand All @@ -13,21 +14,21 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
uses: rlespinasse/github-slug-action@v4.x

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: main

- name: Checkout gh-pages
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: gh-pages
path: gh-pages

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand All @@ -42,7 +43,7 @@ jobs:
cmake -E make_directory build
cd build
cmake -DDocument=ON -DENABLE_MPI=OFF ../
make doc-ja-html doc-en-html
make doc-ja-html doc-en-html tutorial-ja-html
- name: Deploy Configuration
run: |
Expand All @@ -63,6 +64,11 @@ jobs:
mkdir -p "gh-pages/doc/${TARGET_NAME}"
cp -r "main/build/doc/${lang}/source/html" "gh-pages/doc/${TARGET_NAME}/${lang}"
done
for lang in ja; do
rm -rf "gh-pages/doc/${TARGET_NAME}/tutorial/${lang}"
mkdir -p "gh-pages/doc/${TARGET_NAME}"/tutorial/
cp -r "main/build/doc/tutorial/${lang}/source/html" "gh-pages/doc/${TARGET_NAME}/tutorial/${lang}"
done
cd gh-pages
git config --local user.name "${GIT_USER}"
git config --local user.email "${GIT_EMAIL}"
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI

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

Expand Down Expand Up @@ -32,7 +33,7 @@ jobs:
- name: brew
if: ${{ runner.os == 'macOS' }}
run: |
brew install openmpi scalapack libomp
brew install openmpi scalapack libomp blis
- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -52,13 +53,10 @@ jobs:
run: |
if [ ${{ runner.os }} = "macOS" ] ; then
# CONFIG=apple requires gfortran but macOS runner has not, but gfortran-11, 12, ...
ln -s `which gfortran-11` gfortran
env PATH=`pwd`:$PATH cmake -DCONFIG=apple -DCMAKE_VERBOSE_MAKEFILE=ON $GITHUB_WORKSPACE
cmake -DCONFIG=apple -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_Fortran_COMPILER=gfortran-14 $GITHUB_WORKSPACE
else
cmake -DCMAKE_VERBOSE_MAKEFILE=ON $GITHUB_WORKSPACE
fi
env:
HOMEBREW_PREFIX: /opt/homebrew
- name: build
working-directory: ${{runner.workspace}}/build
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "src/pfaffine"]
path = src/pfaffine
url = https://github.com/xrq-phys/Pfaffine
branch = blis
[submodule "src/blis"]
path = src/blis
url = https://github.com/xrq-phys/blis
Expand Down
68 changes: 59 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(mVMC NONE)

option(USE_SCALAPACK "Use Scalapack" OFF)
option(PFAFFIAN_BLOCKED "Use blocked-update Pfaffian to speed up." OFF)
option(USE_GEMMT "Use GEMMT. Recommended regardless blocked-Pfaffian-update." ON)

add_definitions(-D_mVMC)
if(CONFIG)
Expand All @@ -17,18 +18,18 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
option(BUILD_SHARED_LIBS "Build shared libraries" ON)

option(GIT_SUBMODULE_UPDATE "execute `git submodule update` automatically" ON)
enable_language(C Fortran)
if(PFAFFIAN_BLOCKED)
enable_language(CXX)
set(CMAKE_CXX_STANDARD 11)
endif(PFAFFIAN_BLOCKED)

# First, enables C language only.
# External packages only use their C API.
enable_language(C)

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MACOSX_RPATH 1)

# TODO: Is this really needed?
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
else()
Expand All @@ -37,16 +38,19 @@ else()
endif()

if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
# TODO: Really needs separation?
if("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "15.0.0.20140528")
set(OMP_FLAG_Intel "-openmp")
else()
set(OMP_FLAG_Intel "-qopenmp")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OMP_FLAG_Intel}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OMP_FLAG_Intel}")
else()
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif(OPENMP_FOUND)
endif()

Expand All @@ -57,13 +61,44 @@ if(MPI_C_FOUND)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_C_LINK_FLAGS}")
endif(MPI_C_FOUND)

# BLAS/LAPACK/Pfapack77 needs Fortran interface.
enable_language(Fortran)

find_package(LAPACK)
if(USE_SCALAPACK MATCHES OFF)
if(LAPACK_FOUND)
add_definitions(-D_lapack)
endif(LAPACK_FOUND)
endif()

if(PFAFFIAN_BLOCKED
OR USE_GEMMT)
set(Require_BLIS ON)
endif()

if(BLA_VENDOR MATCHES "Intel10*"
OR BLAS_LIBRARIES MATCHES "/*mkl*")
# Don't require BLIS when MKL is used.
add_definitions(-DMKL)
add_definitions(-DBLAS_EXTERNAL)
add_definitions(-DF77_COMPLEX_RET_INTEL)
set(Require_BLIS OFF)
elseif(BLA_VENDOR MATCHES "FLA*"
OR BLAS_LIBRARIES MATCHES "/*blis*")
# Skip extra BLIS if it's already the BLAS vendor.
list(GET BLAS_LIBRARIES 0 BLIS_FIRST_LIB)
get_filename_component(BLIS_LIB_DIR ${BLIS_FIRST_LIB} DIRECTORY)
include_directories(${BLIS_LIB_DIR}/../include)
include_directories(${BLIS_LIB_DIR}/../include/blis)
set(Require_BLIS OFF)
else()
# BLAS vendor preference:
# External > BLIS > Reference
if(DEFINED BLA_VENDOR)
add_definitions(-DBLAS_EXTERNAL)
endif()
endif()

# Build and enable tests
# testing setup
# enable_testing() must be called in the top-level CMakeLists.txt before any add_subdirectory() is called.
Expand Down Expand Up @@ -97,12 +132,23 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
endif()
add_subdirectory("${STDFACE_DIR}")

# C++ support for pfupdates & ltl2inv.
enable_language(CXX)
set(CMAKE_CXX_STANDARD 11)

if(Require_BLIS)
include("download_blis_artifact.cmake")
else(Require_BLIS)
# Use bundled blis.h
include_directories(src/common/deps)
endif(Require_BLIS)

if(PFAFFIAN_BLOCKED)
add_definitions(-D_pf_block_update)
include("download_blis_artifact.cmake")
# Must set BLIS artifact BEFORE adding pfupdates target.
add_subdirectory(src/pfupdates)
add_dependencies(pfupdates blis_include)
if(Require_BLIS)
add_dependencies(pfupdates blis_include)
endif(Require_BLIS)
endif(PFAFFIAN_BLOCKED)

if (Document)
Expand All @@ -111,5 +157,9 @@ endif(Document)

add_subdirectory(src/ComplexUHF)
add_subdirectory(src/pfapack/fortran)
add_subdirectory(src/ltl2inv)
if(Require_BLIS)
add_dependencies(ltl2inv blis_include)
endif(Require_BLIS)
add_subdirectory(src/mVMC)
add_subdirectory(tool)
3 changes: 3 additions & 0 deletions config/aocc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ set(CMAKE_C_FLAGS_RELEASE "-Wno-unknown-pragmas -O3 -DNDEBUG -DHAVE_SSE2" CACHE
set(CMAKE_Fortran_COMPILER "flang" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -DHAVE_SSE2" CACHE STRING "" FORCE)

# OpenMP, libatomic
set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -latomic")

# for AOCL
set(BLA_VENDOR "FLAME" CACHE STRING "" FORCE)

Expand Down
3 changes: 1 addition & 2 deletions config/apple.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# additional libomp and gfortran installation required
# mac computers are suggested to use this configuration for better performance

if(NOT $ENV{HOMEBREW_PREFIX})
if(NOT DEFINED ENV{HOMEBREW_PREFIX})
message(FATAL "Homebrew is not installed. Please install Homebrew first.")
endif()

set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall -Wformat -Werror=format-security")
set(CMAKE_C_FLAGS_RELEASE "-O3 -Wno-unknown-pragmas -Wno-logical-not-parentheses")
# set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE)

# OpenMP with libomp
set(CMAKE_EXE_LINKER_FLAGS "-L$ENV{HOMEBREW_PREFIX}/opt/libomp/lib -lomp")
Expand Down
1 change: 1 addition & 0 deletions config/gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall -Wformat -Werror=format-security")
set(CMAKE_C_FLAGS_RELEASE "-O3 -Wno-unknown-pragmas ")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-unknown-pragmas ")
set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE)
2 changes: 2 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_subdirectory(en/source)
add_subdirectory(ja/source)
add_subdirectory(tutorial/ja/source)

add_custom_target(doc DEPENDS doc-ja doc-en)
add_custom_target(tutorial DEPENDS tutorial-ja)
4 changes: 2 additions & 2 deletions doc/en/source/algorithm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Properties of the Pfaffian-Slater determinant
In this section, we explain some properties of the Pfaffian-Slater
determinant. We derive the general relation between a Pfaffian-Slater
determinant and a single Slater determinant in :ref:`Antiparallel Pfaffian <PfaffianAP>`
and :ref:`General Pfaffian <PfaffianP>` . We also discuss the meaning of the singular value
and :ref:`General Pfaffian <PfaffianP>` . We also discuss meaning of the singular value
decomposition of coefficients :math:`f_{ij}` in
:ref:`SVD <PfaffianSingular>`.

Expand Down Expand Up @@ -190,7 +190,7 @@ redundancy.
Relation between :math:`F_{IJ}` and :math:`\Phi_{In}` (the case of the general pairing)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We extend the relationship between the Pfaffian-Slater wave function and the
We extend the relation between the Pfaffian-Slater wave function and the
single Slater wave function into the general pairing case including the
spin-parallel pairing. We define the Pfaffian-Slater wave function and
the single Slater wave function as
Expand Down
Loading

0 comments on commit 1410872

Please sign in to comment.