T3Tangent.absorb_weights#

t3toolbox.manifold.T3Tangent.absorb_weights(weights)#
def absorb_weights(self, weights: 'bvf.T3FrameWeights') -> 'T3Tangent':

Absorb the metric weights into this tangent’s variation cores (down->V, up/left/right->H), returning the weighted tangent at the same frame. Its corewise_norm() equals weighted_norm().

Warning – the result is not gauged. Scaling the variation coordinates breaks the gauge conditions (the frame’s orthogonality is untouched), so the returned tangent is a coordinate reweighting: corewise_norm() / corewise_inner() are correct on it, but the Hilbert-Schmidt ManifoldGeometry.norm() / inner() need a gauged tangent. Re-gauge with ManifoldGeometry.project_oblique() (which preserves the represented vector) or ManifoldGeometry.project() if you need HS semantics.

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.frame_variations_format as bvf
>>> import t3toolbox.manifold as t3m
>>> np.random.seed(0)
>>> x = t3.TuckerTensorTrain.randn((6, 7, 8), (2, 2, 2), (1, 2, 2, 1))
>>> frame, _ = bvf.t3_orthogonal_representations(x)
>>> v = t3m.MANIFOLD.project_oblique(t3m.COREWISE.randn(frame))   # a gauged tangent at the frame
>>> print(v.is_gauged())
True
>>> W = bvf.T3FrameWeights.from_t3weights(t3.T3Weights.from_t3svd(x))   # a metric (the point's sigmas)
>>> vw = v.absorb_weights(W)                                      # weighted tangent, same frame
>>> print(vw.is_gauged())                                        # weighting broke the gauge...
False
>>> print(t3m.MANIFOLD.project_oblique(vw).is_gauged())          # ...project_oblique re-gauges it
True
Parameters:

weights (T3FrameWeights)

Return type:

T3Tangent