xerus issueshttps://git.hemio.de/xerus/xerus/-/issues2020-04-21T08:27:21Zhttps://git.hemio.de/xerus/xerus/-/issues/263replace `TTOpertor.degrees_of_freedom` with `xe.degrees_of_freedom` in the py...2020-04-21T08:27:21ZPhilipp 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-21T08:19:54ZNando 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):
"""
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
```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-18T14:46:30ZPhilipp 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-16T20:32:46ZPhilipp Trunschketest pickling of random tensor networkshttps://git.hemio.de/xerus/xerus/-/issues/251Bug with fenics and mkl2019-04-10T13:29:08ZPhilipp 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 architecture
Processor optimization: Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors
================================================================
```
[Working example is attached.](/uploads/657409540901107570a60a2d1a340483/xerus___dolfin___libmkl___buggy.py)```
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/228Tidy up UQ ADF2019-06-16T18:37:18ZSebastian 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 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`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/190pydoc strings2019-03-12T15:25:44ZFuchsi*pydoc stringsVersion Xhttps://git.hemio.de/xerus/xerus/-/issues/186tests for python-interface2019-06-13T10:57:05ZFuchsi*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 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-bindingsTo 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.0