27#include "neml2/misc/defaults.h"
28#include "neml2/tensors/DTensor.h"
29#include "neml2/tensors/functions/einsum.h"
30#include "neml2/tensors/Scalar.h"
31#include "neml2/tensors/Vec.h"
32#include "neml2/tensors/R2.h"
33#include "neml2/tensors/SR2.h"
34#include "neml2/tensors/SSR4.h"
61 throw NEMLException(
"Identity map not implemented for this tensor type.");
125inline DTensor<SSR4, SSR4, typename imap_t<SSR4>::type>
129 return einsum(
"ik,jl", {I, I});
Abstract representation of the derivative of a primitive tensor with respect to another primitive ten...
Definition DTensor.h:67
static Scalar ones(const TensorOptions &options=default_tensor_options())
Definition PrimitiveTensor.h:259
Base class for second order tensor.
Definition R2.h:49
static R2 identity(const TensorOptions &options=default_tensor_options())
Identity.
Definition R2.cxx:121
Fourth order tensor without symmetry.
Definition R4.h:43
The symmetric second order tensor.
Definition SR2.h:46
The symmetric fourth order tensor, with symmetry in the first two dimensionss as well as in the last ...
Definition SSR4.h:44
static SSR4 identity_sym(const TensorOptions &options=default_tensor_options())
Create the symmetric identity tensor .
Definition SSR4.cxx:101
Scalar.
Definition Scalar.h:38
neml2::Tensor base_reshape(TensorShapeRef shape) const
Definition TensorBaseImpl.h:603
static Tensor identity(Size n, const TensorOptions &options=default_tensor_options())
Identity tensor.
Definition Tensor.cxx:221
3-vector.
Definition Vec.h:43
Definition DiagnosticsInterface.cxx:30
Tensor einsum(c10::string_view equation, TensorList tensors)
Einstein summation along base dimensions.
Definition einsum.cxx:31
TensorOptions default_tensor_options()
Default floating point tensor options.
Definition defaults.cxx:42
imap_t< T >::type imap_v(const TensorOptions &options=default_tensor_options())
Get the identity map interpreted as the concrete primitive tensor type.
Definition imap.h:66
DTensor< T, T, typename imap_t< T >::type > imap(const TensorOptions &options=default_tensor_options())
Identity map.
Definition imap.h:59
c10::TensorOptions TensorOptions
Definition types.h:60
Tensor type
Definition imap.h:41