Tensor.change_basis_at

Tensor.change_basis_at(basis, axis)[source]

Change basis of tensor along one or more selected axes.

Slice(None) can be used to indicate no transformation. In contrast to project, this function will first test if the tensor can be fully represented in the new basis and raise a BasisError otherwise.

Parameters
  • basis (IBasis | Sequence[IBasis]) – New basis of tensor for the specified axis.

  • axis (int | Sequence[int]) – One or more axes, along which the basis will be replaced.

Returns

Tensor in new basis.

Return type

Self