TiledArray  0.7.0
Non-intrusive tile interface

Typedefs

template<typename... T>
using TiledArray::result_of_subt_t = decltype(subt(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_subt_to_t = decltype(subt_to(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_mult_t = decltype(mult(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_mult_to_t = decltype(mult_to(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_neg_t = decltype(neg(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_neg_to_t = decltype(neg_to(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_conj_t = decltype(conj(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_conj_to_t = decltype(conj_to(std::declval< T >()...))
 
template<typename... T>
using TiledArray::result_of_gemm_t = decltype(gemm(std::declval< T >()...))
 
template<typename T >
using TiledArray::result_of_trace_t = decltype(mult(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_sum_t = decltype(sum(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_product_t = decltype(product(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_squared_norm_t = decltype(squared_norm(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_norm_t = decltype(norm(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_max_t = decltype(max(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_min_t = decltype(min(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_abs_max_t = decltype(abs_max(std::declval< T >()))
 
template<typename T >
using TiledArray::result_of_abs_min_t = decltype(abs_min(std::declval< T >()))
 
template<typename L , typename R >
using TiledArray::result_of_dot_t = decltype(dot(std::declval< L >(), std::declval< R >()))
 

Functions

template<typename Arg >
bool TiledArray::empty (const Arg &arg)
 Check that arg is empty (no data) More...
 
template<typename Left , typename Right >
auto TiledArray::subt (const Left &left, const Right &right)
 Subtract tile arguments. More...
 
template<typename Left , typename Right , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt (const Left &left, const Right &right, const Scalar factor)
 Subtract and scale tile arguments. More...
 
template<typename Left , typename Right >
auto TiledArray::subt (const Left &left, const Right &right, const Permutation &perm)
 Subtract and permute tile arguments. More...
 
template<typename Left , typename Right , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt (const Left &left, const Right &right, const Scalar factor, const Permutation &perm)
 Subtract, scale, and permute tile arguments. More...
 
template<typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt (const Arg &arg, const Scalar value)
 Subtract a scalar constant from the tile argument. More...
 
template<typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt (const Arg &arg, const Scalar value, const Permutation &perm)
 Subtract a constant scalar and permute tile argument. More...
 
template<typename Result , typename Arg >
Result & TiledArray::subt_to (Result &result, const Arg &arg)
 Subtract from the result tile. More...
 
template<typename Result , typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
Result & TiledArray::subt_to (Result &result, const Arg &arg, const Scalar factor)
 Subtract and scale from the result tile. More...
 
template<typename Result , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
Result & TiledArray::subt_to (Result &result, const Scalar value)
 Subtract constant scalar from the result tile. More...
 
template<typename Left , typename Right >
auto TiledArray::mult (const Left &left, const Right &right)
 Multiplication tile arguments. More...
 
template<typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::mult (const Left &left, const Right &right, const Scalar factor)
 Multiplication and scale tile arguments. More...
 
template<typename Left , typename Right >
auto TiledArray::mult (const Left &left, const Right &right, const Permutation &perm)
 Multiplication and permute tile arguments. More...
 
template<typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::mult (const Left &left, const Right &right, const Scalar factor, const Permutation &perm)
 Multiplication, scale, and permute tile arguments. More...
 
template<typename Result , typename Arg >
Result & TiledArray::mult_to (Result &result, const Arg &arg)
 Multiply to the result tile. More...
 
template<typename Result , typename Arg , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
Result & TiledArray::mult_to (Result &result, const Arg &arg, const Scalar factor)
 Multiply and scale to the result tile. More...
 
template<typename Arg >
auto TiledArray::neg (const Arg &arg)
 Negate the tile argument. More...
 
template<typename Arg >
auto TiledArray::neg (const Arg &arg, const Permutation &perm)
 Negate and permute tile argument. More...
 
template<typename Result >
Result & TiledArray::neg_to (Result &result)
 Multiplication constant scalar to a tile. More...
 
template<typename Arg >
auto TiledArray::conj (const Arg &arg)
 Create a complex conjugated copy of a tile. More...
 
template<typename Arg , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::conj (const Arg &arg, const Scalar factor)
 Create a complex conjugated and scaled copy of a tile. More...
 
template<typename Arg >
auto TiledArray::conj (const Arg &arg, const Permutation &perm)
 Create a complex conjugated and permuted copy of a tile. More...
 
template<typename Arg , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::conj (const Arg &arg, const Scalar factor, const Permutation &perm)
 Create a complex conjugated, scaled, and permuted copy of a tile. More...
 
template<typename Result >
Result & TiledArray::conj_to (Result &result)
 In-place complex conjugate a tile. More...
 
template<typename Result , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
Result & TiledArray::conj_to (Result &result, const Scalar factor)
 In-place complex conjugate and scale a tile. More...
 
template<typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::gemm (const Left &left, const Right &right, const Scalar factor, const math::GemmHelper &gemm_config)
 Contract and scale tile arguments. More...
 
template<typename Result , typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
Result & TiledArray::gemm (Result &result, const Left &left, const Right &right, const Scalar factor, const math::GemmHelper &gemm_config)
 Contract and scale tile arguments to the result tile. More...
 
template<typename Arg >
auto TiledArray::trace (const Arg &arg)
 Sum the hyper-diagonal elements a tile. More...
 
template<typename Arg >
auto TiledArray::sum (const Arg &arg)
 Sum the elements of a tile. More...
 
template<typename Arg >
auto TiledArray::product (const Arg &arg)
 Multiply the elements of a tile. More...
 
template<typename Arg >
auto TiledArray::squared_norm (const Arg &arg)
 Squared vector 2-norm of the elements of a tile. More...
 
template<typename Arg >
auto TiledArray::norm (const Arg &arg)
 Vector 2-norm of a tile. More...
 
template<typename Arg >
auto TiledArray::max (const Arg &arg)
 Maximum element of a tile. More...
 
template<typename Arg >
auto TiledArray::min (const Arg &arg)
 Minimum element of a tile. More...
 
template<typename Arg >
auto TiledArray::abs_max (const Arg &arg)
 Absolute maximum element of a tile. More...
 
template<typename Arg >
auto TiledArray::abs_min (const Arg &arg)
 Absolute mainimum element of a tile. More...
 
template<typename Left , typename Right >
auto TiledArray::dot (const Left &left, const Right &right)
 Vector dot product of two tiles. More...
 
template<typename Left , typename Right >
auto TiledArray::inner_product (const Left &left, const Right &right)
 Vector inner product of two tiles. More...
 

Detailed Description

Introduction

To use a user defined tile types in TiledArray expressions, users must define a set of interface function that define basic arithmetic and query operations. It is not necessary to define all operations, only those that are required for the algebraic tensor operations used in your application. However, more than one function may be necessary for a given expression operator. Each function has an intrusive and non-intrusive interface that may be used to implement the required functionality. Below is a description of each interface function, the intrusive and non-intrusive function signatures of the function, and, in some cases, a reference implementation. The reference implementation assumes that the tensor type has a range() member for convenience, but this is not necessary. Tensor implementations may have any arbitrary range interface function(s).

Minimum Tile Requirements

The minimum requirements for user defined tile types are:

  • An accessible copy constructor
  • An accessible destructor
  • Must be a shallow copy object

TiledArray assumes tiles are shallow copy objects for efficiency when coping objects and to avoid unnecessary replication of data. A shallow copy object is an object that only copies a pointer (and updates a reference counter) instead of explicitly copying all elements of the tile. If your tile object is not a shallow copy object, you can use the TiledArray::Tile class to wrap the object.

Interface and Naming Convention

The naming convention used for interface functions is:

  • xxxx - Base xxxx operation that creates a new tile object from the input arguments.
  • xxxx_to - Base xxxx operation that modifies the first argument or calling object in-place (without constructing an new object).

where xxxx represent the arithmetic/mutating operation performed by the interface function, which includes:

  • add
  • subt
  • mult
  • scal
  • gemm
  • neg
  • shift

There are multiple overloaded version of these function, which combine scaling, permuting, or scaling and permuting operations with the base arithmetic/mutating operation.

In the following sections, TensorType is used to represent an arbitrary user-defined tile type that meets the minimum requirements specified above. ScalarType is used to represent an built-in scalar data type (e.g. int, float, etc.). The example code below is used for demonstration purposes and may not be the an optimal solution.

Required Functions

The minimum set of functions required are:

  • empty
  • clone
  • permute
  • scale

These functions are necessary for all tile operations.

Empty

The empty function checks that the tile object has been initialized and is usable in arithmetic operations. It returns true if the tile has not been initialized, otherwise false. It is possible for empty to always return false, if the tile type does not support default construction (or uninitialized) objects.

Non-intrusive interface:

bool empty(const TensorType& tensor);

Intrusive interface:

Clone

The clone function creates a "deep" copy of a tensor, i.e. all data elements of the tile are explicitly copied to a new object.

Non-intrusive interface:

TensorType clone(const TensorType& tensor);

Intrusive interface:

TensorType TensorType::clone();

Permute

The permute function reorders the data of an input tile by swapping the indices in the output tile. For example, the transpose of a matrix is the equivalent of permutation P(1,0), where indices 0 and 1 are swapped. The implementation of permute must support arbitrary permutations up to the highest rank supported by the tile type.

Non-intrusive interface:

TensorType permute(const TensorType& arg, const TiledArray::Permutation& perm);

Intrusive interface:

Example:

The following code constructs a permuted copy of the argument. The example code assumes TensorType has a range() member function that returns a TiledArray::Range object. However, this is an implementation detail that is not necessary.

TensorType
permute(const TensorType& arg, const TiledArray::Permutation& perm) {
// Get tile boundaries
const auto lobound = arg.range().lobound();
const auto upbound = arg.range().upbound();
// Construct the result tile with a permuted range
TensorType result(perm * arg.range());
// Iterate over tile elements
for(auto it = arg.range().begin(); it < arg.range().end(); ++it) {
// Get the coordinate index of the argument and the result element
const auto index = it.index();
const auto perm_index = perm * it.index();
result(perm_index) = arg(index);
}
return result;
}

Scale

The scale interface consists of two function groups scale and scale_to.

Non-intrusive interface:

TensorType scale(const TensorType& arg, const ScalarType factor); // (1)
TensorType scale(const TensorType& arg, const ScalarType factor, // (2)
TensorType& scale_to(TensorType& arg, const ScalarType factor); // (3)

Intrusive interface:

TensorType TensorType::scale(const ScalarType factor); // (1)
TensorType TensorType::scale(const ScalarType factor, // (2)
TensorType& TensorType::scale_to(const ScalarType factor); // (3)

Function (1) creates a copy of the argument tensor that is scaled by factor, (2) creates a copy of the argument tensor that is scaled by factor and permtued by perm, and (3) scales the argument tensor in-place (without creating a copy).

Example:

TensorType
scale(const TensorType& arg, const ScalarType factor) {
// Construct the result tile
TensorType result(arg.range());
std::transform(arg.begin(), arg.end(), result.begin(),
[] (const TensorType& value) { return value * factor; });
return result;
}

Tile Addition Interface

The tile addition interface include several functions, which are required for to implement simple addition operations.

Typedef Documentation

◆ result_of_abs_max_t

template<typename T >
using TiledArray::result_of_abs_max_t = typedef decltype(abs_max(std::declval<T>()))

Definition at line 785 of file tile_interface.h.

◆ result_of_abs_min_t

template<typename T >
using TiledArray::result_of_abs_min_t = typedef decltype(abs_min(std::declval<T>()))

Definition at line 788 of file tile_interface.h.

◆ result_of_conj_t

template<typename... T>
using TiledArray::result_of_conj_t = typedef decltype(conj(std::declval<T>()...))

Definition at line 605 of file tile_interface.h.

◆ result_of_conj_to_t

template<typename... T>
using TiledArray::result_of_conj_to_t = typedef decltype(conj_to(std::declval<T>()...))

Definition at line 608 of file tile_interface.h.

◆ result_of_dot_t

template<typename L , typename R >
using TiledArray::result_of_dot_t = typedef decltype(dot(std::declval<L>(), std::declval<R>()))

Definition at line 791 of file tile_interface.h.

◆ result_of_gemm_t

template<typename... T>
using TiledArray::result_of_gemm_t = typedef decltype(gemm(std::declval<T>()...))

Definition at line 655 of file tile_interface.h.

◆ result_of_max_t

template<typename T >
using TiledArray::result_of_max_t = typedef decltype(max(std::declval<T>()))

Definition at line 779 of file tile_interface.h.

◆ result_of_min_t

template<typename T >
using TiledArray::result_of_min_t = typedef decltype(min(std::declval<T>()))

Definition at line 782 of file tile_interface.h.

◆ result_of_mult_t

template<typename... T>
using TiledArray::result_of_mult_t = typedef decltype(mult(std::declval<T>()...))

Definition at line 483 of file tile_interface.h.

◆ result_of_mult_to_t

template<typename... T>
using TiledArray::result_of_mult_to_t = typedef decltype(mult_to(std::declval<T>()...))

Definition at line 486 of file tile_interface.h.

◆ result_of_neg_t

template<typename... T>
using TiledArray::result_of_neg_t = typedef decltype(neg(std::declval<T>()...))

Definition at line 522 of file tile_interface.h.

◆ result_of_neg_to_t

template<typename... T>
using TiledArray::result_of_neg_to_t = typedef decltype(neg_to(std::declval<T>()...))

Definition at line 525 of file tile_interface.h.

◆ result_of_norm_t

template<typename T >
using TiledArray::result_of_norm_t = typedef decltype(norm(std::declval<T>()))

Definition at line 776 of file tile_interface.h.

◆ result_of_product_t

template<typename T >
using TiledArray::result_of_product_t = typedef decltype(product(std::declval<T>()))

Definition at line 770 of file tile_interface.h.

◆ result_of_squared_norm_t

template<typename T >
using TiledArray::result_of_squared_norm_t = typedef decltype(squared_norm(std::declval<T>()))

Definition at line 773 of file tile_interface.h.

◆ result_of_subt_t

template<typename... T>
using TiledArray::result_of_subt_t = typedef decltype(subt(std::declval<T>()...))

Definition at line 393 of file tile_interface.h.

◆ result_of_subt_to_t

template<typename... T>
using TiledArray::result_of_subt_to_t = typedef decltype(subt_to(std::declval<T>()...))

Definition at line 396 of file tile_interface.h.

◆ result_of_sum_t

template<typename T >
using TiledArray::result_of_sum_t = typedef decltype(sum(std::declval<T>()))

Definition at line 767 of file tile_interface.h.

◆ result_of_trace_t

template<typename T >
using TiledArray::result_of_trace_t = typedef decltype(mult(std::declval<T>()))

Definition at line 764 of file tile_interface.h.

Function Documentation

◆ abs_max()

template<typename Arg >
auto TiledArray::abs_max ( const Arg &  arg)
inline

Absolute maximum element of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to find the maximum
Returns
A scalar that is equal to abs(max(arg))

Definition at line 729 of file tile_interface.h.

◆ abs_min()

template<typename Arg >
auto TiledArray::abs_min ( const Arg &  arg)
inline

Absolute mainimum element of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to find the minimum
Returns
A scalar that is equal to abs(min(arg))

Definition at line 738 of file tile_interface.h.

◆ conj() [1/4]

template<typename Arg >
auto TiledArray::conj ( const Arg &  arg)
inline

Create a complex conjugated copy of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe tile to be conjugated
Returns
A complex conjugated copy of arg

Definition at line 536 of file tile_interface.h.

◆ conj() [2/4]

template<typename Arg , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::conj ( const Arg &  arg,
const Scalar  factor 
)
inline

Create a complex conjugated and scaled copy of a tile.

Template Parameters
ArgThe tile argument type
ScalarA scalar type
Parameters
argThe tile to be conjugated
factorThe scaling factor
Returns
A complex conjugated and scaled copy of arg

Definition at line 550 of file tile_interface.h.

◆ conj() [3/4]

template<typename Arg >
auto TiledArray::conj ( const Arg &  arg,
const Permutation perm 
)
inline

Create a complex conjugated and permuted copy of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe tile to be conjugated
permThe permutation to be applied to arg
Returns
A complex conjugated and permuted copy of arg

Definition at line 560 of file tile_interface.h.

◆ conj() [4/4]

template<typename Arg , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::conj ( const Arg &  arg,
const Scalar  factor,
const Permutation perm 
)
inline

Create a complex conjugated, scaled, and permuted copy of a tile.

Template Parameters
ArgThe tile argument type
ScalarA scalar type
Parameters
argThe argument to be conjugated
factorThe scaling factor
permThe permutation to be applied to arg
Returns
A complex conjugated, scaled, and permuted copy of arg

Definition at line 575 of file tile_interface.h.

◆ conj_to() [1/2]

template<typename Result >
Result& TiledArray::conj_to ( Result &  result)
inline

In-place complex conjugate a tile.

Template Parameters
ResultThe tile type
Parameters
resultThe tile to be conjugated
Returns
A reference to result

Definition at line 584 of file tile_interface.h.

◆ conj_to() [2/2]

template<typename Result , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
Result& TiledArray::conj_to ( Result &  result,
const Scalar  factor 
)
inline

In-place complex conjugate and scale a tile.

Template Parameters
ResultThe tile type
ScalarA scalar type
Parameters
resultThe tile to be conjugated
factorThe scaling factor
Returns
A reference to result

Definition at line 599 of file tile_interface.h.

◆ dot()

template<typename Left , typename Right >
auto TiledArray::dot ( const Left &  left,
const Right &  right 
)
inline

Vector dot product of two tiles.

Template Parameters
LeftThe left-hand argument tile type
RightThe right-hand argument tile type
Parameters
leftThe left-hand argument tile
rightThe right-hand argument tile
Returns
A scalar that is equal to sum_i left[i] * right[i]

Definition at line 749 of file tile_interface.h.

◆ empty()

template<typename Arg >
bool TiledArray::empty ( const Arg &  arg)
inline

Check that arg is empty (no data)

Template Parameters
ArgThe tile argument type
Parameters
argThe tile argument to be checked
Returns
true if arg is empty, otherwise false.

Definition at line 267 of file tile_interface.h.

◆ gemm() [1/2]

template<typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::gemm ( const Left &  left,
const Right &  right,
const Scalar  factor,
const math::GemmHelper gemm_config 
)
inline

Contract and scale tile arguments.

The contraction is done via a GEMM operation with fused indices as defined by gemm_config.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
ScalarA scalar type
Parameters
leftThe left-hand argument to be contracted
rightThe right-hand argument to be contracted
factorThe scaling factor
gemm_configA helper object used to simplify gemm operations
Returns
A tile that is equal to (left * right) * factor

Definition at line 627 of file tile_interface.h.

◆ gemm() [2/2]

template<typename Result , typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
Result& TiledArray::gemm ( Result &  result,
const Left &  left,
const Right &  right,
const Scalar  factor,
const math::GemmHelper gemm_config 
)
inline

Contract and scale tile arguments to the result tile.

The contraction is done via a GEMM operation with fused indices as defined by gemm_config.

Template Parameters
ResultThe result tile type
LeftThe left-hand tile type
RightThe right-hand tile type
ScalarA scalar type
Parameters
resultThe contracted result
leftThe left-hand argument to be contracted
rightThe right-hand argument to be contracted
factorThe scaling factor
gemm_configA helper object used to simplify gemm operations
Returns
A tile that is equal to result = (left * right) * factor

Definition at line 647 of file tile_interface.h.

◆ inner_product()

template<typename Left , typename Right >
auto TiledArray::inner_product ( const Left &  left,
const Right &  right 
)
inline

Vector inner product of two tiles.

Template Parameters
LeftThe left-hand argument tile type
RightThe right-hand argument tile type
Parameters
leftThe left-hand argument tile
rightThe right-hand argument tile
Returns
A scalar that is equal to sum_i conj(left[i]) * right[i]

Definition at line 760 of file tile_interface.h.

Here is the caller graph for this function:

◆ max()

template<typename Arg >
auto TiledArray::max ( const Arg &  arg)
inline

Maximum element of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to find the maximum
Returns
A scalar that is equal to max(arg)

Definition at line 711 of file tile_interface.h.

◆ min()

template<typename Arg >
auto TiledArray::min ( const Arg &  arg)
inline

Minimum element of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to find the minimum
Returns
A scalar that is equal to min(arg)

Definition at line 720 of file tile_interface.h.

◆ mult() [1/4]

template<typename Left , typename Right >
auto TiledArray::mult ( const Left &  left,
const Right &  right 
)
inline

Multiplication tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
Parameters
leftThe left-hand argument to be multiplied
rightThe right-hand argument to be multiplied
Returns
A tile that is equal to (left * right)

Definition at line 409 of file tile_interface.h.

◆ mult() [2/4]

template<typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::mult ( const Left &  left,
const Right &  right,
const Scalar  factor 
)
inline

Multiplication and scale tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
ScalarA scalar type
Parameters
leftThe left-hand argument to be multiplied
rightThe right-hand argument to be multiplied
factorThe scaling factor
Returns
A tile that is equal to (left * right) * factor

Definition at line 423 of file tile_interface.h.

◆ mult() [3/4]

template<typename Left , typename Right >
auto TiledArray::mult ( const Left &  left,
const Right &  right,
const Permutation perm 
)
inline

Multiplication and permute tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
Parameters
leftThe left-hand argument to be multiplied
rightThe right-hand argument to be multiplied
permThe permutation to be applied to the result
Returns
A tile that is equal to perm ^ (left * right)

Definition at line 436 of file tile_interface.h.

◆ mult() [4/4]

template<typename Left , typename Right , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::mult ( const Left &  left,
const Right &  right,
const Scalar  factor,
const Permutation perm 
)
inline

Multiplication, scale, and permute tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
ScalarA scalar type
Parameters
leftThe left-hand argument to be multiplied
rightThe right-hand argument to be multiplied
factorThe scaling factor
permThe permutation to be applied to the result
Returns
A tile that is equal to perm ^ (left * right) * factor

Definition at line 451 of file tile_interface.h.

◆ mult_to() [1/2]

template<typename Result , typename Arg >
Result& TiledArray::mult_to ( Result &  result,
const Arg &  arg 
)
inline

Multiply to the result tile.

Template Parameters
ResultThe result tile type
ArgThe argument tile type
Parameters
resultThe result tile to be multiplied
argThe argument to be multiplied by the result
Returns
A tile that is equal to result *= arg

Definition at line 463 of file tile_interface.h.

◆ mult_to() [2/2]

template<typename Result , typename Arg , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric< Scalar >::value >::type * = nullptr>
Result& TiledArray::mult_to ( Result &  result,
const Arg &  arg,
const Scalar  factor 
)
inline

Multiply and scale to the result tile.

Template Parameters
ResultThe result tile type
ArgThe argument tile type
ScalarA scalar type
Parameters
resultThe result tile to be multiplied
argThe argument to be multiplied by result
factorThe scaling factor
Returns
A tile that is equal to (result *= arg) *= factor

Definition at line 477 of file tile_interface.h.

◆ neg() [1/2]

template<typename Arg >
auto TiledArray::neg ( const Arg &  arg)
inline

Negate the tile argument.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to be negated
Returns
A tile that is equal to -arg

Definition at line 498 of file tile_interface.h.

◆ neg() [2/2]

template<typename Arg >
auto TiledArray::neg ( const Arg &  arg,
const Permutation perm 
)
inline

Negate and permute tile argument.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to be negated
permThe permutation to be applied to the result
Returns
A tile that is equal to perm ^ -arg

Definition at line 508 of file tile_interface.h.

◆ neg_to()

template<typename Result >
Result& TiledArray::neg_to ( Result &  result)
inline

Multiplication constant scalar to a tile.

Template Parameters
ResultThe result tile type
Parameters
resultThe result tile to be negated
Returns
A tile that is equal to result = -result

Definition at line 517 of file tile_interface.h.

◆ norm()

template<typename Arg >
auto TiledArray::norm ( const Arg &  arg)
inline

Vector 2-norm of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to be multiplied and summed
Returns
A scalar that is equal to sqrt(sum_i arg[i] * arg[i])

Definition at line 702 of file tile_interface.h.

◆ product()

template<typename Arg >
auto TiledArray::product ( const Arg &  arg)
inline

Multiply the elements of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to be multiplied
Returns
A scalar that is equal to prod_i arg[i]

Definition at line 683 of file tile_interface.h.

◆ squared_norm()

template<typename Arg >
auto TiledArray::squared_norm ( const Arg &  arg)
inline

Squared vector 2-norm of the elements of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to be multiplied and summed
Returns
The sum of the squared elements of arg
A scalar that is equal to sum_i arg[i] * arg[i]

Definition at line 693 of file tile_interface.h.

◆ subt() [1/6]

template<typename Left , typename Right >
auto TiledArray::subt ( const Left &  left,
const Right &  right 
)
inline

Subtract tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
Parameters
leftThe left-hand argument to be subtracted
rightThe right-hand argument to be subtracted
Returns
A tile that is equal to (left - right)

Definition at line 282 of file tile_interface.h.

◆ subt() [2/6]

template<typename Left , typename Right , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt ( const Left &  left,
const Right &  right,
const Scalar  factor 
)
inline

Subtract and scale tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
ScalarA scalar type
Parameters
leftThe left-hand argument to be subtracted
rightThe right-hand argument to be subtracted
factorThe scaling factor
Returns
A tile that is equal to (left - right) * factor

Definition at line 296 of file tile_interface.h.

◆ subt() [3/6]

template<typename Left , typename Right >
auto TiledArray::subt ( const Left &  left,
const Right &  right,
const Permutation perm 
)
inline

Subtract and permute tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
Parameters
leftThe left-hand argument to be subtracted
rightThe right-hand argument to be subtracted
permThe permutation to be applied to the result
Returns
A tile that is equal to perm ^ (left - right)

Definition at line 309 of file tile_interface.h.

◆ subt() [4/6]

template<typename Left , typename Right , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt ( const Left &  left,
const Right &  right,
const Scalar  factor,
const Permutation perm 
)
inline

Subtract, scale, and permute tile arguments.

Template Parameters
LeftThe left-hand tile type
RightThe right-hand tile type
ScalarA scalar type
Parameters
leftThe left-hand argument to be subtracted
rightThe right-hand argument to be subtracted
factorThe scaling factor
permThe permutation to be applied to the result
Returns
A tile that is equal to perm ^ (left - right) * factor

Definition at line 324 of file tile_interface.h.

◆ subt() [5/6]

template<typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt ( const Arg &  arg,
const Scalar  value 
)
inline

Subtract a scalar constant from the tile argument.

Template Parameters
ArgThe tile argument type
ScalarA scalar type
Parameters
argThe left-hand argument to be subtracted
valueThe constant scalar to be subtracted
Returns
A tile that is equal to arg - value

Definition at line 337 of file tile_interface.h.

◆ subt() [6/6]

template<typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
auto TiledArray::subt ( const Arg &  arg,
const Scalar  value,
const Permutation perm 
)
inline

Subtract a constant scalar and permute tile argument.

Template Parameters
ArgThe tile argument type
ScalarA scalar type
Parameters
argThe left-hand argument to be subtracted
valueThe constant scalar value to be subtracted
permThe permutation to be applied to the result
Returns
A tile that is equal to perm ^ (arg - value)

Definition at line 351 of file tile_interface.h.

◆ subt_to() [1/3]

template<typename Result , typename Arg >
Result& TiledArray::subt_to ( Result &  result,
const Arg &  arg 
)
inline

Subtract from the result tile.

Template Parameters
ResultThe result tile type
ArgThe argument tile type
Parameters
resultThe result tile
argThe argument to be subtracted from the result
Returns
A tile that is equal to result[i] -= arg[i]

Definition at line 362 of file tile_interface.h.

◆ subt_to() [2/3]

template<typename Result , typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
Result& TiledArray::subt_to ( Result &  result,
const Arg &  arg,
const Scalar  factor 
)
inline

Subtract and scale from the result tile.

Template Parameters
ResultThe result tile type
ArgThe argument tile type
ScalarA scalar type
Parameters
resultThe result tile
argThe argument to be subtracted from result
factorThe scaling factor
Returns
A tile that is equal to (result -= arg) *= factor

Definition at line 376 of file tile_interface.h.

◆ subt_to() [3/3]

template<typename Result , typename Scalar , typename std::enable_if< detail::is_numeric< Scalar >::value >::type * = nullptr>
Result& TiledArray::subt_to ( Result &  result,
const Scalar  value 
)
inline

Subtract constant scalar from the result tile.

Template Parameters
ResultThe result tile type
ScalarA scalar type
Parameters
resultThe result tile
valueThe constant scalar to be subtracted from result
Returns
A tile that is equal to (result -= arg) *= factor

Definition at line 388 of file tile_interface.h.

◆ sum()

template<typename Arg >
auto TiledArray::sum ( const Arg &  arg)
inline

Sum the elements of a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to be summed
Returns
A scalar that is equal to sum_i arg[i]

Definition at line 674 of file tile_interface.h.

◆ trace()

template<typename Arg >
auto TiledArray::trace ( const Arg &  arg)
inline

Sum the hyper-diagonal elements a tile.

Template Parameters
ArgThe tile argument type
Parameters
argThe argument to be summed
Returns
The sum of the hyper-diagonal elements of arg

Definition at line 665 of file tile_interface.h.