python.cpp 2.54 KB
Newer Older
Benjamin Huber's avatar
Benjamin Huber committed
1
// Xerus - A General Purpose Tensor Library
Fuchsi*'s avatar
Fuchsi* committed
2
// Copyright (C) 2014-2019 Benjamin Huber and Sebastian Wolf.
3
//
Benjamin Huber's avatar
Benjamin Huber committed
4
5
6
7
// Xerus is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
8
//
Benjamin Huber's avatar
Benjamin Huber committed
9
10
11
12
// Xerus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
13
//
Benjamin Huber's avatar
Benjamin Huber committed
14
15
16
// You should have received a copy of the GNU Affero General Public License
// along with Xerus. If not, see <http://www.gnu.org/licenses/>.
//
17
// For further information on Xerus visit https://libXerus.org
Benjamin Huber's avatar
Benjamin Huber committed
18
19
20
21
22
23
// or contact us at contact@libXerus.org.

/**
 * @file
 * @brief Definition of the python bindings.
 */
24

25
26
27
28
#include "misc.h"


PYBIND11_MODULE(xerus, m) {
Philipp  Trunschke's avatar
bugfix    
Philipp Trunschke committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
	m.doc() = "\
The `xerus` library is a general purpose library for numerical calculations with higher order tensors, Tensor-Train Decompositions / Matrix Product States and general Tensor Networks.\n\
The focus of development was the simple usability and adaptibility to any setting that requires higher order tensors or decompositions thereof.\n\
\n\
The key features include:\n\
* Modern code and concepts incorporating many features of the `C++11` standard.\n\
* Full python bindings with very similar syntax for easy transitions from and to c++.\n\
* Calculation with tensors of arbitrary orders using an intuitive Einstein-like notation `A(i,j) = B(i,k,l) * C(k,j,l);`.\n\
* Full implementation of the Tensor-Train decompositions (MPS) with all neccessary capabilities (including Algorithms like ALS, ADF and CG).\n\
* Lazy evaluation of (multiple) tensor contractions featuring heuristics to automatically find efficient contraction orders.\n\
* Direct integration of the `blas` and `lapack`, as high performance linear algebra backends.\n\
* Fast sparse tensor calculation by usage of the `suiteSparse` sparse matrix capabilities.\n\
* Capabilites to handle arbitrary Tensor Networks.\n\
";
43

44
45
46
47
48
	// xerus version
	m.attr("VERSION_MAJOR") = VERSION_MAJOR;
	m.attr("VERSION_MINOR") = VERSION_MINOR;
	m.attr("VERSION_REVISION") = VERSION_REVISION;
	m.attr("VERSION_COMMIT") = VERSION_COMMIT;
49

50
51
	expose_indexedTensors(m);
	expose_factorizations(m);
Michael Goette's avatar
merged    
Michael Goette committed
52

53
54
55
56
	expose_tensor(m);
	expose_tensorNetwork(m);
	expose_ttnetwork(m);
	expose_htnetwork(m);
57

58
59
	expose_leastSquaresAlgorithms(m);
	expose_recoveryAlgorithms(m);
60

61
	expose_misc(m);
62
}