xerus issueshttps://git.hemio.de/xerus/xerus/-/issues2020-04-21T10:27:21+02:00https://git.hemio.de/xerus/xerus/-/issues/263replace `TTOpertor.degrees_of_freedom` with `xe.degrees_of_freedom` in the py...2020-04-21T10:27:21+02:00Philipp Trunschkereplace `TTOpertor.degrees_of_freedom` with `xe.degrees_of_freedom` in the python interfaceVersion 4.1Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/262Slice TTTensor2020-04-21T10:19:54+02:00Nando FarchminSlice TTTensorWould be good to get a subtensor, i.e. slice of the tensor (a subtensor from dimensions (l_1,...,l_n) to dimensions (u_1,...,u_n) where 0 <= l_i <= u_i <= tensor_dim_i, see code below.)
```
def slice_tt(tt, lower, upper):
"""
Sl...Would be good to get a subtensor, i.e. slice of the tensor (a subtensor from dimensions (l_1,...,l_n) to dimensions (u_1,...,u_n) where 0 <= l_i <= u_i <= tensor_dim_i, see code below.)
```
def slice_tt(tt, lower, upper):
"""
Slice TTTensor in each component from lower to (not including) upper dimension.
"""
assert len(lower) == len(upper) == len(tt.dimensions)
assert np.all(np.array(lower) < np.array(upper))
assert np.all(np.array(upper) <= np.array(tt.dimensions))
diff = [u-l for l,u in zip(lower,upper)]
# TODO there should be a more elegant way to slice TTTensors!
tmp = xe.TTTensor(tt)
for pos in range(tt.order()):
tmp.move_core(pos)
cmp = np.asarray(tmp.get_component(pos))
cmp[:, :lower[pos], :] = 0
cmp[:, upper[pos]:, :] = 0
tmp.set_component(pos, xe.Tensor.from_buffer(cmp))
tmp.move_core(0)
tt_slice = xe.TTTensor.random(diff, tmp.ranks())
for pos in range(tt.order()):
cmp = np.asarray(tmp.get_component(pos))
cmp = np.array(cmp[:, lower[pos]:upper[pos], :])
tt_slice.set_component(pos, xe.Tensor.from_buffer(cmp))
return tt_slice
```Version 4.1Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/260deprecate Python 2.72019-06-18T16:46:30+02:00Philipp Trunschkedeprecate Python 2.7Python 2.7 will not be maintained past 2020.
We should consider stopping to maintain bindings and tests for old python versions.Python 2.7 will not be maintained past 2020.
We should consider stopping to maintain bindings and tests for old python versions.https://git.hemio.de/xerus/xerus/-/issues/258test pickling of random tensor networks2019-06-16T22:32:46+02:00Philipp Trunschketest pickling of random tensor networkshttps://git.hemio.de/xerus/xerus/-/issues/251Bug with fenics and mkl2019-04-10T15:29:08+02:00Philipp TrunschkeBug with fenics and mkl```
OS: openSUSE Leap 42.3
MKL Info:
Major version: 2019
Minor version: 0
Update version: 1
Product status: Product
Build: 20180928
Platform: Intel(R) 64 architectur...```
OS: openSUSE Leap 42.3
MKL Info:
Major version: 2019
Minor version: 0
Update version: 1
Product status: Product
Build: 20180928
Platform: Intel(R) 64 architecture
Processor optimization: Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors
================================================================
```
[Working example is attached.](/uploads/657409540901107570a60a2d1a340483/xerus___dolfin___libmkl___buggy.py)Version 4.0https://git.hemio.de/xerus/xerus/-/issues/249load_from_file shoud raise an IOError instead of returning None if the file d...2019-06-13T12:26:28+02:00Philipp Trunschkeload_from_file shoud raise an IOError instead of returning None if the file does not existVersion 4.0Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/247test pybind11 bindings2019-06-12T23:08:00+02:00Philipp Trunschketest pybind11 bindings- [x] `xe.Tensor(xe.TTTensor([2]))` raises `ValueError`
- [ ] segfault in `test_pickle.py` with python2-bindings- [x] `xe.Tensor(xe.TTTensor([2]))` raises `ValueError`
- [ ] segfault in `test_pickle.py` with python2-bindingsVersion 4.0Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/246clean up interface to `uq_ra_adf`2019-06-16T20:37:40+02:00Philipp Trunschkeclean up interface to `uq_ra_adf`Clean up the interface for `uq_ra_adf`.
- [ ] define `uq_ra_adf_iv`, ... as overloaded version of `uq_ra_adf`Clean up the interface for `uq_ra_adf`.
- [ ] define `uq_ra_adf_iv`, ... as overloaded version of `uq_ra_adf`Version 4.0Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/230Memory Leak in Python Interface2019-06-13T01:30:25+02:00Philipp TrunschkeMemory Leak in Python InterfaceThere is a memory leak in the python interface to `xerus`.
Minimal working example:
```
import xerus as xe
i, = xe.indices(1)
d = xe.Tensor.random([100]*3)
while True:
d_tmp = xe.Tensor()
d_tmp(i&0) << d(i&0)
```There is a memory leak in the python interface to `xerus`.
Minimal working example:
```
import xerus as xe
i, = xe.indices(1)
d = xe.Tensor.random([100]*3)
while True:
d_tmp = xe.Tensor()
d_tmp(i&0) << d(i&0)
```Version 4.0Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/228Tidy up UQ ADF2019-06-16T20:37:18+02:00Sebastian WolfTidy up UQ ADFIt looks like there is quite a bit of redundancy in the functions offered for UQ. In particular, I don't think the UQMeasurementset is currently very useful. Either we should extend it and offer it for all algorithms, or get rid of it an...It looks like there is quite a bit of redundancy in the functions offered for UQ. In particular, I don't think the UQMeasurementset is currently very useful. Either we should extend it and offer it for all algorithms, or get rid of it and always use separate vectors of parameters/positions and solutions (or a `std::pair` thereof).
However, since I am not the one currently using this algorithm (and don't know what all the new functions do) I don't want to change it more than I already did. @trunschk can you have a look at it?
**Update:**
- [ ] replace `UQMeasurementset` by the two vectors of rank-1 measurements and their corresponding values
- [ ] add convenience functions that evaluate a given basis at given points and return the two vectors of rank-1 measurements and values
- [ ] remove the `dimensions` argument from `uq_ra_adf`
- [ ] define `uq_ra_adf_iv` as overloaded version of `uq_ra_adf`
- [ ] clean up the interface for `uq_ra_adf`Version 4.0Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/217pybind11 bindings2019-06-12T22:01:09+02:00RoteKeksepybind11 bindings- [x] expose indexedTensors
- [x] expose factorizations
- [x] expose tensor
- [x] expose tensorNetwork
- [x] expose ttnetwork
- [x] expose htnetwork
- [x] expose leastSquaresAlgorithms
- [x] expose recoveryAlgorithms
- [x] expose misc- [x] expose indexedTensors
- [x] expose factorizations
- [x] expose tensor
- [x] expose tensorNetwork
- [x] expose ttnetwork
- [x] expose htnetwork
- [x] expose leastSquaresAlgorithms
- [x] expose recoveryAlgorithms
- [x] expose miscVersion 4.0Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/199export exceptions to python2017-05-23T13:08:29+02:00Fuchsi*export exceptions to pythonVersion 3.0Fuchsi*Fuchsi*https://git.hemio.de/xerus/xerus/-/issues/197premature deallocation of temporary tensors in python2017-05-23T00:53:41+02:00Fuchsi*premature deallocation of temporary tensors in pythonindexing a temporary tensor leads to invalid memory access. the lifetime of the tensor likely has to be bound to the lifetime of the resulting indexed tensor somehow...
eg.
~~~ python
xe.frob_norm(xe.Tensor.identity({10,10})(i&0))
~~~indexing a temporary tensor leads to invalid memory access. the lifetime of the tensor likely has to be bound to the lifetime of the resulting indexed tensor somehow...
eg.
~~~ python
xe.frob_norm(xe.Tensor.identity({10,10})(i&0))
~~~Version 3.0Fuchsi*Fuchsi*https://git.hemio.de/xerus/xerus/-/issues/191allow pickling tensors, tensor networks etc.2019-06-17T14:22:02+02:00Fuchsi*allow pickling tensors, tensor networks etc.- [x] add tests for tensors
- [x] add tests for tttensor
- [x] add tests for httensor
- [x] add tests for tensor networks- [x] add tests for tensors
- [x] add tests for tttensor
- [x] add tests for httensor
- [x] add tests for tensor networksVersion 4.0Philipp TrunschkePhilipp Trunschkehttps://git.hemio.de/xerus/xerus/-/issues/190pydoc strings2019-03-12T16:25:44+01:00Fuchsi*pydoc stringsVersion Xhttps://git.hemio.de/xerus/xerus/-/issues/189modifications of Tensor Networks in python2019-04-03T18:53:01+02:00Fuchsi*modifications of Tensor Networks in pythonhttps://git.hemio.de/xerus/xerus/-/issues/186tests for python-interface2019-06-13T12:57:05+02:00Fuchsi*tests for python-interfaceTo ensure that the python wrapper works as intended we should write a number of unittests in python. As any of these tests also test the library itself it might be worthwhile to replace a larger portion of the unittests with a python var...To ensure that the python wrapper works as intended we should write a number of unittests in python. As any of these tests also test the library itself it might be worthwhile to replace a larger portion of the unittests with a python variant.
One aspect should be a comparison to numpy-results.
Current errors in the pybind11-bindings:
- [x] `xe.Tensor(xe.TTTensor([2]))` raises `ValueError`
- [x] segfault in `test_pickle.py` with python2-bindingsVersion 4.0https://git.hemio.de/xerus/xerus/-/issues/92language support: python2018-04-23T03:03:37+02:00Fuchsi*language support: python- [x] write boost python converter from python::list to std::vector<size_t>
- [x] export of our basic functionality
- [x] export measurement sets and completion algorithms
- [x] export factorizations
- [x] export streamWriter
- [x] tran...- [x] write boost python converter from python::list to std::vector<size_t>
- [x] export of our basic functionality
- [x] export measurement sets and completion algorithms
- [x] export factorizations
- [x] export streamWriter
- [x] translate exceptions to python?
- [x] pack arguments for variadic argument lists, see http://stackoverflow.com/questions/11904015/calling-a-python-function-with-variable-number-of-input-arguments-from-boost-pyt (part two of answer, .py file can be replaced by `boost::python::exec(str)`)
- [ ] ~~allow import of ttToolbox like tt-tensors~~
- [ ] allow modification of TensorNetworks
- [x] allow conversion of numpy arrays to tensor etc.
- [ ] allow named arguments, replace overloads with default arguments `(arg("x")=1.0, arg("y")=0.0)`
- [ ] check for dangling pointers or objects
- [ ] add pydoc strings to all classes and functions
- [ ] create python documentation and include it on libxerus.org
- [ ] allow pickling tensors and tensor networks etc.Version 3.0Fuchsi*Fuchsi*