Skip to content

Commit 546ebd0

Browse files
committed
Merge branch 'unstable' into 3.2.x. Update documentation.
2 parents 3898ae5 + 295597e commit 546ebd0

31 files changed

+159
-247
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Checks: '-*,modernize-*,cppcoreguidelines-*,-modernize-use-trailing-return-type,-modernize-use-nullptr,-cppcoreguidelines-avoid-magic-numbers'
2-
HeaderFilterRegex: 'triqs_ctseg-J'
2+
HeaderFilterRegex: 'triqs_ctseg'

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Please provide the application version that you used.
3232

3333
You can get this information from copy and pasting the output of
3434
```bash
35-
python -c "from triqs_ctseg-J.version import *; show_version(); show_git_hash();"
35+
python -c "from triqs_ctseg.version import *; show_version(); show_git_hash();"
3636
```
3737
from the command line. Also, please include the OS you are running and its version.
3838

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
make -j1 install VERBOSE=1
112112
cd ../
113113
114-
- name: Build ctseg-J
114+
- name: Build ctseg
115115
env:
116116
CC: ${{ matrix.cc }}
117117
CXX: ${{ matrix.cxx }}
@@ -121,7 +121,7 @@ jobs:
121121
mkdir build && cd build && cmake ..
122122
make -j2 || make -j1 VERBOSE=1
123123
124-
- name: Test ctseg-J
124+
- name: Test ctseg
125125
env:
126126
DYLD_FALLBACK_LIBRARY_PATH: /usr/local/opt/llvm/lib
127127
OPENBLAS_NUM_THREADS: "1"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See ../triqs/packaging for other options
22
FROM flatironinstitute/triqs:unstable-ubuntu-clang
3-
ARG APPNAME=ctseg-J
3+
ARG APPNAME=ctseg
44

55
RUN apt-get install -y libnfft3-dev || yum install -y nfft-devel || dnf install -y 'https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/n/nfft-3.3.2-1.el7.x86_64.rpm' 'https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/n/nfft-devel-3.3.2-1.el7.x86_64.rpm'
66

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![build](https://github.com/TRIQS/ctseg/workflows/build/badge.svg)](https://github.com/TRIQS/ctseg/actions?query=workflow%3Abuild)
22

3-
## TRIQS segment picture solver with spin-spin interactions (CTSEG-J)
3+
## TRIQS segment picture solver (CTSEG)
44

55
Copyright (C) 2024, N. Kavokine, H. Lu, N. Wentzell and O. Parcollet.
66

c++/triqs_ctseg/params.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ struct constr_params_t {
1111
/// Inverse temperature
1212
double beta;
1313

14-
/// Structure of the GF (names, sizes of blocks)
14+
/// Structure of the Green's function (names and sizes of blocks)
1515
gf_struct_t gf_struct;
1616

17-
/// Number of time slices for $Delta(\tau)$/$G(\tau)$/$F(\tau)$
17+
/// Number of time slices for fermionic functions
1818
int n_tau = 10001;
1919

20-
/// Number of time slices for $K(\tau)$
20+
/// Number of time slices for bosonic functions
2121
int n_tau_k = 10001;
2222
};
2323

@@ -87,7 +87,7 @@ struct solve_params_t {
8787

8888
// -------- Measure control --------------
8989

90-
/// Whether to measure the perturbation order histograms (Order in Delta, and Jperp)
90+
/// Whether to measure the perturbation order histograms (order in Delta and Jperp)
9191
bool measure_perturbation_order_histograms = true;
9292

9393
/// Whether to measure G(tau) (see [[measure_g_f_tau]])
@@ -102,13 +102,13 @@ struct solve_params_t {
102102
/// Whether to measure sign (see [[measure_sign]])
103103
bool measure_sign = true;
104104

105-
/// Whether to measure <nn> (see [[measure_nn]])
105+
/// Whether to measure <n(0)n(0)> (see [[measure_nn]])
106106
bool measure_nn = false;
107107

108-
/// Whether to measure langle n(tau)n(0)rangle (see [[measure_nnt]])
108+
/// Whether to measure <n(tau)n(0)> (see [[measure_nnt]])
109109
bool measure_nnt = false;
110110

111-
/// Whether to measure langle s_x(tau)s_x(0)rangle (see [[measure_sperp_tau]])
111+
/// Whether to measure <s_x(tau)s_x(0)> (see [[measure_sperp_tau]])
112112
bool measure_sperpt = false;
113113

114114
/// Whether to measure state histograms (see [[measure_statehist]])

c++/triqs_ctseg/solver_core.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ solver_core::solver_core(constr_params_t const &p) : constr_params(p) {
2727

2828
// ---------------------------------------------------------------------------
2929

30-
void solver_core::solve(solve_params_t const &solve_params) {
30+
void solver_core::solve(solve_params_t const &solve_params_input) {
3131

32-
// http://patorjk.com/software/taag/#p=display&f=Calvin%20S&t=TRIQS%20ctint
32+
// http://patorjk.com/software/taag/#p=display&f=Calvin%20S&t=TRIQS%20ctseg
3333
if (c.rank() == 0)
3434
std::cout << "\n"
35-
"╔╦╗╦═╗╦╔═╗ ╔═╗ ┌─┐┌┬┐┌─┐┌─┐┌─┐\n"
36-
" ║ ╠╦╝║║═╬╗╚═╗ │ │ └─┐├┤ │ ┬───│ \n"
37-
" ╩ ╩╚═╩╚═╝╚╚═╝ └─┘ ┴ └─┘└─┘└─┘ └┘ \n";
35+
"╔╦╗╦═╗╦╔═╗ ╔═╗ ┌─┐┌┬┐┌─┐┌─┐┌─┐\n"
36+
" ║ ╠╦╝║║═╬╗╚═╗ │ │ └─┐├┤ │ ┬\n"
37+
" ╩ ╩╚═╩╚═╝╚╚═╝ └─┘ ┴ └─┘└─┘└─┘\n";
3838

3939
// ................ Parameters .................
40-
// Store the solve_params
41-
last_solve_params = solve_params;
4240
// Merge constr_params and solve_params
43-
params_t p(constr_params, solve_params);
41+
params_t p(constr_params, solve_params_input);
42+
// Store the solve_params
43+
solve_params = solve_params_input;
4444

4545
// ................ Work data & Configuration ...................
4646

@@ -117,7 +117,7 @@ void h5_write(h5::group h5group, std::string subgroup_name, solver_core const &s
117117
h5_write_attribute(grp, "TRIQS_GIT_HASH", std::string(STRINGIZE(TRIQS_GIT_HASH)));
118118
h5_write_attribute(grp, "CTSEGJ_GIT_HASH", std::string(STRINGIZE(CTSEGJ_GIT_HASH)));
119119
h5_write(grp, "constr_params", s.constr_params);
120-
h5_write(grp, "last_solve_params", s.last_solve_params);
120+
h5_write(grp, "solve_params", s.solve_params);
121121
h5_write(grp, "inputs", s.inputs);
122122
h5_write(grp, "results", s.results);
123123
}
@@ -127,7 +127,7 @@ solver_core solver_core::h5_read_construct(h5::group h5group, std::string subgro
127127
auto grp = h5group.open_group(subgroup_name);
128128
auto constr_params = h5_read<constr_params_t>(grp, "constr_params");
129129
auto s = solver_core{constr_params};
130-
h5_read(grp, "last_solve_params", s.last_solve_params);
130+
h5_read(grp, "solve_params", s.solve_params);
131131
h5_read(grp, "inputs", s.inputs);
132132
h5_read(grp, "results", s.results);
133133
return s;

c++/triqs_ctseg/solver_core.hpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@ class solver_core {
1919
mpi::communicator c;
2020

2121
public:
22-
/// Solver construction parameters
22+
/**Set of parameters used in the construction of the ``solver_core`` class.
23+
*
24+
*.. include:: ../../python/triqs_ctseg/parameters_constr_params_t.rst
25+
*/
2326
constr_params_t constr_params;
2427

25-
/// Solver solve parameters (from last call)
26-
std::optional<solve_params_t> last_solve_params;
28+
/**Set of parameters used by the last call to ``solve()``.
29+
*
30+
*.. include:: ../../python/triqs_ctseg/parameters_solve_params_t.rst
31+
*/
32+
std::optional<solve_params_t> solve_params;
2733

28-
/// The set of results
34+
/// The set of results. See :doc:`Measurements <../guide/measurements>`.
2935
// Will be passed to measures and initialized by them.
3036
results_t results;
3137

@@ -48,7 +54,7 @@ class solver_core {
4854
gf_view<imtime> D0_tau() { return inputs.d0t; }
4955

5056
// --------------- h5 -------------------------
51-
CPP2PY_IGNORE static std::string hdf5_format() { return "CTSEG-J_SolverCore"; }
57+
CPP2PY_IGNORE static std::string hdf5_format() { return "CTSEG_SolverCore"; }
5258
friend void h5_write(h5::group h5group, std::string subgroup_name, solver_core const &s);
5359
CPP2PY_IGNORE static solver_core h5_read_construct(h5::group h5group, std::string subgroup_name);
5460
};

c++/triqs_ctseg/work_data.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ work_data_t::work_data_t(params_t const &p, inputs_t const &inputs, mpi::communi
5454
has_Dt = max_element(abs(inputs.d0t.data())) > 1.e-13;
5555
has_jperp = max_element(abs(inputs.jperpt.data())) > 1.e-13;
5656

57+
// Check: no J_perp implementation for more than 2 colors
58+
if (n_color != 2) {
59+
ALWAYS_EXPECTS((not has_jperp), "Error : has_jperp is true and we have {} colors instead of 2", n_color);
60+
}
61+
5762
// For numerical integration of the D0 and Jperp
5863
auto ramp = nda::zeros<double>(p.n_tau_k);
5964
for (auto n : range(p.n_tau_k)) { ramp(n) = n * beta / (p.n_tau_k - 1); }
@@ -73,7 +78,7 @@ work_data_t::work_data_t(params_t const &p, inputs_t const &inputs, mpi::communi
7378
first_integral(i) = first_integral(i - 1) + (D_data(i) + D_data(i - 1)) / 2;
7479
second_integral(i) = second_integral(i - 1) + (first_integral(i) + first_integral(i - 1)) / 2;
7580
}
76-
// Noramlize by bin size
81+
// Normalize by bin size
7782
first_integral *= beta / (p.n_tau_k - 1);
7883
second_integral *= (beta / (p.n_tau_k - 1)) * (beta / (p.n_tau_k - 1));
7984
// Enforce K(0) = K(beta) = 0

doc/CMakeLists.txt

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,5 @@
11
# Generate the sphinx config file
22
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
3-
4-
# -----------------------------------------------------------------------------
5-
# Create an optional target that allows us to regenerate the C++ doc with c++2rst
6-
# -----------------------------------------------------------------------------
7-
# add_custom_target(${PROJECT_NAME}_docs_cpp2rst)
8-
# include(${PROJECT_SOURCE_DIR}/share/cmake/extract_flags.cmake)
9-
# extract_flags(${PROJECT_NAME}_c BUILD_INTERFACE)
10-
# separate_arguments(${PROJECT_NAME}_c_CXXFLAGS)
11-
# macro(generate_docs header_file)
12-
# add_custom_command(
13-
# TARGET ${PROJECT_NAME}_docs_cpp2rst
14-
# COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
15-
# COMMAND
16-
# PYTHONPATH=${CPP2PY_BINARY_DIR}:$ENV{PYTHONPATH}
17-
# PATH=${CPP2PY_BINARY_DIR}/bin:${CPP2PY_ROOT}/bin:$ENV{PATH}
18-
# c++2rst
19-
# ${header_file}
20-
# -N ${PROJECT_NAME}
21-
# --output_directory ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
22-
# -I${PROJECT_SOURCE_DIR}/c++
23-
# --cxxflags="${${PROJECT_NAME}_c_CXXFLAGS}"
24-
# )
25-
# endmacro(generate_docs)
26-
27-
# generate_docs(${PROJECT_SOURCE_DIR}/c++/${PROJECT_NAME}/solver_core.hpp)
28-
# generate_docs(${PROJECT_SOURCE_DIR}/c++/${PROJECT_NAME}/params.hpp)
29-
30-
# --------------------------------------------------------
31-
# Build & Run the C++ doc examples and capture the output
32-
# --------------------------------------------------------
33-
34-
# add_custom_target(${PROJECT_NAME}_docs_example_output)
35-
# file(GLOB_RECURSE ExampleList RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
36-
# foreach(example ${ExampleList})
37-
# get_filename_component(f ${example} NAME_WE)
38-
# get_filename_component(d ${example} DIRECTORY)
39-
# add_executable(${PROJECT_NAME}_doc_${f} EXCLUDE_FROM_ALL ${example})
40-
# set_property(TARGET ${PROJECT_NAME}_doc_${f} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${d})
41-
# target_link_libraries(${PROJECT_NAME}_doc_${f} triqs)
42-
# add_custom_command(TARGET ${PROJECT_NAME}_doc_${f}
43-
# COMMAND ${PROJECT_NAME}_doc_${f} > ${CMAKE_CURRENT_SOURCE_DIR}/${d}/${f}.output 2>/dev/null
44-
# WORKING_DIRECTORY ${d}
45-
# )
46-
# add_dependencies(${PROJECT_NAME}_docs_example_output ${PROJECT_NAME}_doc_${f})
47-
# endforeach()
48-
493
# ---------------------------------
504
# Top Sphinx target
515
# ---------------------------------
@@ -60,16 +14,12 @@ add_custom_command(
6014
COMMAND PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SPHINXBUILD_EXECUTABLE} -j auto -c . -b html ${CMAKE_CURRENT_SOURCE_DIR} html
6115
)
6216

63-
option(Sphinx_Only "When building the documentation, skip the Python Modules and the generation of C++ Api and example outputs" OFF)
17+
option(Sphinx_Only "When building the documentation, skip the Python Modules" OFF)
6418
if(NOT Sphinx_Only)
65-
# Autodoc usage requires the python modules to be built first
6619
get_property(CPP2PY_MODULES_LIST GLOBAL PROPERTY CPP2PY_MODULES_LIST)
6720
if(CPP2PY_MODULES_LIST)
6821
add_dependencies(${PROJECT_NAME}_docs_sphinx ${CPP2PY_MODULES_LIST})
6922
endif()
70-
71-
# Generation of C++ Api and Example Outputs
72-
#add_dependencies(${PROJECT_NAME}_docs_sphinx ${PROJECT_NAME}_docs_cpp2rst ${PROJECT_NAME}_docs_example_output)
7323
endif()
7424

7525
# ---------------------------------

0 commit comments

Comments
 (0)