Browse Source

Include Usage_Example files; work on LiebLin (code, documentation)

master
J.-S. Caux 6 years ago
parent
commit
2677b62120

+ 2
- 0
.gitignore View File

@@ -4,4 +4,6 @@
4 4
 
5 5
 *tar.gz
6 6
 
7
+*out
8
+
7 9
 TEST/*

+ 0
- 9
ABACUS.org View File

@@ -32,15 +32,6 @@ Type your description here
32 32
 
33 33
 TIP: Search for the string BUGRISK in the codebase
34 34
 
35
-** BUGRISK Value of LiebLin ln_Density_ME
36
-   - State "BUGRISK"    from ""           [2018-02-11 Sun 09:11]
37
-
38
-File: ln_Density_ME.cc
39
-line 66
40
-
41
-Why real?
42
-
43
-
44 35
 * Priority 					       :ABACUS:Dev:Priority:
45 36
   :PROPERTIES:
46 37
   :ARCHIVE:  %s_archive::* Priority

+ 26
- 0
ABACUS.org_archive View File

@@ -0,0 +1,26 @@
1
+#    -*- mode: org -*-
2
+
3
+
4
+Archived entries from file /Users/jscaux/WORK/_ABACUS/ABACUS/ABACUS.org
5
+
6
+
7
+* Bugrisks
8
+
9
+** SOLVED Value of LiebLin ln_Density_ME
10
+   CLOSED: [2018-02-15 Thu 08:42]
11
+   - State "SOLVED"     from "BUGRISK"    [2018-02-15 Thu 08:42] \\
12
+     No problem. Product is always real.
13
+   - State "BUGRISK"    from ""           [2018-02-11 Sun 09:11]
14
+   :PROPERTIES:
15
+   :ARCHIVE_TIME: 2018-02-15 Thu 08:42
16
+   :ARCHIVE_FILE: ~/WORK/_ABACUS/ABACUS/ABACUS.org
17
+   :ARCHIVE_OLPATH: Bugrisks
18
+   :ARCHIVE_CATEGORY: ABACUS
19
+   :ARCHIVE_TODO: SOLVED
20
+   :ARCHIVE_ITAGS: ABACUS Dev Bugrisks
21
+   :END:
22
+
23
+File: ln_Density_ME.cc
24
+line 66
25
+
26
+Why real?

+ 67
- 67
ABACUS_Doxyfile View File

@@ -38,7 +38,7 @@ PROJECT_NAME           = ABACUS
38 38
 # could be handy for archiving the generated documentation or if some version
39 39
 # control system is used.
40 40
 
41
-PROJECT_NUMBER         = 
41
+PROJECT_NUMBER         =
42 42
 
43 43
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
44 44
 # for a project that appears at the top of each page and should give viewer a
@@ -51,7 +51,7 @@ PROJECT_BRIEF          = "Numerical tools for integrable models"
51 51
 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
52 52
 # the logo to the output directory.
53 53
 
54
-PROJECT_LOGO           = 
54
+PROJECT_LOGO           =
55 55
 
56 56
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
57 57
 # into which the generated documentation will be written. If a relative path is
@@ -162,7 +162,7 @@ FULL_PATH_NAMES        = YES
162 162
 # will be relative from the directory where doxygen is started.
163 163
 # This tag requires that the tag FULL_PATH_NAMES is set to YES.
164 164
 
165
-STRIP_FROM_PATH        = 
165
+STRIP_FROM_PATH        =
166 166
 
167 167
 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
168 168
 # path mentioned in the documentation of a class, which tells the reader which
@@ -171,7 +171,7 @@ STRIP_FROM_PATH        =
171 171
 # specify the list of include paths that are normally passed to the compiler
172 172
 # using the -I flag.
173 173
 
174
-STRIP_FROM_INC_PATH    = 
174
+STRIP_FROM_INC_PATH    =
175 175
 
176 176
 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
177 177
 # less readable) file names. This can be useful is your file systems doesn't
@@ -238,13 +238,13 @@ TAB_SIZE               = 4
238 238
 # "Side Effects:". You can put \n's in the value part of an alias to insert
239 239
 # newlines.
240 240
 
241
-ALIASES                = 
241
+ALIASES                =
242 242
 
243 243
 # This tag can be used to specify a number of word-keyword mappings (TCL only).
244 244
 # A mapping has the form "name=value". For example adding "class=itcl::class"
245 245
 # will allow you to use the command class in the itcl::class meaning.
246 246
 
247
-TCL_SUBST              = 
247
+TCL_SUBST              =
248 248
 
249 249
 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
250 250
 # only. Doxygen will then generate output that is more tailored for C. For
@@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL   = NO
291 291
 # Note that for custom extensions you also need to set FILE_PATTERNS otherwise
292 292
 # the files are not read by doxygen.
293 293
 
294
-EXTENSION_MAPPING      = 
294
+EXTENSION_MAPPING      =
295 295
 
296 296
 # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
297 297
 # according to the Markdown format, which allows for more readable
@@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES
648 648
 # sections, marked by \if <section_label> ... \endif and \cond <section_label>
649 649
 # ... \endcond blocks.
650 650
 
651
-ENABLED_SECTIONS       = 
651
+ENABLED_SECTIONS       =
652 652
 
653 653
 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
654 654
 # initial value of a variable or macro / define can have for it to appear in the
@@ -690,7 +690,7 @@ SHOW_NAMESPACES        = YES
690 690
 # by doxygen. Whatever the program writes to standard output is used as the file
691 691
 # version. For an example see the documentation.
692 692
 
693
-FILE_VERSION_FILTER    = 
693
+FILE_VERSION_FILTER    =
694 694
 
695 695
 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
696 696
 # by doxygen. The layout file controls the global structure of the generated
@@ -703,7 +703,7 @@ FILE_VERSION_FILTER    =
703 703
 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
704 704
 # tag is left empty.
705 705
 
706
-LAYOUT_FILE            = 
706
+LAYOUT_FILE            =
707 707
 
708 708
 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
709 709
 # the reference definitions. This must be a list of .bib files. The .bib
@@ -713,7 +713,7 @@ LAYOUT_FILE            =
713 713
 # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
714 714
 # search path. See also \cite for info how to create references.
715 715
 
716
-CITE_BIB_FILES         = 
716
+CITE_BIB_FILES         =
717 717
 
718 718
 #---------------------------------------------------------------------------
719 719
 # Configuration options related to warning and progress messages
@@ -778,7 +778,7 @@ WARN_FORMAT            = "$file:$line: $text"
778 778
 # messages should be written. If left blank the output is written to standard
779 779
 # error (stderr).
780 780
 
781
-WARN_LOGFILE           = 
781
+WARN_LOGFILE           =
782 782
 
783 783
 #---------------------------------------------------------------------------
784 784
 # Configuration options related to the input files
@@ -873,7 +873,7 @@ RECURSIVE              = YES
873 873
 # Note that relative paths are relative to the directory from which doxygen is
874 874
 # run.
875 875
 
876
-EXCLUDE                = 
876
+EXCLUDE                =
877 877
 
878 878
 # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
879 879
 # directories that are symbolic links (a Unix file system feature) are excluded
@@ -889,7 +889,7 @@ EXCLUDE_SYMLINKS       = NO
889 889
 # Note that the wildcards are matched against the file with absolute path, so to
890 890
 # exclude all test directories for example use the pattern */test/*
891 891
 
892
-EXCLUDE_PATTERNS       = 
892
+EXCLUDE_PATTERNS       =
893 893
 
894 894
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
895 895
 # (namespaces, classes, functions, etc.) that should be excluded from the
@@ -900,13 +900,13 @@ EXCLUDE_PATTERNS       =
900 900
 # Note that the wildcards are matched against the file with absolute path, so to
901 901
 # exclude all test directories use the pattern */test/*
902 902
 
903
-EXCLUDE_SYMBOLS        = 
903
+EXCLUDE_SYMBOLS        =
904 904
 
905 905
 # The EXAMPLE_PATH tag can be used to specify one or more files or directories
906 906
 # that contain example code fragments that are included (see the \include
907 907
 # command).
908 908
 
909
-EXAMPLE_PATH           = 
909
+EXAMPLE_PATH           =
910 910
 
911 911
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
912 912
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -926,7 +926,7 @@ EXAMPLE_RECURSIVE      = NO
926 926
 # that contain images that are to be included in the documentation (see the
927 927
 # \image command).
928 928
 
929
-IMAGE_PATH             = 
929
+IMAGE_PATH             =
930 930
 
931 931
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
932 932
 # invoke to filter for each input file. Doxygen will invoke the filter program
@@ -947,7 +947,7 @@ IMAGE_PATH             =
947 947
 # need to set EXTENSION_MAPPING for the extension otherwise the files are not
948 948
 # properly processed by doxygen.
949 949
 
950
-INPUT_FILTER           = 
950
+INPUT_FILTER           =
951 951
 
952 952
 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
953 953
 # basis. Doxygen will compare the file name with each pattern and apply the
@@ -960,7 +960,7 @@ INPUT_FILTER           =
960 960
 # need to set EXTENSION_MAPPING for the extension otherwise the files are not
961 961
 # properly processed by doxygen.
962 962
 
963
-FILTER_PATTERNS        = 
963
+FILTER_PATTERNS        =
964 964
 
965 965
 # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
966 966
 # INPUT_FILTER) will also be used to filter the input files that are used for
@@ -975,14 +975,14 @@ FILTER_SOURCE_FILES    = NO
975 975
 # *.ext= (so without naming a filter).
976 976
 # This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
977 977
 
978
-FILTER_SOURCE_PATTERNS = 
978
+FILTER_SOURCE_PATTERNS =
979 979
 
980 980
 # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
981 981
 # is part of the input, its contents will be placed on the main page
982 982
 # (index.html). This can be useful if you have a project on for instance GitHub
983 983
 # and want to reuse the introduction page also for the doxygen output.
984 984
 
985
-USE_MDFILE_AS_MAINPAGE = 
985
+USE_MDFILE_AS_MAINPAGE =
986 986
 
987 987
 #---------------------------------------------------------------------------
988 988
 # Configuration options related to source browsing
@@ -1087,7 +1087,7 @@ CLANG_ASSISTED_PARSING = NO
1087 1087
 # specified with INPUT and INCLUDE_PATH.
1088 1088
 # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
1089 1089
 
1090
-CLANG_OPTIONS          = 
1090
+CLANG_OPTIONS          =
1091 1091
 
1092 1092
 #---------------------------------------------------------------------------
1093 1093
 # Configuration options related to the alphabetical class index
@@ -1113,7 +1113,7 @@ COLS_IN_ALPHA_INDEX    = 5
1113 1113
 # while generating the index headers.
1114 1114
 # This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
1115 1115
 
1116
-IGNORE_PREFIX          = 
1116
+IGNORE_PREFIX          =
1117 1117
 
1118 1118
 #---------------------------------------------------------------------------
1119 1119
 # Configuration options related to the HTML output
@@ -1157,7 +1157,7 @@ HTML_FILE_EXTENSION    = .html
1157 1157
 # of the possible markers and block names see the documentation.
1158 1158
 # This tag requires that the tag GENERATE_HTML is set to YES.
1159 1159
 
1160
-HTML_HEADER            = 
1160
+HTML_HEADER            =
1161 1161
 
1162 1162
 # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
1163 1163
 # generated HTML page. If the tag is left blank doxygen will generate a standard
@@ -1167,7 +1167,7 @@ HTML_HEADER            =
1167 1167
 # that doxygen normally uses.
1168 1168
 # This tag requires that the tag GENERATE_HTML is set to YES.
1169 1169
 
1170
-HTML_FOOTER            = 
1170
+HTML_FOOTER            =
1171 1171
 
1172 1172
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
1173 1173
 # sheet that is used by each HTML page. It can be used to fine-tune the look of
@@ -1179,7 +1179,7 @@ HTML_FOOTER            =
1179 1179
 # obsolete.
1180 1180
 # This tag requires that the tag GENERATE_HTML is set to YES.
1181 1181
 
1182
-HTML_STYLESHEET        = 
1182
+HTML_STYLESHEET        =
1183 1183
 
1184 1184
 # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
1185 1185
 # cascading style sheets that are included after the standard style sheets
@@ -1192,7 +1192,7 @@ HTML_STYLESHEET        =
1192 1192
 # list). For an example see the documentation.
1193 1193
 # This tag requires that the tag GENERATE_HTML is set to YES.
1194 1194
 
1195
-HTML_EXTRA_STYLESHEET  = 
1195
+HTML_EXTRA_STYLESHEET  =
1196 1196
 
1197 1197
 # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
1198 1198
 # other source files which should be copied to the HTML output directory. Note
@@ -1202,7 +1202,7 @@ HTML_EXTRA_STYLESHEET  =
1202 1202
 # files will be copied as-is; there are no commands or markers available.
1203 1203
 # This tag requires that the tag GENERATE_HTML is set to YES.
1204 1204
 
1205
-HTML_EXTRA_FILES       = 
1205
+HTML_EXTRA_FILES       =
1206 1206
 
1207 1207
 # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
1208 1208
 # will adjust the colors in the style sheet and background images according to
@@ -1331,7 +1331,7 @@ GENERATE_HTMLHELP      = NO
1331 1331
 # written to the html output directory.
1332 1332
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1333 1333
 
1334
-CHM_FILE               = 
1334
+CHM_FILE               =
1335 1335
 
1336 1336
 # The HHC_LOCATION tag can be used to specify the location (absolute path
1337 1337
 # including file name) of the HTML help compiler (hhc.exe). If non-empty,
@@ -1339,7 +1339,7 @@ CHM_FILE               =
1339 1339
 # The file has to be specified with full path.
1340 1340
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1341 1341
 
1342
-HHC_LOCATION           = 
1342
+HHC_LOCATION           =
1343 1343
 
1344 1344
 # The GENERATE_CHI flag controls if a separate .chi index file is generated
1345 1345
 # (YES) or that it should be included in the master .chm file (NO).
@@ -1352,7 +1352,7 @@ GENERATE_CHI           = NO
1352 1352
 # and project file content.
1353 1353
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1354 1354
 
1355
-CHM_INDEX_ENCODING     = 
1355
+CHM_INDEX_ENCODING     =
1356 1356
 
1357 1357
 # The BINARY_TOC flag controls whether a binary table of contents is generated
1358 1358
 # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
@@ -1383,7 +1383,7 @@ GENERATE_QHP           = NO
1383 1383
 # the HTML output folder.
1384 1384
 # This tag requires that the tag GENERATE_QHP is set to YES.
1385 1385
 
1386
-QCH_FILE               = 
1386
+QCH_FILE               =
1387 1387
 
1388 1388
 # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
1389 1389
 # Project output. For more information please see Qt Help Project / Namespace
@@ -1408,7 +1408,7 @@ QHP_VIRTUAL_FOLDER     = doc
1408 1408
 # filters).
1409 1409
 # This tag requires that the tag GENERATE_QHP is set to YES.
1410 1410
 
1411
-QHP_CUST_FILTER_NAME   = 
1411
+QHP_CUST_FILTER_NAME   =
1412 1412
 
1413 1413
 # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
1414 1414
 # custom filter to add. For more information please see Qt Help Project / Custom
@@ -1416,21 +1416,21 @@ QHP_CUST_FILTER_NAME   =
1416 1416
 # filters).
1417 1417
 # This tag requires that the tag GENERATE_QHP is set to YES.
1418 1418
 
1419
-QHP_CUST_FILTER_ATTRS  = 
1419
+QHP_CUST_FILTER_ATTRS  =
1420 1420
 
1421 1421
 # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
1422 1422
 # project's filter section matches. Qt Help Project / Filter Attributes (see:
1423 1423
 # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
1424 1424
 # This tag requires that the tag GENERATE_QHP is set to YES.
1425 1425
 
1426
-QHP_SECT_FILTER_ATTRS  = 
1426
+QHP_SECT_FILTER_ATTRS  =
1427 1427
 
1428 1428
 # The QHG_LOCATION tag can be used to specify the location of Qt's
1429 1429
 # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
1430 1430
 # generated .qhp file.
1431 1431
 # This tag requires that the tag GENERATE_QHP is set to YES.
1432 1432
 
1433
-QHG_LOCATION           = 
1433
+QHG_LOCATION           =
1434 1434
 
1435 1435
 # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
1436 1436
 # generated, together with the HTML files, they form an Eclipse help plugin. To
@@ -1533,7 +1533,7 @@ FORMULA_TRANSPARENT    = YES
1533 1533
 # The default value is: NO.
1534 1534
 # This tag requires that the tag GENERATE_HTML is set to YES.
1535 1535
 
1536
-USE_MATHJAX            = NO
1536
+USE_MATHJAX            = YES
1537 1537
 
1538 1538
 # When MathJax is enabled you can set the default output format to be used for
1539 1539
 # the MathJax output. See the MathJax site (see:
@@ -1563,7 +1563,7 @@ MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
1563 1563
 # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
1564 1564
 # This tag requires that the tag USE_MATHJAX is set to YES.
1565 1565
 
1566
-MATHJAX_EXTENSIONS     = 
1566
+MATHJAX_EXTENSIONS     =
1567 1567
 
1568 1568
 # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
1569 1569
 # of code that will be used on startup of the MathJax code. See the MathJax site
@@ -1571,7 +1571,7 @@ MATHJAX_EXTENSIONS     =
1571 1571
 # example see the documentation.
1572 1572
 # This tag requires that the tag USE_MATHJAX is set to YES.
1573 1573
 
1574
-MATHJAX_CODEFILE       = 
1574
+MATHJAX_CODEFILE       =
1575 1575
 
1576 1576
 # When the SEARCHENGINE tag is enabled doxygen will generate a search box for
1577 1577
 # the HTML output. The underlying search engine uses javascript and DHTML and
@@ -1631,7 +1631,7 @@ EXTERNAL_SEARCH        = NO
1631 1631
 # Searching" for details.
1632 1632
 # This tag requires that the tag SEARCHENGINE is set to YES.
1633 1633
 
1634
-SEARCHENGINE_URL       = 
1634
+SEARCHENGINE_URL       =
1635 1635
 
1636 1636
 # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
1637 1637
 # search data is written to a file for indexing by an external tool. With the
@@ -1647,7 +1647,7 @@ SEARCHDATA_FILE        = searchdata.xml
1647 1647
 # projects and redirect the results back to the right project.
1648 1648
 # This tag requires that the tag SEARCHENGINE is set to YES.
1649 1649
 
1650
-EXTERNAL_SEARCH_ID     = 
1650
+EXTERNAL_SEARCH_ID     =
1651 1651
 
1652 1652
 # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
1653 1653
 # projects other than the one defined by this configuration file, but that are
@@ -1657,7 +1657,7 @@ EXTERNAL_SEARCH_ID     =
1657 1657
 # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
1658 1658
 # This tag requires that the tag SEARCHENGINE is set to YES.
1659 1659
 
1660
-EXTRA_SEARCH_MAPPINGS  = 
1660
+EXTRA_SEARCH_MAPPINGS  =
1661 1661
 
1662 1662
 #---------------------------------------------------------------------------
1663 1663
 # Configuration options related to the LaTeX output
@@ -1721,7 +1721,7 @@ PAPER_TYPE             = a4
1721 1721
 # If left blank no extra packages will be included.
1722 1722
 # This tag requires that the tag GENERATE_LATEX is set to YES.
1723 1723
 
1724
-EXTRA_PACKAGES         = 
1724
+EXTRA_PACKAGES         =
1725 1725
 
1726 1726
 # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
1727 1727
 # generated LaTeX document. The header should contain everything until the first
@@ -1737,7 +1737,7 @@ EXTRA_PACKAGES         =
1737 1737
 # to HTML_HEADER.
1738 1738
 # This tag requires that the tag GENERATE_LATEX is set to YES.
1739 1739
 
1740
-LATEX_HEADER           = 
1740
+LATEX_HEADER           =
1741 1741
 
1742 1742
 # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
1743 1743
 # generated LaTeX document. The footer should contain everything after the last
@@ -1748,7 +1748,7 @@ LATEX_HEADER           =
1748 1748
 # Note: Only use a user-defined footer if you know what you are doing!
1749 1749
 # This tag requires that the tag GENERATE_LATEX is set to YES.
1750 1750
 
1751
-LATEX_FOOTER           = 
1751
+LATEX_FOOTER           =
1752 1752
 
1753 1753
 # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
1754 1754
 # LaTeX style sheets that are included after the standard style sheets created
@@ -1759,7 +1759,7 @@ LATEX_FOOTER           =
1759 1759
 # list).
1760 1760
 # This tag requires that the tag GENERATE_LATEX is set to YES.
1761 1761
 
1762
-LATEX_EXTRA_STYLESHEET = 
1762
+LATEX_EXTRA_STYLESHEET =
1763 1763
 
1764 1764
 # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
1765 1765
 # other source files which should be copied to the LATEX_OUTPUT output
@@ -1767,7 +1767,7 @@ LATEX_EXTRA_STYLESHEET =
1767 1767
 # markers available.
1768 1768
 # This tag requires that the tag GENERATE_LATEX is set to YES.
1769 1769
 
1770
-LATEX_EXTRA_FILES      = 
1770
+LATEX_EXTRA_FILES      =
1771 1771
 
1772 1772
 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
1773 1773
 # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
@@ -1875,14 +1875,14 @@ RTF_HYPERLINKS         = NO
1875 1875
 # default style sheet that doxygen normally uses.
1876 1876
 # This tag requires that the tag GENERATE_RTF is set to YES.
1877 1877
 
1878
-RTF_STYLESHEET_FILE    = 
1878
+RTF_STYLESHEET_FILE    =
1879 1879
 
1880 1880
 # Set optional variables used in the generation of an RTF document. Syntax is
1881 1881
 # similar to doxygen's config file. A template extensions file can be generated
1882 1882
 # using doxygen -e rtf extensionFile.
1883 1883
 # This tag requires that the tag GENERATE_RTF is set to YES.
1884 1884
 
1885
-RTF_EXTENSIONS_FILE    = 
1885
+RTF_EXTENSIONS_FILE    =
1886 1886
 
1887 1887
 # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
1888 1888
 # with syntax highlighting in the RTF output.
@@ -1927,7 +1927,7 @@ MAN_EXTENSION          = .3
1927 1927
 # MAN_EXTENSION with the initial . removed.
1928 1928
 # This tag requires that the tag GENERATE_MAN is set to YES.
1929 1929
 
1930
-MAN_SUBDIR             = 
1930
+MAN_SUBDIR             =
1931 1931
 
1932 1932
 # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
1933 1933
 # will generate one additional man file for each entity documented in the real
@@ -2040,7 +2040,7 @@ PERLMOD_PRETTY         = YES
2040 2040
 # overwrite each other's variables.
2041 2041
 # This tag requires that the tag GENERATE_PERLMOD is set to YES.
2042 2042
 
2043
-PERLMOD_MAKEVAR_PREFIX = 
2043
+PERLMOD_MAKEVAR_PREFIX =
2044 2044
 
2045 2045
 #---------------------------------------------------------------------------
2046 2046
 # Configuration options related to the preprocessor
@@ -2081,7 +2081,7 @@ SEARCH_INCLUDES        = YES
2081 2081
 # preprocessor.
2082 2082
 # This tag requires that the tag SEARCH_INCLUDES is set to YES.
2083 2083
 
2084
-INCLUDE_PATH           = 
2084
+INCLUDE_PATH           =
2085 2085
 
2086 2086
 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
2087 2087
 # patterns (like *.h and *.hpp) to filter out the header-files in the
@@ -2089,7 +2089,7 @@ INCLUDE_PATH           =
2089 2089
 # used.
2090 2090
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2091 2091
 
2092
-INCLUDE_FILE_PATTERNS  = 
2092
+INCLUDE_FILE_PATTERNS  =
2093 2093
 
2094 2094
 # The PREDEFINED tag can be used to specify one or more macro names that are
2095 2095
 # defined before the preprocessor is started (similar to the -D option of e.g.
@@ -2099,7 +2099,7 @@ INCLUDE_FILE_PATTERNS  =
2099 2099
 # recursively expanded use the := operator instead of the = operator.
2100 2100
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2101 2101
 
2102
-PREDEFINED             = 
2102
+PREDEFINED             =
2103 2103
 
2104 2104
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
2105 2105
 # tag can be used to specify a list of macro names that should be expanded. The
@@ -2108,7 +2108,7 @@ PREDEFINED             =
2108 2108
 # definition found in the source code.
2109 2109
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
2110 2110
 
2111
-EXPAND_AS_DEFINED      = 
2111
+EXPAND_AS_DEFINED      =
2112 2112
 
2113 2113
 # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
2114 2114
 # remove all references to function-like macros that are alone on a line, have
@@ -2137,13 +2137,13 @@ SKIP_FUNCTION_MACROS   = YES
2137 2137
 # the path). If a tag file is not located in the directory in which doxygen is
2138 2138
 # run, you must also specify the path to the tagfile here.
2139 2139
 
2140
-TAGFILES               = 
2140
+TAGFILES               =
2141 2141
 
2142 2142
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create a
2143 2143
 # tag file that is based on the input files it reads. See section "Linking to
2144 2144
 # external documentation" for more information about the usage of tag files.
2145 2145
 
2146
-GENERATE_TAGFILE       = 
2146
+GENERATE_TAGFILE       =
2147 2147
 
2148 2148
 # If the ALLEXTERNALS tag is set to YES, all external class will be listed in
2149 2149
 # the class index. If set to NO, only the inherited external classes will be
@@ -2192,14 +2192,14 @@ CLASS_DIAGRAMS         = YES
2192 2192
 # the mscgen tool resides. If left empty the tool is assumed to be found in the
2193 2193
 # default search path.
2194 2194
 
2195
-MSCGEN_PATH            = 
2195
+MSCGEN_PATH            =
2196 2196
 
2197 2197
 # You can include diagrams made with dia in doxygen documentation. Doxygen will
2198 2198
 # then run dia to produce the diagram and insert it in the documentation. The
2199 2199
 # DIA_PATH tag allows you to specify the directory where the dia binary resides.
2200 2200
 # If left empty dia is assumed to be found in the default search path.
2201 2201
 
2202
-DIA_PATH               = 
2202
+DIA_PATH               =
2203 2203
 
2204 2204
 # If set to YES the inheritance and collaboration graphs will hide inheritance
2205 2205
 # and usage relations if the target is undocumented or is not a class.
@@ -2248,7 +2248,7 @@ DOT_FONTSIZE           = 10
2248 2248
 # the path where dot can find it using this tag.
2249 2249
 # This tag requires that the tag HAVE_DOT is set to YES.
2250 2250
 
2251
-DOT_FONTPATH           = 
2251
+DOT_FONTPATH           =
2252 2252
 
2253 2253
 # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
2254 2254
 # each documented class showing the direct and indirect inheritance relations.
@@ -2392,26 +2392,26 @@ INTERACTIVE_SVG        = NO
2392 2392
 # found. If left blank, it is assumed the dot tool can be found in the path.
2393 2393
 # This tag requires that the tag HAVE_DOT is set to YES.
2394 2394
 
2395
-DOT_PATH               = 
2395
+DOT_PATH               =
2396 2396
 
2397 2397
 # The DOTFILE_DIRS tag can be used to specify one or more directories that
2398 2398
 # contain dot files that are included in the documentation (see the \dotfile
2399 2399
 # command).
2400 2400
 # This tag requires that the tag HAVE_DOT is set to YES.
2401 2401
 
2402
-DOTFILE_DIRS           = 
2402
+DOTFILE_DIRS           =
2403 2403
 
2404 2404
 # The MSCFILE_DIRS tag can be used to specify one or more directories that
2405 2405
 # contain msc files that are included in the documentation (see the \mscfile
2406 2406
 # command).
2407 2407
 
2408
-MSCFILE_DIRS           = 
2408
+MSCFILE_DIRS           =
2409 2409
 
2410 2410
 # The DIAFILE_DIRS tag can be used to specify one or more directories that
2411 2411
 # contain dia files that are included in the documentation (see the \diafile
2412 2412
 # command).
2413 2413
 
2414
-DIAFILE_DIRS           = 
2414
+DIAFILE_DIRS           =
2415 2415
 
2416 2416
 # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
2417 2417
 # path where java can find the plantuml.jar file. If left blank, it is assumed
@@ -2419,17 +2419,17 @@ DIAFILE_DIRS           =
2419 2419
 # generate a warning when it encounters a \startuml command in this case and
2420 2420
 # will not generate output for the diagram.
2421 2421
 
2422
-PLANTUML_JAR_PATH      = 
2422
+PLANTUML_JAR_PATH      =
2423 2423
 
2424 2424
 # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
2425 2425
 # configuration file for plantuml.
2426 2426
 
2427
-PLANTUML_CFG_FILE      = 
2427
+PLANTUML_CFG_FILE      =
2428 2428
 
2429 2429
 # When using plantuml, the specified paths are searched for files specified by
2430 2430
 # the !include statement in a plantuml block.
2431 2431
 
2432
-PLANTUML_INCLUDE_PATH  = 
2432
+PLANTUML_INCLUDE_PATH  =
2433 2433
 
2434 2434
 # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
2435 2435
 # that will be shown in the graph. If the number of nodes in a graph becomes

+ 125
- 0
ABACUS_Usage_Example_Heis.cc View File

@@ -0,0 +1,125 @@
1
+/**********************************************************
2
+
3
+This software is part of J.-S. Caux's ABACUS++ library.
4
+
5
+Copyright (c) J.-S. Caux
6
+
7
+-----------------------------------------------------------
8
+
9
+File:  ABACUS+_Usage_Example_Heis.cc
10
+
11
+Purpose:  illustrates basic use of ABACUS for spin chains.
12
+
13
+***********************************************************/
14
+
15
+#include "ABACUS.h"
16
+
17
+using namespace std;
18
+using namespace JSC;
19
+
20
+
21
+int main()
22
+{
23
+  clock_t StartTime = clock();
24
+
25
+  // Refer to include/JSC_Heis.h for all class definitions
26
+  // and to src/HEIS/ for the actual implementations.
27
+
28
+  // Set basic system parameters:
29
+  DP Delta = 1.0; // anisotropy
30
+  int N = 64; // chain length
31
+  int M = 32; // number of downturned spins as compared to all spins up; must be <= N/2 (on or above equator)
32
+
33
+  // Define the chain:  J, Delta, h, Nsites
34
+  Heis_Chain chain(1.0, Delta, 0.0, N);
35
+
36
+  // The Heis_Chain class so constructed contains information about all types of strings:
37
+  cout << "Delta = " << Delta << endl << "Possible string lengths and parities: ";
38
+  for (int j = 0; j < chain.Nstrings; ++j) cout << "(" << chain.Str_L[j] << ", " << chain.par[j] << ")" << "\t";
39
+  cout << endl;
40
+
41
+
42
+  // Constructing a Bethe state: start with the ground state for simplicity.
43
+  // Define the base:  chain, Mdown
44
+  // A base by definition represents a partition of the M down spins into different strings.
45
+  Heis_Base gbase(chain, M); // This puts all the M down spins into one-strings.
46
+
47
+  // Define the ground state
48
+  //XXZ_Bethe_State gstate(chain, gbase);  // Use this constructor for 0 < Delta < 1
49
+  XXX_Bethe_State gstate(chain, gbase); // Use this constructor for Delta == 1
50
+  //XXZ_gpd_Bethe_State gstate(chain, gbase); // Use this constructor for Delta > 1.
51
+  // Anisotropies Delta < 0 are not separately implemented.
52
+
53
+  // The assignment operator is overloaded for Bethe states:
54
+  XXX_Bethe_State gstate2 = gstate; // copies all data of gstate into new object gstate2
55
+
56
+
57
+  // Compute everything about the ground state
58
+  gstate.Compute_All(true);
59
+
60
+  // Output information about the state
61
+  cout << gstate << endl;
62
+
63
+
64
+  // Now define some excited state.
65
+
66
+  // First method:
67
+  // Start with defining a base using a base constructor with a vector of numbers of rapidities of each type as argument:
68
+  // First define Nrapidities vector:
69
+  Vect<int> Nrapidities(0, chain.Nstrings);
70
+  // Assigning the numbers that follow, you have to ensure (yourself!) the \sum_j M_j n_j = M (where n_j is the length of type j).
71
+  Nrapidities[0] = M-2; // number of one-strings
72
+  Nrapidities[1] = 1; // one two-string
73
+  // Define the base:
74
+  Heis_Base ebase(chain, Nrapidities);
75
+  // Once the base is defined, the limiting quantum numbers are automatically computed:
76
+  cout << "ebase defined, data is (Mdown, Nrap, Nraptot, Ix2_infty, Ix2_min, Ix2_max, baselabel):"
77
+       << ebase.Mdown << endl << ebase.Nrap << endl << ebase.Nraptot << endl << ebase.Ix2_infty << endl
78
+       << ebase.Ix2_min << endl << ebase.Ix2_max << endl << ebase.baselabel << endl;
79
+
80
+  // An excited state can then be defined using this new base:
81
+  XXX_Bethe_State estate(chain, ebase);
82
+  // Individual quantum numbers can be manipulated: this will NOT update the state label or verify range of Ix2
83
+  estate.Ix2[0][0] = M+1;
84
+  estate.Compute_All(true);
85
+  cout << endl << "estate: " << estate << endl;
86
+
87
+
88
+  // Second method of constructing a base:
89
+  Heis_Base ebase2(chain, "31");  // This is another constructor for all rapidities in one-strings
90
+  //Heis_Base ebase(chain, "29x1y1"); // one two-string (XXX)
91
+
92
+
93
+  // Construct a new Bethe state
94
+  XXX_Bethe_State estateref (chain, ebase2); // this will contain the lowest-energy quantum numbers for this base
95
+  XXX_Bethe_State estate2 (chain, ebase2); // yet another state
96
+
97
+  // Setting a state to a given label:
98
+  estate2.Set_to_Label ("31_1_nh", estateref.Ix2); // The base of estate must coincide with the base in the label. Label is relative to estateref.Ix2
99
+  estate2.Compute_All(true);
100
+  cout << "estate2: " << estate2 << endl;
101
+
102
+  // Energy and momentum of the states:
103
+  cout << "Energy and momentum of states:" << endl;
104
+  cout << "gstate.E = " << gstate.E << "\testate.E = " << estate.E << endl;
105
+  cout << "Excitation energy = estate.E - gstate.E = " << estate.E - gstate.E << endl;
106
+  cout << "Excitation momentum (mod 2 pi) = estate.K - gstate.K = " << estate.K - gstate.K << endl;
107
+
108
+
109
+  // Computing matrix elements: CAREFUL: magnetizations must be consistent with operator (error is flagged).
110
+  cout << "Matrix elements: " << endl;
111
+  // The logarithm of the matrix elements are computed as complex numbers:
112
+  cout << "ln_Sz (gstate, estate) = " << ln_Sz_ME (gstate, estate) << endl;
113
+
114
+  // The other possible matrix element call is for the Smin matrix element,
115
+  cout << "ln_Smin (gstate, estate2) = " << ln_Smin_ME (gstate, estate2) << endl;
116
+
117
+
118
+  clock_t StopTime = clock();
119
+
120
+  //cout << "Total time: " << (StopTime - StartTime)/*/CLOCKS_PER_SEC*/ << " hundreths of a second."
121
+  cout << "Total time: " << DP(StopTime - StartTime)/CLOCKS_PER_SEC << " seconds."
122
+       << endl;
123
+
124
+  return(0);
125
+}

+ 108
- 0
ABACUS_Usage_Example_LiebLin.cc View File

@@ -0,0 +1,108 @@
1
+/**********************************************************
2
+
3
+This software is part of J.-S. Caux's ABACUS library.
4
+
5
+Copyright (c) J.-S. Caux.
6
+
7
+-----------------------------------------------------------
8
+
9
+File:  ABACUS_Usage_Example_LiebLin.cc
10
+
11
+Purpose:  examples of calculations for Lieb-Liniger
12
+
13
+***********************************************************/
14
+
15
+#include "ABACUS.h"
16
+
17
+using namespace std;
18
+using namespace ABACUS;
19
+
20
+
21
+int main()
22
+{
23
+  clock_t StartTime = clock();
24
+
25
+  DP c_int = 2.0;
26
+  DP L = 3.0;
27
+  int N = 3;
28
+  DP nbar_required = 1.0;
29
+  DP kBT = 4.0;
30
+  int Npts = 4*N;
31
+  DP req_diff = 1.0e-4;
32
+  int Max_Secs = 60;
33
+
34
+
35
+  if (true) { // State-by-state checks
36
+
37
+    DP c_int = 4.0;
38
+    DP L = 16.0;
39
+    int N = 16;
40
+
41
+    LiebLin_Bethe_State gstate (c_int, L, N);
42
+    gstate.Compute_All(true);
43
+    cout << setprecision(16) << gstate << endl;
44
+
45
+    LiebLin_Bethe_State estate (c_int, L, N-1);
46
+    //estate.Set_to_ids (1LL, 1LL, 2LL, 0LL);
47
+    //estate.Set_to_Label ("64_2_028ysn1", gstate.Ix2);
48
+    //for (int i = 0; i < N; ++i) estate.Ix2[i] += 2;
49
+    // estate.Ix2[0] -= 8;
50
+    // estate.Ix2[1] -= 4;
51
+    // estate.Ix2[N-3] += 2;
52
+    // estate.Ix2[N-2] += 4;
53
+    // estate.Ix2[N-1] += 6;
54
+    // estate.Set_Label_from_Ix2(gstate.Ix2);
55
+    estate.Compute_All(true);
56
+    cout << setprecision(16) << estate << endl;
57
+
58
+    //Scan_LiebLin ('o', estate, "28_3_i3y55yf3", -2*N, 2*N, 60, 1.0e+6, 0, 0, 1);
59
+    //stringstream filenameprefix;
60
+    //Data_File_Name (filenameprefix, 'd', -2*N, 2*N, 0.0, estate, estate, "28_3_i3y55yf3");
61
+    //string prefix = filenameprefix.str();
62
+
63
+    DP ommin = 0.0; DP ommax = 10.0; DP gwidth = 1.0;// meaningless
64
+    int Nom = 10;
65
+    DP normalization = twoPI * L;
66
+
67
+    //Smoothen_RAW_into_SF (filenameprefix.str(), -2*N, 2*N, 0, ommin, ommax, Nom, gwidth, normalization, L);
68
+
69
+    //Density-density matrix elements:
70
+    // cout << setprecision(16) << "omega = " << estate.E - gstate.E << "\t"
71
+    // 	 << exp(real(ln_Density_ME(gstate, estate))) << "\t" << exp(real(ln_Density_ME(estate, gstate))) << endl;
72
+
73
+    //Field operator matrix elements:
74
+    cout << "omega\tiK\t< estate | Psi | gstate > matrix element:" << endl;
75
+    cout << setprecision(16) << estate.E - gstate.E << "\t" << estate.iK - gstate.iK << "\t"
76
+	 << exp(ln_Psi_ME(estate, gstate)) << endl;
77
+
78
+    //LiebLin_Bethe_State flipstate = estate;
79
+    //flipstate.Parity_Flip();
80
+    //cout << "Flipping: " << endl;
81
+    //cout << "omega = " << flipstate.E - gstate.E << "\t" << exp(real(ln_Density_ME(gstate, flipstate))) << endl;
82
+
83
+    // Finite T checks:
84
+    DP kBT = 1.0;
85
+
86
+    // Delta is the number of sites involved in the smoothing of the entropy
87
+    //int Delta = int(sqrt(N))/2;//6;//N/20;
88
+    //DP epsilon = log(L)/L;
89
+    DP epsilon = log(L)/L;
90
+
91
+    // Construct the finite-size saddle-point state:
92
+    //LiebLin_Bethe_State spstate = Canonical_Saddle_Point_State (c_int, L, N, kBT, Delta);
93
+    //LiebLin_Bethe_State spstate = Canonical_Saddle_Point_State (c_int, L, N, kBT, epsilon);
94
+    //spstate.Compute_All(true);
95
+
96
+    //cout << spstate << endl;
97
+
98
+  }
99
+
100
+
101
+  clock_t StopTime = clock();
102
+
103
+  //cout << "Total time: " << (StopTime - StartTime)/*/CLOCKS_PER_SEC*/ << " hundreths of a second."
104
+  cout << "Total time: " << DP(StopTime - StartTime)/CLOCKS_PER_SEC << " seconds."
105
+       << endl;
106
+
107
+  return(0);
108
+}

+ 31
- 10
include/ABACUS_LiebLin.h View File

@@ -29,6 +29,14 @@ namespace ABACUS {
29 29
 
30 30
   //***********************************************************************
31 31
 
32
+  /**
33
+     Eigenstates of the Lieb-Liniger model in the repulsive \f$(c > 0)\f$ regime.
34
+
35
+     For numerical convenience, rapidities are rescaled by the interaction parameter \f$c\f$.
36
+     In equations throughout this documentation, \f$\tilde{\lambda} \equiv \lambda/c\f$.
37
+     In the code, these rescaled rapidities are denoted `lambdaoc` (read: "lambda over c").
38
+   */
39
+
32 40
   class LiebLin_Bethe_State {
33 41
 
34 42
   public:
@@ -104,7 +112,8 @@ namespace ABACUS {
104 112
   };
105 113
 
106 114
   inline bool Is_Inner_Skeleton (LiebLin_Bethe_State& State) {
107
-    return (State.N >= 2 && (State.Ix2[0] == State.Ix2[1] - 2 || State.Ix2[State.N-1] == State.Ix2[State.N-2] + 2));
115
+    return (State.N >= 2 && (State.Ix2[0] == State.Ix2[1] - 2
116
+			     || State.Ix2[State.N-1] == State.Ix2[State.N-2] + 2));
108 117
   };
109 118
   inline bool Is_Outer_Skeleton (LiebLin_Bethe_State& State) {
110 119
     return (State.N >= 2 && State.Ix2[0] == LIEBLIN_Ix2_MIN + (State.N % 2) + 1
@@ -115,12 +124,14 @@ namespace ABACUS {
115 124
 	    && State.Ix2[State.N-1] == LIEBLIN_Ix2_MAX - (State.N % 2) - 1);
116 125
   };
117 126
 
118
-  inline bool Force_Descent (char whichDSF, LiebLin_Bethe_State& ScanState, LiebLin_Bethe_State& RefState,
127
+  inline bool Force_Descent (char whichDSF, LiebLin_Bethe_State& ScanState,
128
+			     LiebLin_Bethe_State& RefState,
119 129
 			     int desc_type_required, int iKmod, DP Chem_Pot)
120 130
   {
121 131
     bool forcedesc = false;
122 132
 
123
-    // Force descent if we're computing density-density, we're at zero momentum and we're descending with momentum preserved:
133
+    // Force descent if we're computing density-density, we're at zero momentum
134
+    // and we're descending with momentum preserved:
124 135
     if (whichDSF == 'd' && ScanState.iK == RefState.iK && desc_type_required > 8) forcedesc = true;
125 136
 
126 137
     // For BEC to c > 0 quench, g2(x=0): force first step
@@ -135,7 +146,8 @@ namespace ABACUS {
135 146
   // FUNCTION DECLARATIONS:
136 147
 
137 148
   DP Chemical_Potential (LiebLin_Bethe_State& RefState);
138
-  DP Sumrule_Factor (char whichDSF, LiebLin_Bethe_State& RefState, DP Chem_Pot, int iKmin, int iKmax);
149
+  DP Sumrule_Factor (char whichDSF, LiebLin_Bethe_State& RefState, DP Chem_Pot,
150
+		     int iKmin, int iKmax);
139 151
   void Evaluate_F_Sumrule (char whichDSF, const LiebLin_Bethe_State& RefState, DP Chem_Pot,
140 152
 			   int iKmin, int iKmax, const char* RAW_Cstr, const char* FSR_Cstr);
141 153
   void Evaluate_F_Sumrule (std::string prefix, char whichDSF, const LiebLin_Bethe_State& RefState,
@@ -157,14 +169,23 @@ namespace ABACUS {
157 169
   std::complex<DP> ln_Psi_ME (LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate);
158 170
   std::complex<DP> ln_g2_ME (LiebLin_Bethe_State& mu, LiebLin_Bethe_State& lambda);
159 171
 
160
-  DP Compute_Matrix_Element_Contrib (char whichDSF, int iKmin, int iKmax, LiebLin_Bethe_State& LeftState,
161
-				     LiebLin_Bethe_State& RefState, DP Chem_Pot, std::stringstream& DAT_outfile);
172
+  DP Compute_Matrix_Element_Contrib (char whichDSF, int iKmin, int iKmax,
173
+				     LiebLin_Bethe_State& LeftState,
174
+				     LiebLin_Bethe_State& RefState, DP Chem_Pot,
175
+				     std::stringstream& DAT_outfile);
162 176
 
163 177
   DP LiebLin_Twisted_lnnorm (Vect<std::complex<DP> >& lambdaoc, double cxL);
164
-  std::complex<DP> LiebLin_Twisted_ln_Overlap (DP expbeta, Vect<DP> lstate_lambdaoc, DP lstate_lnnorm, LiebLin_Bethe_State& rstate);
165
-  std::complex<DP> LiebLin_Twisted_ln_Overlap (std::complex<DP> expbeta, Vect<std::complex<DP> > lstate_lambdaoc, DP lstate_lnnorm, LiebLin_Bethe_State& rstate);
166
-  std::complex<DP> LiebLin_ln_Overlap (Vect<DP> lstate_lambdaoc, DP lstate_lnnorm, LiebLin_Bethe_State& rstate);
167
-  std::complex<DP> LiebLin_ln_Overlap (Vect<std::complex<DP> > lstate_lambdaoc, DP lstate_lnnorm, LiebLin_Bethe_State& rstate);
178
+  std::complex<DP> LiebLin_Twisted_ln_Overlap (DP expbeta, Vect<DP> lstate_lambdaoc,
179
+					       DP lstate_lnnorm,
180
+					       LiebLin_Bethe_State& rstate);
181
+  std::complex<DP> LiebLin_Twisted_ln_Overlap (std::complex<DP> expbeta,
182
+					       Vect<std::complex<DP> > lstate_lambdaoc,
183
+					       DP lstate_lnnorm,
184
+					       LiebLin_Bethe_State& rstate);
185
+  std::complex<DP> LiebLin_ln_Overlap (Vect<DP> lstate_lambdaoc, DP lstate_lnnorm,
186
+				       LiebLin_Bethe_State& rstate);
187
+  std::complex<DP> LiebLin_ln_Overlap (Vect<std::complex<DP> > lstate_lambdaoc, DP lstate_lnnorm,
188
+				       LiebLin_Bethe_State& rstate);
168 189
 
169 190
   // In src/LiebLin_Tgt0.cc:
170 191
   DP Entropy (LiebLin_Bethe_State& RefState);

+ 131
- 41
src/LIEBLIN/LiebLin_Bethe_State.cc View File

@@ -24,18 +24,18 @@ namespace ABACUS {
24 24
 
25 25
   LiebLin_Bethe_State::LiebLin_Bethe_State ()
26 26
     : c_int (0.0), L(0.0), cxL(0.0), N(0),
27
-      Ix2_available(Vect<int>(0, 1)), index_first_hole_to_right (Vect<int>(0,1)), displacement (Vect<int>(0,1)),
28
-      Ix2(Vect<int>(0, 1)), lambdaoc(Vect<DP>(0.0, 1)),
29
-      S(Vect<DP>(0.0, 1)), dSdlambdaoc(Vect<DP>(0.0, 1)),
30
-      diffsq(0.0), prec(ITER_REQ_PREC_LIEBLIN), conv(0), iter_Newton(0), E(0.0), iK(0), K(0.0), lnnorm(-100.0)
27
+      Ix2_available(Vect<int>(0, 1)), index_first_hole_to_right (Vect<int>(0,1)),
28
+      displacement (Vect<int>(0,1)), Ix2(Vect<int>(0, 1)), lambdaoc(Vect<DP>(0.0, 1)),
29
+      S(Vect<DP>(0.0, 1)), dSdlambdaoc(Vect<DP>(0.0, 1)), diffsq(0.0), prec(ITER_REQ_PREC_LIEBLIN),
30
+      conv(0), iter_Newton(0), E(0.0), iK(0), K(0.0), lnnorm(-100.0)
31 31
   {
32 32
     stringstream Nout; Nout << N; label = Nout.str() + LABELSEP + ABACUScoding[0] + LABELSEP;
33 33
   }
34 34
 
35 35
   LiebLin_Bethe_State::LiebLin_Bethe_State (DP c_int_ref, DP L_ref, int N_ref)
36 36
     : c_int(c_int_ref), L(L_ref), cxL(c_int_ref * L_ref), N(N_ref),
37
-      Ix2_available(Vect<int>(0, 2)), index_first_hole_to_right (Vect<int>(0,N)), displacement (Vect<int>(0,N)),
38
-      Ix2(Vect<int>(0, N)), lambdaoc(Vect<DP>(0.0, N)),
37
+      Ix2_available(Vect<int>(0, 2)), index_first_hole_to_right (Vect<int>(0,N)),
38
+      displacement (Vect<int>(0,N)), Ix2(Vect<int>(0, N)), lambdaoc(Vect<DP>(0.0, N)),
39 39
       S(Vect<DP>(0.0, N)), dSdlambdaoc(Vect<DP>(0.0, N)),
40 40
       diffsq(0.0), prec(ABACUS::max(1.0, 1.0/(c_int * c_int)) * ITER_REQ_PREC_LIEBLIN),
41 41
       conv(0), iter_Newton(0), E(0.0), iK(0), K(0.0), lnnorm(-100.0)
@@ -93,7 +93,8 @@ namespace ABACUS {
93 93
     if (N != OriginStateIx2.size()) {
94 94
       cout << label_ref << endl;
95 95
       cout << labeldata.M << endl;
96
-      ABACUSerror("Trying to set an incorrect label on LiebLin_Bethe_State: N != OriginStateIx2.size().");
96
+      ABACUSerror("Trying to set an incorrect label on LiebLin_Bethe_State: "
97
+		  "N != OriginStateIx2.size().");
97 98
     }
98 99
 
99 100
     label = label_ref;
@@ -106,7 +107,8 @@ namespace ABACUS {
106 107
 
107 108
     // Now set the excitations:
108 109
     for (int iexc = 0; iexc < labeldata.nexc[0]; ++iexc)
109
-      for (int i = 0; i < N; ++i) if (Ix2[i] == labeldata.Ix2old[0][iexc]) Ix2[i] = labeldata.Ix2exc[0][iexc];
110
+      for (int i = 0; i < N; ++i)
111
+	if (Ix2[i] == labeldata.Ix2old[0][iexc]) Ix2[i] = labeldata.Ix2exc[0][iexc];
110 112
 
111 113
     // Now reorder the Ix2 to follow convention:
112 114
     Ix2.QuickSort();
@@ -143,10 +145,13 @@ namespace ABACUS {
143 145
     Ix2old_ref[0] = Vect<int>(ABACUS::max(nexc_ref[0],1));
144 146
     Ix2exc_ref[0] = Vect<int>(ABACUS::max(nexc_ref[0],1));
145 147
     int nexccheck = 0;
146
-    for (int i = 0; i < N; ++i) if (!OriginStateIx2.includes(Ix2[i])) Ix2exc_ref[0][nexccheck++] = Ix2[i];
147
-    if (nexccheck != nexc_ref[0]) ABACUSerror("Counting excitations wrong (1) in LiebLin_Bethe_State::Set_Label_from_Ix2");
148
+    for (int i = 0; i < N; ++i)
149
+      if (!OriginStateIx2.includes(Ix2[i])) Ix2exc_ref[0][nexccheck++] = Ix2[i];
150
+    if (nexccheck != nexc_ref[0])
151
+      ABACUSerror("Counting excitations wrong (1) in LiebLin_Bethe_State::Set_Label_from_Ix2");
148 152
     nexccheck = 0;
149
-    for (int i = 0; i < N; ++i) if (!Ix2.includes (OriginStateIx2[i])) Ix2old_ref[0][nexccheck++] = OriginStateIx2[i];
153
+    for (int i = 0; i < N; ++i)
154
+      if (!Ix2.includes (OriginStateIx2[i])) Ix2old_ref[0][nexccheck++] = OriginStateIx2[i];
150 155
     if (nexccheck != nexc_ref[0]) {
151 156
       cout << "nexc_ref[0] = " << nexc_ref[0] << "\tnexccheck = " << nexccheck << endl;
152 157
       cout << OriginStateIx2 << endl;
@@ -167,7 +172,8 @@ namespace ABACUS {
167 172
 
168 173
   void LiebLin_Bethe_State::Set_Label_Internals_from_Ix2 (const Vect<int>& OriginStateIx2)
169 174
   {
170
-    if (N != OriginStateIx2.size()) ABACUSerror("N != OriginStateIx2.size() in Set_Label_Internals_from_Ix2.");
175
+    if (N != OriginStateIx2.size())
176
+      ABACUSerror("N != OriginStateIx2.size() in Set_Label_Internals_from_Ix2.");
171 177
 
172 178
     Vect<int> OriginStateIx2ordered = OriginStateIx2;
173 179
     OriginStateIx2ordered.QuickSort();
@@ -207,7 +213,8 @@ namespace ABACUS {
207 213
     for (int j = 0; j < N; ++j) {
208 214
       int i = 0;
209 215
       while (Ix2_available[i] < OriginStateIx2ordered[j]) i++;
210
-      // We now have Ix2_available[i] == OriginStateIx2[j]. Shift all Ix2_available to the right of this by 2;
216
+      // We now have Ix2_available[i] == OriginStateIx2[j].
217
+      // Shift all Ix2_available to the right of this by 2;
211 218
       for (int i1 = i; i1 < navailable; ++i1) Ix2_available[i1] += 2;
212 219
       index_first_hole_to_right[j] = i;
213 220
     }
@@ -218,10 +225,12 @@ namespace ABACUS {
218 225
     // Set displacement vector from the Ix2:
219 226
     for (int j = 0; j < N; ++j) {
220 227
       if (Ix2[j] < OriginStateIx2ordered[j]) {
221
-	// Ix2[j] must be equal to some OriginState_Ix2_available[i] for i < OriginState_index_first_hole_to_right[j]
228
+	// Ix2[j] must be equal to some OriginState_Ix2_available[i]
229
+	// for i < OriginState_index_first_hole_to_right[j]
222 230
 	while (Ix2[j] != Ix2_available[index_first_hole_to_right[j] + displacement[j] ]) {
223 231
 	  if (index_first_hole_to_right[j] + displacement[j] == 0) {
224
-	    cout << label << endl << j << endl << OriginStateIx2 << endl << Ix2 << endl << Ix2_available
232
+	    cout << label << endl << j << endl << OriginStateIx2 << endl
233
+		 << Ix2 << endl << Ix2_available
225 234
 		 << endl << index_first_hole_to_right << endl << displacement << endl;
226 235
 	    ABACUSerror("Going down too far in Set_Label_Internals...");
227 236
 	  }
@@ -233,7 +242,8 @@ namespace ABACUS {
233 242
 	displacement[j] = 1; // start with this value to prevent segfault
234 243
 	while (Ix2[j] != Ix2_available[index_first_hole_to_right[j] - 1 + displacement[j] ]) {
235 244
 	  if (index_first_hole_to_right[j] + displacement[j] == Ix2_available.size() - 1) {
236
-	    cout << label << endl << j << endl << OriginStateIx2 << endl << Ix2 << endl << Ix2_available
245
+	    cout << label << endl << j << endl << OriginStateIx2 << endl
246
+		 << Ix2 << endl << Ix2_available
237 247
 		 << endl << index_first_hole_to_right << endl << displacement << endl;
238 248
 	    ABACUSerror("Going up too far in Set_Label_Internals...");
239 249
 	  }
@@ -245,7 +255,8 @@ namespace ABACUS {
245 255
 
246 256
   bool LiebLin_Bethe_State::Check_Admissibility (char whichDSF)
247 257
   {
248
-    //if (Ix2.min() < -13 || Ix2.max() > 13) return(false); // For testing with restricted Hilbert space
258
+    // For testing with restricted Hilbert space:
259
+    //if (Ix2.min() < -13 || Ix2.max() > 13) return(false);
249 260
     return(true);
250 261
   }
251 262
 
@@ -253,7 +264,8 @@ namespace ABACUS {
253 264
   {
254 265
     // This function finds the rapidities of the eigenstate
255 266
 
256
-    lnnorm = -100.0;  // sentinel value, recalculated if Newton method used in the last step of iteration.
267
+    // sentinel value, recalculated if Newton method used in the last step of iteration.
268
+    lnnorm = -100.0;
257 269
 
258 270
     diffsq = 1.0;
259 271
 
@@ -289,15 +301,20 @@ namespace ABACUS {
289 301
     return nonan;
290 302
   }
291 303
 
304
+  /**
305
+     For the repulsive Lieb-Liniger model, all eigenstates have real rapidities
306
+     (there are no strings). All string deviations are thus set to zero.
307
+   */
292 308
   DP LiebLin_Bethe_State::String_delta()
293 309
   {
294
-    return(0.0); // no strings (thus no deviations) in replusive LiebLin
310
+    return(0.0);
295 311
   }
296 312
 
313
+  /**
314
+     Checks whether the quantum numbers are symmetrically distributed: \f$\{ I \} = \{ -I \}\f$.
315
+  */
297 316
   bool LiebLin_Bethe_State::Check_Symmetry ()
298 317
   {
299
-    // Checks whether the I's are symmetrically distributed.
300
-
301 318
     bool symmetric_state = true;
302 319
 
303 320
     Vect<int> Ix2check = Ix2;
@@ -309,6 +326,18 @@ namespace ABACUS {
309 326
     return(symmetric_state);
310 327
   }
311 328
 
329
+  /**
330
+     This function computes the log of the norm of a `LiebLin_Bethe_State` instance.
331
+     This is obtained from the Gaudin-Korepin norm formula
332
+     \f{eqnarray*}{
333
+     \langle 0 | \prod_{j=0}^{N-1} C(\lambda_j) \prod_{j=0}^{N-1} B(\lambda_j) | 0 \rangle
334
+     = \prod_{j=0}^{N-2}\prod_{k=j+1}^{N-1}
335
+     \frac{(\lambda_j - \lambda_k )^2 + c^2}{(\lambda_j - \lambda_k)^2}
336
+     \times ~\mbox{Det}_N G
337
+     \f}
338
+     in which \f$G\f$ is the Gaudin matrix computed by
339
+     LiebLin_Bethe_State::Build_Reduced_Gaudin_Matrix.
340
+   */
312 341
   void LiebLin_Bethe_State::Compute_lnnorm ()
313 342
   {
314 343
     if (lnnorm == -100.0) {  // else Gaudin part already calculated by Newton method
@@ -317,7 +346,13 @@ namespace ABACUS {
317 346
 
318 347
       (*this).Build_Reduced_Gaudin_Matrix(Gaudin_Red);
319 348
 
320
-      lnnorm = real(lndet_LU_dstry(Gaudin_Red));
349
+      complex<DP> lnnorm_CX = lndet_LU_dstry(Gaudin_Red);
350
+      if (abs(imag(lnnorm_CX)) > 1.0e-6) {
351
+	cout << "lnnorm_CX = " << lnnorm_CX << endl;
352
+	ABACUSerror("Gaudin norm of LiebLin_Bethe_State should be real and positive.");
353
+      }
354
+
355
+      lnnorm = real(lnnorm_CX);
321 356
 
322 357
       // Add the pieces outside of Gaudin determinant
323 358
 
@@ -329,7 +364,15 @@ namespace ABACUS {
329 364
     return;
330 365
   }
331 366
 
332
-  void LiebLin_Bethe_State::Compute_All (bool reset_rapidities)     // solves BAE, computes E, K and lnnorm
367
+  /**
368
+     This function solves the Bethe equations, computes the energy, momentum and state norm.
369
+     It calls LiebLin_Bethe_State::Find_Rapidities, LiebLin_Bethe_State::Compute_Energy,
370
+     LiebLin_Bethe_State::Compute_Momentum and LiebLin_Bethe_State::Compute_lnnorm.
371
+
372
+     Assumptions:
373
+     - the set of quantum numbers is admissible.
374
+  */
375
+  void LiebLin_Bethe_State::Compute_All (bool reset_rapidities)
333 376
   {
334 377
     (*this).Find_Rapidities (reset_rapidities);
335 378
     if (conv == 1) {
@@ -345,7 +388,8 @@ namespace ABACUS {
345 388
     if (cxL >= 1.0)
346 389
       for (int a = 0; a < N; ++a) lambdaoc[a] = PI * Ix2[a]/cxL;
347 390
 
348
-    // For small values of c, use better approximation using approximate zeroes of Hermite polynomials: see Gaudin eqn 4.71.
391
+    // For small values of c, use better approximation using approximate
392
+    // zeroes of Hermite polynomials: see Gaudin eqn 4.71.
349 393
     if (cxL < 1.0) {
350 394
       DP oneoversqrtcLN = 1.0/pow(cxL * N, 0.5);
351 395
       for (int a = 0; a < N; ++a) lambdaoc[a] = oneoversqrtcLN * PI * Ix2[a];
@@ -403,7 +447,8 @@ namespace ABACUS {
403 447
 	dSdlambdaoc[j] += 1.0/((lambdaoc[j] - lambdaoc[k]) * (lambdaoc[j] - lambdaoc[k]) + 1.0);
404 448
       dSdlambdaoc[j] *= 2.0/(PI * cxL);
405 449
 
406
-      dlambdaoc[j] = (PI*Ix2[j]/cxL - S[j] + lambdaoc[j] * dSdlambdaoc[j])/(1.0 + dSdlambdaoc[j]) - lambdaoc[j];
450
+      dlambdaoc[j] = (PI*Ix2[j]/cxL - S[j] + lambdaoc[j] * dSdlambdaoc[j])
451
+	/(1.0 + dSdlambdaoc[j]) - lambdaoc[j];
407 452
 
408 453
     }
409 454
 
@@ -421,16 +466,18 @@ namespace ABACUS {
421 466
     return;
422 467
   }
423 468
 
469
+  /**
470
+     Performs one step of the matrix Newton method on the rapidities.
471
+   */
424 472
   void LiebLin_Bethe_State::Iterate_BAE_Newton (DP damping)
425 473
   {
426
-    // does one step of a Newton method on the rapidities...
427
-
428 474
     Vect_DP RHSBAE (0.0, N);  // contains RHS of BAEs
429 475
     Vect_DP dlambdaoc (0.0, N);  // contains delta lambdaoc computed from Newton's method
430 476
     SQMat_DP Gaudin (0.0, N);
431 477
     Vect_INT indx (N);
432 478
     DP sumtheta = 0.0;
433
-    int atanintshift = 0; // for large |lambda|, use atan (lambda) = sgn(lambda) pi/2 - atan(1/lambda)
479
+    // for large |lambda|, use atan (lambda) = sgn(lambda) pi/2 - atan(1/lambda)
480
+    int atanintshift = 0;
434 481
     DP lambdahere = 0.0;
435 482
 
436 483
     // Compute the RHS of the BAEs:
@@ -463,11 +510,13 @@ namespace ABACUS {
463 510
     lubksb (Gaudin, indx, dlambdaoc);
464 511
 
465 512
     bool ordering_changed = false;
466
-    for (int j = 0; j < N-1; ++j) if (lambdaoc[j] + dlambdaoc[j] > lambdaoc[j+1] + dlambdaoc[j+1]) ordering_changed = true;
513
+    for (int j = 0; j < N-1; ++j)
514
+      if (lambdaoc[j] + dlambdaoc[j] > lambdaoc[j+1] + dlambdaoc[j+1]) ordering_changed = true;
467 515
 
468 516
     // To prevent Newton from diverging, we limit the size of the rapidity changes.
469 517
     // The leftmost and rightmost rapidities can grow by one order of magnitude per iteration step.
470
-    if (ordering_changed) { // We explicitly ensure that the ordering remains correct after the iteration step.
518
+    if (ordering_changed) {
519
+      // We explicitly ensure that the ordering remains correct after the iteration step.
471 520
       bool ordering_still_changed = false;
472 521
       DP maxdlambdaoc = 0.0;
473 522
       do {
@@ -552,16 +601,38 @@ namespace ABACUS {
552 601
     K = 2.0 * iK * PI/L;
553 602
   }
554 603
 
604
+  /**
605
+     The fundamental scattering kernel for Lieb-Liniger,
606
+     \f[
607
+     K (\tilde{\lambda}) = \frac{ 2 }{\tilde{\lambda}^2 + 1}
608
+     \f]
609
+     given two indices for the rapidities as arguments.
610
+   */
555 611
   DP LiebLin_Bethe_State::Kernel (int a, int b)
556 612
   {
557 613
     return(2.0/(pow(lambdaoc[a] - lambdaoc[b], 2.0) + 1.0));
558 614
   }
559 615
 
616
+  /**
617
+     The fundamental scattering kernel for Lieb-Liniger,
618
+     \f[
619
+     K (\tilde{\lambda}) = \frac{ 2 }{\tilde{\lambda}^2 + 1}
620
+     \f]
621
+     given the rapidity difference as argument.
622
+   */
560 623
   DP LiebLin_Bethe_State::Kernel (DP lambdaoc_ref)
561 624
   {
562 625
     return(2.0/(lambdaoc_ref * lambdaoc_ref + 1.0));
563 626
   }
564 627
 
628
+  /**
629
+     This function constructs the Gaudin matrix \f$G\f$
630
+     which is defined as the Hessian of the Yang-Yang action \f$S^{YY}\f$,
631
+     \f[
632
+     G_{jk} = \delta_{jk} \left\{ cL + \sum_{l} K (\tilde{\lambda}_j - \tilde{\lambda}_l) \right\}
633
+     - K (\tilde{\lambda}_j - \tilde{\lambda}_k).
634
+     \f]
635
+   */
565 636
   void LiebLin_Bethe_State::Build_Reduced_Gaudin_Matrix (SQMat<DP>& Gaudin_Red)
566 637
   {
567 638
 
@@ -575,7 +646,8 @@ namespace ABACUS {
575 646
 
576 647
 	if (j == k) {
577 648
 	  sum_Kernel = 0.0;
578
-	  for (int kp = 0; kp < N; ++kp) if (j != kp) sum_Kernel += Kernel (lambdaoc[j] - lambdaoc[kp]);
649
+	  for (int kp = 0; kp < N; ++kp)
650
+	    if (j != kp) sum_Kernel += Kernel (lambdaoc[j] - lambdaoc[kp]);
579 651
 	  Gaudin_Red[j][k] = cxL + sum_Kernel;
580 652
 	}
581 653
 
@@ -586,6 +658,11 @@ namespace ABACUS {
586 658
     return;
587 659
   }
588 660
 
661
+  /**
662
+     For a summetric `LiebLin_Bethe_State`, this function computes the Gaudin matrix
663
+     as an \f$N/2 \times N/2\f$ matrix to accelerate computations.
664
+   */
665
+
589 666
   void LiebLin_Bethe_State::Build_Reduced_BEC_Quench_Gaudin_Matrix (SQMat<DP>& Gaudin_Red)
590 667
   {
591 668
     // Passing  a matrix of dimension N/2
@@ -612,7 +689,8 @@ namespace ABACUS {
612 689
 	  sum_Kernel = 0.0;
613 690
 	  for (int kp = N/2; kp < N; ++kp)
614 691
 	    if (j + N/2 != kp)
615
-	      sum_Kernel += Kernel (lambdaoc[j+N/2] - lambdaoc[kp]) + Kernel (lambdaoc[j+N/2] + lambdaoc[kp]);
692
+	      sum_Kernel += Kernel (lambdaoc[j+N/2] - lambdaoc[kp])
693
+		+ Kernel (lambdaoc[j+N/2] + lambdaoc[kp]);
616 694
 	  Gaudin_Red[j][k] = cxL + sum_Kernel;
617 695
 	}
618 696
 
@@ -625,10 +703,13 @@ namespace ABACUS {
625 703
   }
626 704
 
627 705
 
628
-  void LiebLin_Bethe_State::Annihilate_ph_pair (int ipart, int ihole, const Vect<int>& OriginStateIx2)
706
+  /**
707
+     This function changes the Ix2 of a given state by annihilating a particle and hole
708
+     pair specified by ipart and ihole (counting from the left, starting with index 0).
709
+   */
710
+  void LiebLin_Bethe_State::Annihilate_ph_pair (int ipart, int ihole,
711
+						const Vect<int>& OriginStateIx2)
629 712
   {
630
-    // This function changes the Ix2 of a given state by annihilating a particle and hole
631
-    // pair specified by ipart and ihole (counting from the left, starting with index 0).
632 713
 
633 714
     State_Label_Data currentdata = Read_State_Label ((*this).label, OriginStateIx2);
634 715
 
@@ -645,8 +726,10 @@ namespace ABACUS {
645 726
     int ntypespresent = 1; // only one type for LiebLin
646 727
     Vect<Vect<int> > Ix2old_new(ntypespresent);
647 728
     Vect<Vect<int> > Ix2exc_new(ntypespresent);
648
-    for (int it = 0; it < ntypespresent; ++it) Ix2old_new[it] = Vect<int>(ABACUS::max(nexc_new[it],1));
649
-    for (int it = 0; it < ntypespresent; ++it) Ix2exc_new[it] = Vect<int>(ABACUS::max(nexc_new[it],1));
729
+    for (int it = 0; it < ntypespresent; ++it)
730
+      Ix2old_new[it] = Vect<int>(ABACUS::max(nexc_new[it],1));
731
+    for (int it = 0; it < ntypespresent; ++it)
732
+      Ix2exc_new[it] = Vect<int>(ABACUS::max(nexc_new[it],1));
650 733
 
651 734
     // Copy earlier data in, leaving out ipart and ihole:
652 735
     for (int it = 0; it < ntypespresent; ++it) {
@@ -661,9 +744,12 @@ namespace ABACUS {
661 744
     (*this).Set_to_Label (Return_State_Label(newdata, OriginStateIx2));
662 745
   }
663 746
 
747
+  /**
748
+     Performs a spatial inversion of a `LiebLin_Bethe_State`, mapping all quantum numbers
749
+     and rapidities to minus themselves.
750
+   */
664 751
   void LiebLin_Bethe_State::Parity_Flip ()
665 752
   {
666
-    // For simplicity, we don't redo base_id, type_id, id.
667 753
     Vect_INT Ix2buff = Ix2;
668 754
     Vect_DP lambdaocbuff = lambdaoc;
669 755
     for (int i = 0; i < N; ++i) Ix2[i] = -Ix2buff[N - 1 - i];
@@ -672,16 +758,20 @@ namespace ABACUS {
672 758
     K = -K;
673 759
   }
674 760
 
761
+  /**
762
+     Send information about a `LiebLin_Bethe_State` to the output stream.
763
+   */
675 764
   std::ostream& operator<< (std::ostream& s, const LiebLin_Bethe_State& state)
676 765
   {
677
-    s << endl << "******** State for c = " << state.c_int << " L = " << state.L << " N = " << state.N
678
-      << " with label " << state.label << " ********" << endl;
766
+    s << endl << "******** State for c = " << state.c_int << " L = " << state.L
767
+      << " N = " << state.N << " with label " << state.label << " ********" << endl;
679 768
     s << "Ix2:" << endl;
680 769
     for (int j = 0; j < state.N; ++j) s << state.Ix2[j] << " ";
681 770
     s << endl << "lambdaocs:" << endl;
682 771
     for (int j = 0; j < state.N; ++j) s << state.lambdaoc[j] << " ";
683 772
     s << endl << "conv = " << state.conv << " iter_Newton = " << state.iter_Newton << endl;
684
-    s << "E = " << state.E << " iK = " << state.iK << " K = " << state.K << " lnnorm = " << state.lnnorm << endl;
773
+    s << "E = " << state.E << " iK = " << state.iK << " K = " << state.K
774
+      << " lnnorm = " << state.lnnorm << endl;
685 775
 
686 776
     return(s);
687 777
   }

+ 26
- 9
src/LIEBLIN/ln_Density_ME.cc View File

@@ -19,35 +19,51 @@ using namespace ABACUS;
19 19
 
20 20
 namespace ABACUS {
21 21
 
22
+  /**
23
+     Given a index \f$j\f$ together with a bra and ket respectively parametrized
24
+     by sets of rapidities \f$\{ \mu \}\f$ and \f$\{ \lambda \}\f$,
25
+     this function returns the product (see e.g.
26
+     [J.-S. Caux et al, JSTAT P01008 (2007)](https://doi.org/10.1088/1742-5468/2007/01/P01008))
27
+     \f[
28
+     V_j^+ \equiv \prod_l
29
+     \frac{\tilde{\mu}_l - \tilde{\lambda}_j + i}{\tilde{\lambda}_l - \tilde{\lambda}_j + i}.
30
+     \f]
31
+   */
22 32
   complex<DP> Fn_V (int j, LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
23 33
   {
24 34
     complex<DP> result = 1.0;
25 35
 
26 36
     for (int m = 0; m < lstate.N; ++m) {
27
-      result *= (lstate.lambdaoc[m] - rstate.lambdaoc[j] + II)/(rstate.lambdaoc[m] - rstate.lambdaoc[j] + II);
37
+      result *= (lstate.lambdaoc[m] - rstate.lambdaoc[j] + II)
38
+	/(rstate.lambdaoc[m] - rstate.lambdaoc[j] + II);
28 39
     }
29 40
 
30 41
     return(result);
31 42
   }
32 43
 
44
+  /**
45
+   Computes the log of the density operator \f$\hat{\rho}(x = 0)\f$ matrix element
46
+   between lstate (bra) and rstate (ket). If lstate == rstate, density matrix element = N/L;
47
+   if momentum difference is zero but states are different, then matrix element is zero
48
+   (but this function then returns the log artificially set to -200.0).
49
+   */
33 50
   complex<DP> ln_Density_ME (LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
34 51
   {
35
-    // Computes the log of the density operator \rho(x = 0) matrix element between lstate and rstate.
36
-
37
-    // If we have lstate == rstate, density matrix element = N/L:
38 52
     if (lstate.Ix2 == rstate.Ix2) return(log(lstate.N/lstate.L));
39 53
 
40
-    // If momentum difference is zero but states are different, then matrix element is zero:
41 54
     else if (lstate.iK == rstate.iK) return(-200.0);  // so exp(.) is zero
42 55
 
43 56
     SQMat_DP one_plus_U (0.0, lstate.N);
44 57
 
45 58
     Vect_CX Vplus (0.0, lstate.N);  // contains V^+_j;  V^-_j is the conjugate
46
-    Vect_CX ln_Fn_Prod (0.0, lstate.N);  // product_{m\neq j} (\mu_m - \lambdaoc_j)/(\lambdaoc_m - \lambdaoc_j)
59
+    // prod_{m\neq j} (\mu_m - \lambdaoc_j)/(\lambdaoc_m - \lambdaoc_j):
60
+    Vect_CX ln_Fn_Prod (0.0, lstate.N);
47 61
     Vect_DP rKern (0.0, lstate.N);   // K(lambdaoc_j - lambdaoc_(p == arbitrary))
48 62
 
63
+    // "Phantom" rapidity in ME expression. Choice doesn't matter, see 1990_Slavnov_TMP_82
64
+    // after (3.8). Choose rapidity around the middle.
49 65
     //int p = 0;
50
-    int p = rstate.N/2-1; // choice doesn't matter, see 1990_Slavnov_TMP_82 after (3.8). Choose rapidity around the middle.
66
+    int p = rstate.N/2-1;
51 67
 
52 68
     DP Kout = lstate.K - rstate.K;
53 69
 
@@ -62,8 +78,9 @@ namespace ABACUS {
62 78
 
63 79
     for (int a = 0; a < lstate.N; ++a)
64 80
       for (int b = 0; b < lstate.N; ++b)
65
-	one_plus_U[a][b] = (a == b ? 1.0 : 0.0) + 0.5 * ((lstate.lambdaoc[a] - rstate.lambdaoc[a])/imag(Vplus[a]))
66
-	  * real(exp(ln_Fn_Prod[a])) * (rstate.Kernel(a,b) - rKern[b]); // BUGRISK: why real here?
81
+	one_plus_U[a][b] = (a == b ? 1.0 : 0.0)
82
+	  + 0.5 * ((lstate.lambdaoc[a] - rstate.lambdaoc[a])/imag(Vplus[a]))
83
+	  * real(exp(ln_Fn_Prod[a])) * (rstate.Kernel(a,b) - rKern[b]);
67 84
 
68 85
     complex<DP> ln_ddalpha_sigma = lndet_LU_dstry(one_plus_U);
69 86
 

+ 33
- 17
src/LIEBLIN/ln_Psi_ME.cc View File

@@ -19,62 +19,78 @@ using namespace ABACUS;
19 19
 
20 20
 namespace ABACUS {
21 21
 
22
+  /**
23
+     Given a index \f$j\f$ together with a bra and ket respectively parametrized
24
+     by sets of rapidities \f$\{ \mu \}\f$ and \f$\{ \lambda \}\f$,
25
+     this function returns the product (see e.g.
26
+     [J.-S. Caux et al, JSTAT P01008 (2007)](https://doi.org/10.1088/1742-5468/2007/01/P01008))
27
+     \f[
28
+     V_j^+ \equiv \prod_l
29
+     \frac{\tilde{\mu}_l - \tilde{\lambda}_j + i}{\tilde{\lambda}_l - \tilde{\lambda}_j + i}.
30
+     \f]
31
+   */
22 32
   complex<DP> Fn_V_Psi (int j, LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
23 33
   {
24 34
     // lstate has one particle less than rstate
25 35
 
26
-    complex<DP> result_num = 1.0;
27
-    complex<DP> result_den = 1.0;
36
+    complex<DP> result = 1.0;
28 37
 
29 38
     for (int m = 0; m < lstate.N; ++m)
30
-      result_num *= (lstate.lambdaoc[m] - rstate.lambdaoc[j] + II);
39
+      result *= (lstate.lambdaoc[m] - rstate.lambdaoc[j] + II)
40
+	/(rstate.lambdaoc[m] - rstate.lambdaoc[j] + II);
41
+    result /= (rstate.lambdaoc[rstate.N - 1] - rstate.lambdaoc[j] + II);
31 42
 
32
-    for (int m = 0; m < rstate.N; ++m)
33
-      result_den *= (rstate.lambdaoc[m] - rstate.lambdaoc[j] + II);
34
-
35
-    return(result_num/result_den);
43
+    return(result);
36 44
   }
37 45
 
46
+  /**
47
+   Computes the log of the annihilation operator matrix element between lstate and rstate.
48
+   */
38 49
   complex<DP> ln_Psi_ME (LiebLin_Bethe_State& lstate, LiebLin_Bethe_State& rstate)
39 50
   {
40
-    // Computes the log of the annihilation operator matrix element between lstate and rstate.
41
-
42
-    if (lstate.N + 1 != rstate.N) ABACUSerror("Wrong particle numbers in left and right states for Psi FF.");
51
+    if (lstate.N + 1 != rstate.N)
52
+      ABACUSerror("Wrong particle numbers in left and right states for Psi FF.");
43 53
 
44 54
     SQMat_DP U_Psi (0.0, lstate.N);
45 55
 
46 56
     Vect_CX Vplus (0.0, lstate.N);  // contains V^+_j;  V^-_j is the conjugate
47
-    Vect_DP Fn_Prod (0.0, lstate.N);  // product_{m} (\mu_m - \lambdaoc_j)/product_{m neq j} (\lambdaoc_m - \lambdaoc_j)
57
+    // product_{m} (\mu_m - \lambdaoc_j)/product_{m neq j} (\lambdaoc_m - \lambdaoc_j)
58
+    Vect_DP Fn_Prod (0.0, lstate.N);
48 59
     Vect_DP rKern (0.0, lstate.N);   // K(lambdaoc_j - lambdaoc_(p == N))
49 60
 
50 61
     int p = rstate.N - 1;
51 62
 
52 63
     for (int a = 0; a < lstate.N; ++a) {
53 64
       Vplus[a] = Fn_V_Psi (a, lstate, rstate);
54
-      Fn_Prod[a] = (lstate.lambdaoc[a] - rstate.lambdaoc[a])/(rstate.lambdaoc[rstate.N - 1] - rstate.lambdaoc[a]);
65
+      Fn_Prod[a] = (lstate.lambdaoc[a] - rstate.lambdaoc[a])
66
+	/(rstate.lambdaoc[rstate.N - 1] - rstate.lambdaoc[a]);
55 67
       for (int m = 0; m < lstate.N; ++m)
56
-	if (m != a) Fn_Prod[a] *= (lstate.lambdaoc[m] - rstate.lambdaoc[a])/(rstate.lambdaoc[m] - rstate.lambdaoc[a]);
68
+	if (m != a) Fn_Prod[a] *= (lstate.lambdaoc[m] - rstate.lambdaoc[a])
69
+		      /(rstate.lambdaoc[m] - rstate.lambdaoc[a]);
57 70
       rKern[a] = rstate.Kernel (a, p);
58 71
     }
59 72
 
60 73
     for (int a = 0; a < lstate.N; ++a)
61 74
       for (int b = 0; b < lstate.N; ++b)
62
-	U_Psi[a][b] = (a == b ? 2.0 * imag(Vplus[a]) : 0.0) + Fn_Prod[a] * (rstate.Kernel(a,b) - rKern[b]);
75
+	U_Psi[a][b] = (a == b ? 2.0 * imag(Vplus[a]) : 0.0)
76
+	  + Fn_Prod[a] * (rstate.Kernel(a,b) - rKern[b]);
63 77
 
64 78
     complex<DP> ln_det_U_Psi = lndet_LU_dstry(U_Psi);
65 79
 
66 80
     complex<DP> ln_prod_lambdaocsq_plus_one = 0.0;
67 81
     for (int a = 0; a < rstate.N - 1; ++a)
68 82
       for (int b = a; b < rstate.N; ++b)
69
-	ln_prod_lambdaocsq_plus_one += log(complex<DP>((rstate.lambdaoc[a] - rstate.lambdaoc[b])
70
-						       * (rstate.lambdaoc[a] - rstate.lambdaoc[b])) + 1.0);
83
+	ln_prod_lambdaocsq_plus_one +=
84
+	  log(complex<DP>((rstate.lambdaoc[a] - rstate.lambdaoc[b])
85
+			  * (rstate.lambdaoc[a] - rstate.lambdaoc[b])) + 1.0);
71 86
 
72 87
     complex<DP> ln_prod_lambdaoca_min_mub = 0.0;
73 88
     for (int a = 0; a < rstate.N; ++a)
74 89
       for (int b = 0; b < lstate.N; ++b)
75 90
 	ln_prod_lambdaoca_min_mub += log(complex<DP>(rstate.lambdaoc[a] - lstate.lambdaoc[b]));
76 91
 
77
-    return (ln_det_U_Psi + 0.5 * log(lstate.c_int) + ln_prod_lambdaocsq_plus_one - ln_prod_lambdaoca_min_mub
92
+    return (ln_det_U_Psi + 0.5 * log(lstate.c_int)
93
+	    + ln_prod_lambdaocsq_plus_one - ln_prod_lambdaoca_min_mub
78 94
 	    - 0.5 * (lstate.lnnorm + rstate.lnnorm));
79 95
   }
80 96
 

Loading…
Cancel
Save