├── .config.mk.ci.clang ├── .config.mk.ci.gcc ├── .config.mk.ci.gcc.nocheck ├── .gitignore ├── .gitlab-ci.yml ├── ChangeLog.md ├── LICENSE ├── Makefile ├── README.md ├── VERSION ├── benchmark.cxx ├── config.mk.default ├── doc ├── Makefile ├── doxygen │ ├── Doxyfile │ ├── DoxygenLayout.xml │ ├── footer.html │ ├── header.html │ ├── mainpage.md │ ├── stylesheet.css │ ├── xerus.png │ └── xerus.svg └── jekyll │ ├── .gitignore │ ├── _config.yml │ ├── _includes │ ├── examples │ │ ├── als.cpp │ │ ├── als.py │ │ ├── cascade.cpp │ │ ├── cascade.gnuplot │ │ ├── cascade.py │ │ ├── qtt.cpp │ │ └── qtt.py │ ├── footer.html │ ├── header.html │ ├── sidebar-content.html │ ├── sidebar.html │ └── version.svp │ ├── _layouts │ └── post.html │ ├── _plugins │ └── tabs.rb │ ├── _posts │ ├── 1000-10-10-cascade.md │ ├── 1000-11-10-minimal_als.md │ ├── 1000-12-10-quickstart.md │ ├── 2000-10-20-debugging.md │ ├── 2000-10-25-optimization.md │ ├── 2000-11-16-tensornetworks.md │ ├── 2000-11-18-riemannian.md │ ├── 2000-11-20-completion.md │ ├── 2000-11-22-als.md │ ├── 2000-11-24-tttensors.md │ ├── 2000-11-26-decompositions.md │ ├── 2000-11-28-indices.md │ ├── 2000-11-30-tensor.md │ ├── 2000-12-15-nomenclature.md │ └── 2000-12-20-building_xerus.md │ ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ ├── bootstrap.min.css.map │ ├── footer.css │ ├── syntax.css │ ├── tabs.css │ └── theme.css │ ├── documentation.md │ ├── examples.md │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 │ ├── images │ ├── cascade.png │ ├── xerus.png │ └── xerus.svg │ ├── index.md │ └── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery.min.js │ └── npm.js ├── include ├── xerus.h └── xerus │ ├── 3rdParty │ └── lapack.h │ ├── algorithms │ ├── adf.h │ ├── als.h │ ├── cg.h │ ├── decompositionAls.h │ ├── iht.h │ ├── largestEntry.h │ ├── randomSVD.h │ ├── retractions.h │ ├── steepestDescent.h │ └── uqAdf.h │ ├── basic.h │ ├── blasLapackWrapper.h │ ├── cholmod_wrapper.h │ ├── contractionHeuristic.h │ ├── examples │ ├── specificLowRankTensors.h │ └── tensorCompletion.h │ ├── index.h │ ├── indexedTensor.h │ ├── indexedTensorList.h │ ├── indexedTensorMoveable.h │ ├── indexedTensorReadOnly.h │ ├── indexedTensorWritable.h │ ├── indexedTensor_tensor_factorisations.h │ ├── measurments.h │ ├── misc.h │ ├── misc │ ├── allocator.h │ ├── basicArraySupport.h │ ├── callStack.h │ ├── check.h │ ├── containerOutput.h │ ├── containerSupport.h │ ├── exceptions.h │ ├── fileIO.h │ ├── histogram.h │ ├── internal.h │ ├── math.h │ ├── missingFunctions.h │ ├── namedLogger.h │ ├── performanceAnalysis.h │ ├── random.h │ ├── sfinae.h │ ├── simpleNumerics.h │ ├── sort.h │ ├── standard.h │ ├── stringFromTo.h │ ├── stringUtilities.h │ └── timeMeasure.h │ ├── performanceData.h │ ├── sparseTimesFullContraction.h │ ├── tensor.h │ ├── tensorLogger.h │ ├── tensorNetwork.h │ ├── test │ └── test.h │ ├── ttNetwork.h │ └── ttStack.h ├── makeIncludes ├── general.mk ├── optimization.mk └── warnings.mk └── src ├── docHelper ├── findDoxytag.cpp └── parseDoxytags.cpp ├── unitTests ├── als.cxx ├── cg.cxx ├── consistency.cxx ├── decompositionAls.cxx ├── fileIO.cxx ├── fullTensor_add_sub.cxx ├── fullTensor_arithmetic.cxx ├── fullTensor_assignment.cxx ├── fullTensor_factor.cxx ├── fullTensor_factorisations.cxx ├── fullTensor_product.cxx ├── fullTensor_solve.cxx ├── fullTensor_sparseTensor_interaction.cxx ├── fullTensor_trace.cxx ├── fullTensor_utilities.cxx ├── indices.cxx ├── largestEntry.cxx ├── misc.cxx ├── retractions.cxx ├── saveAndLoad.cxx ├── sparseTensor.cxx ├── sparseTensor_add_sub_cpy.cxx ├── sparseTensor_arithmetic_cpy.cxx ├── sparseTensor_assignment.cxx ├── sparseTensor_assignment_cpy.cxx ├── sparseTensor_product_cpy.cxx ├── sparseTensor_trace_cpy.cxx ├── sparseTensor_utilities.cxx ├── steepestDescent.cxx ├── strassen.cxx ├── tensor.cxx ├── tensorNetwork.cxx ├── tensorNetwork_element_access.cxx ├── tensors.cxx ├── ttArithmetic.cxx ├── ttCompletion.cxx ├── ttCreation.cxx ├── ttOther.cxx ├── ttRounding.cxx ├── tutorials.cxx └── xPerformanceAnalysis.cxx └── xerus ├── algorithms ├── adf.cpp ├── als.cpp ├── cg.cpp ├── decompositionAls.cpp ├── iht.cpp ├── largestEntry.cpp ├── retractions.cpp ├── steepestDescent.cpp └── uqAdf.cpp ├── basic.cpp ├── blasLapackWrapper.cpp ├── cholmod_wrapper.cpp ├── contractionHeuristic.cpp ├── examples ├── specificLowRankTensors.cpp └── tensorCompletion.cpp ├── index.cpp ├── indexedTensor.cpp ├── indexedTensorList.cpp ├── indexedTensorMoveable.cpp ├── indexedTensorReadOnly.cpp ├── indexedTensorWritable.cpp ├── indexedTensor_tensor_evaluate.cpp ├── indexedTensor_tensor_factorisations.cpp ├── indexedTensor_tensor_solve.cpp ├── link.cpp ├── measurments.cpp ├── misc ├── allocator.cpp ├── callStack.cpp ├── exceptions.cpp ├── histogram.cpp ├── missingFunctions.cpp ├── namedLogger.cpp ├── performanceAnalysis.cpp ├── random.cpp ├── simpleNumerics.cpp ├── standard.cpp ├── stringUtilities.cpp └── timeMeasure.cpp ├── performanceData.cpp ├── python ├── factorizations.cpp ├── indexedTensor.cpp ├── leastSquares.cpp ├── misc.cpp ├── misc.h ├── python.cpp ├── recovery.cpp ├── tensor.cpp ├── tensorNetwork.cpp ├── ttnetwork.cpp └── vectorAndPair.h ├── sparseTimesFullContraction.cpp ├── tensor.cpp ├── tensorNetwork.cpp ├── tensorNode.cpp ├── tensor_specializations.cpp ├── test └── test.cpp ├── ttNetwork.cpp └── ttStack.cpp /.config.mk.ci.clang: -------------------------------------------------------------------------------- 1 | #================================================================================================= 2 | # Compiler Options 3 | #================================================================================================= 4 | CXX = clang++ 5 | 6 | DEBUG += -g # Adds debug symbols 7 | 8 | LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour but might 9 | 10 | #================================================================================================= 11 | # External libraries 12 | #================================================================================================= 13 | STRICT_WARNINGS = TRUE 14 | 15 | # Uncomment or add the appropriate blas libraries 16 | BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial 17 | 18 | # Uncomment or add the appropriate lapack libraries 19 | LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries 20 | 21 | # Uncomment or add the appropriate CXSparse library 22 | SUITESPARSE = -lcholmod -lspqr 23 | 24 | 25 | # custom include paths 26 | # OTHER += -I /path/to/include 27 | 28 | -------------------------------------------------------------------------------- /.config.mk.ci.gcc: -------------------------------------------------------------------------------- 1 | #================================================================================================= 2 | # Compiler Options 3 | #================================================================================================= 4 | CXX = g++ 5 | 6 | STRICT_WARNINGS = TRUE 7 | DEBUG += -D XERUS_TEST_COVERAGE # Enable coverage tests 8 | 9 | DEBUG += -g # Adds debug symbols 10 | 11 | #================================================================================================= 12 | # External libraries 13 | #================================================================================================= 14 | BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial 15 | LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries 16 | SUITESPARSE = -lcholmod -lspqr 17 | 18 | OTHER += -I /usr/include/python2.7/ -lboost_python -I/usr/lib64/python2.7/site-packages/numpy/core/include/ -lpython2.7 -fno-var-tracking-assignments 19 | -------------------------------------------------------------------------------- /.config.mk.ci.gcc.nocheck: -------------------------------------------------------------------------------- 1 | #================================================================================================= 2 | # Compiler Options 3 | #================================================================================================= 4 | CXX = g++ 5 | 6 | STRICT_WARNINGS = TRUE 7 | 8 | # HIGH_OPTIMIZATION = TRUE # Activates -O3 -march=native and some others 9 | DEBUG += -D XERUS_DISABLE_RUNTIME_CHECKS # Disable all runtime checks 10 | DEBUG += -D XERUS_REPLACE_ALLOCATOR 11 | 12 | DEBUG += -g # Adds debug symbols 13 | 14 | 15 | LOGGING += -D XERUS_LOG_INFO # Information that is not linked to any unexpected behaviour bu 16 | 17 | #================================================================================================= 18 | # External libraries 19 | #================================================================================================= 20 | BLAS_LIBRARIES = -lopenblas -lgfortran # Openblas, serial 21 | LAPACK_LIBRARIES = -llapacke -llapack # Standard Lapack + Lapacke libraries 22 | SUITESPARSE = -lcholmod -lspqr 23 | 24 | 25 | # custom include paths 26 | # OTHER += -I /path/to/include 27 | 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | * 3 | 4 | # But not these files... 5 | !.gitignore 6 | !*.h 7 | !*.hpp 8 | !*.hxx 9 | 10 | !*.c 11 | !*.cpp 12 | !*.cxx 13 | 14 | !*.mk 15 | !Makefile 16 | !.gitignore 17 | 18 | !*.sh 19 | 20 | !*.rb 21 | !*.py 22 | 23 | !*.md 24 | !*.xml 25 | !*.dox 26 | !*.css 27 | !*.js 28 | !*.yml 29 | 30 | # ...even if they are in subdirectories 31 | !*/ 32 | 33 | # However we really want to ignore 34 | lapacke/* 35 | build/* 36 | doc/html/* 37 | config.mk 38 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - build_homepage 3 | - build_gcc 4 | - test_gcc 5 | - build_gcc_nocheck 6 | - test_gcc_nocheck 7 | - build_python 8 | - build_clang 9 | - test_clang 10 | 11 | job_build_homepage: 12 | stage: build_homepage 13 | script: "cp .config.mk.ci.gcc config.mk; make -C doc doc; scp -r doc/html xerusweb:libxerus.org-443" 14 | when: always 15 | only: 16 | - master 17 | allow_failure: true 18 | 19 | job_make_gcc: 20 | stage: build_gcc 21 | script: "g++ --version; cp .config.mk.ci.gcc config.mk; make XerusTest; cp XerusTest ../" 22 | when: always 23 | 24 | job_test_gcc: 25 | stage: test_gcc 26 | script: "cp ../XerusTest .; ./XerusTest all" 27 | 28 | job_make_gcc_nocheck: 29 | stage: build_gcc_nocheck 30 | script: "g++ --version; cp .config.mk.ci.gcc.nocheck config.mk; make XerusTest; cp XerusTest ../" 31 | 32 | job_test_gcc_nocheck: 33 | stage: test_gcc_nocheck 34 | script: "cp ../XerusTest .; ./XerusTest all" 35 | 36 | job_build_python: 37 | stage: build_python 38 | script: "g++ --version; cp .config.mk.ci.gcc config.mk; make python" 39 | when: always 40 | 41 | job_make_clang: 42 | stage: build_clang 43 | script: "clang++ --version; cp .config.mk.ci.clang config.mk; make XerusTest; cp XerusTest ../" 44 | when: always 45 | 46 | job_test_clang: 47 | stage: test_clang 48 | script: "cp ../XerusTest .; ./XerusTest all" 49 | 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About # 2 | 3 | The `xerus` library is a general purpose library for numerical calculations with higher order tensors, Tensor-Train Decompositions / Matrix Product States and other Tensor Networks. 4 | The focus of development was the simple usability and adaptibility to any setting that requires higher order tensors or decompositions thereof. 5 | 6 | For tutorials and a documentation see the documentation. 7 | 8 | The source code is licenced under the AGPL v3.0. For more details see the LICENSE file. 9 | 10 | 11 | # Features # 12 | 13 | + Intuitive notation for expressions involving tensors of arbitrary degree: `A(i,j) = B(i,k,l) * C(k,j,l)`; 14 | + Lazy evaluation of tensor expressions with automatically optimized contraction orders. 15 | + Full implementation of all common functionality of the Tensor Train (or Matrix Product State) decompositions with either dense or sparse component tensors. 16 | + Implementations of common algorithms like the ALS, (multi-site-)DMRG, ASD, AFD, CG, and some less common ones e.g. to find the maximal entries in a Tensor Train. 17 | 18 | 19 | # Building the Xerus library # 20 | 21 | Copy the default configuration and modify it for your needs 22 | > cp config.mk.default config.mk 23 | 24 | > nano config.mk 25 | 26 | Test whether everything works correctly with 27 | > make test -j4 28 | 29 | build (and optionally install) the library with 30 | > make all -j4 31 | 32 | > sudo make install 33 | 34 | and you should be ready to use the library. For more details see the "Building Xerus" page in the documentation. 35 | 36 | 37 | # Issues # 38 | 39 | Should you have any problems with the library do not hesitate to contact us at contact[at]libxerus.org or describe your problem in the issuetracker. 40 | 41 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 3.0.1 2 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------------ 2 | # Default rule should be the help message 3 | # ------------------------------------------------------------------------------------------------------ 4 | help: 5 | @printf "Possible make targets are:\n \ 6 | \t\thelp \t\t -- Print this help.\n \ 7 | \t\tdoc \t\t -- Build the html documentation for the xerus library.\n \ 8 | \t\tserve \t\t -- Build the html documentation for the xerus library and offer it via 'jekyll serve'.\n \ 9 | \t\tclean \t\t -- Remove all documentation files.\n" 10 | 11 | .FORCE: 12 | doc: .FORCE parseDoxytags findDoxytag 13 | -mkdir html 14 | doxygen doxygen/Doxyfile 15 | ./parseDoxytags 16 | jekyll build --source jekyll/ --destination html/ 17 | 18 | clean: 19 | -rm -rf html 20 | -rm -f parseDoxytags findDoxytag 21 | -rm -f xerus.tags xerus.tagfile 22 | 23 | serve: .FORCE parseDoxytags findDoxytag 24 | -mkdir html 25 | doxygen doxygen/Doxyfile 26 | ./parseDoxytags 27 | jekyll serve --source jekyll/ --destination html/ 28 | 29 | include ../config.mk 30 | include ../makeIncludes/general.mk 31 | include ../makeIncludes/warnings.mk 32 | include ../makeIncludes/optimization.mk 33 | 34 | FLAGS = $(strip $(WARNINGS) $(OPTIMIZE) $(OTHER)) 35 | 36 | parseDoxytags: ../src/docHelper/parseDoxytags.cpp 37 | $(CXX) $(FLAGS) ../src/docHelper/parseDoxytags.cpp -o parseDoxytags 38 | 39 | 40 | findDoxytag: ../src/docHelper/findDoxytag.cpp 41 | $(CXX) $(FLAGS) ../src/docHelper/findDoxytag.cpp -o findDoxytag 42 | -------------------------------------------------------------------------------- /doc/doxygen/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
11 | 12 | 13 |