1#ifndef TATOOINE_EINSTEIN_NOTATION_OPERATOR_OVERLOADS_H
2#define TATOOINE_EINSTEIN_NOTATION_OPERATOR_OVERLOADS_H
13template <
typename TensorLHS,
index... IndicesLHS,
typename TensorRHS,
22template <
typename TensorLHS,
index... IndicesLHS,
typename TensorRHS,
29template <
typename TensorLHS,
index... IndicesLHS,
typename TensorRHS,
38template <
typename TensorLHS,
index... IndicesLHS,
typename TensorRHS,
45template <
typename... IndexedTensorLHS,
typename TensorRHS,
index... IndicesRHS,
46 std::size_t... LHSSeq>
49 std::index_sequence<LHSSeq...> ) {
52 lhs.template at<LHSSeq>()..., rhs};
55template <
typename... IndexedTensorLHS,
typename TensorRHS,
index... IndicesRHS>
59 std::make_index_sequence<
sizeof...(IndexedTensorLHS)>{});
62template <
typename... IndexedTensorLHS,
typename TensorRHS,
index... IndicesRHS>
68template <
index... IndicesLHS,
typename TensorLHS,
typename... IndexedTensorRHS,
69 std::size_t... RHSSeq>
72 std::index_sequence<RHSSeq...> ) {
75 lhs, rhs.template at<RHSSeq>()...};
78template <
index... IndicesLHS,
typename TensorLHS,
typename... IndexedTensorRHS>
82 std::make_index_sequence<
sizeof...(IndexedTensorRHS)>{});
85template <
typename TensorLHS,
index... IndicesLHS,
typename... IndexedTensorRHS>
91template <
typename TensorLHS,
index... IndicesLHS,
typename TensorRHS,
102template <
typename... IndexedTensorLHS,
typename TensorRHS,
index... IndicesRHS>
111template <
typename TensorLHS,
index... IndicesLHS,
typename... TensorsRHS>
120template <
typename... TensorsLHS,
typename... TensorsRHS>
126template <
typename... ContractedTensorsLHS,
typename... TensorsRHS,
130 std::index_sequence<Seq...>) {
134template <
typename... TensorsLHS,
typename... ContractedTensorsRHS,
138 std::index_sequence<Seq...>) {
142template <
typename... ContractedTensorsLHS,
typename... ContractedTensorsRHS,
143 std::size_t... Seq0, std::size_t... Seq1>
146 std::index_sequence<Seq0...>, std::index_sequence<Seq1...>) {
148 rhs.template at<Seq1>()...};
151template <
typename... ContractedTensorsLHS,
typename... TensorsRHS>
155 std::make_index_sequence<
sizeof...(ContractedTensorsLHS)>{});
158template <
typename... TensorsLHS,
typename... ContractedTensorsRHS>
162 std::make_index_sequence<
sizeof...(ContractedTensorsRHS)>{});
165template <
typename... ContractedTensorsLHS,
typename... ContractedTensorsRHS>
169 std::make_index_sequence<
sizeof...(ContractedTensorsLHS)>{},
170 std::make_index_sequence<
sizeof...(ContractedTensorsRHS)>{});
173template <
typename... ContractedTensorsLHS,
typename... TensorsRHS>
176 return add(lhs, rhs);
179template <
typename... TensorsLHS,
typename... ContractedTensorsRHS>
182 return add(lhs, rhs);
185template <
typename... ContractedTensorsLHS,
typename... ContractedTensorsRHS>
188 return add(lhs, rhs);
Definition: added_contracted_dynamic_tensor.h:4
auto add(added_contracted_static_tensor< ContractedTensorsLHS... > lhs, contracted_static_tensor< TensorsRHS... > rhs, std::index_sequence< Seq... >)
Definition: operator_overloads.h:128
auto constexpr contract(indexed_dynamic_tensor< TensorLHS, IndicesLHS... > lhs, indexed_dynamic_tensor< TensorRHS, IndicesRHS... > rhs)
Definition: operator_overloads.h:15
auto operator+(indexed_static_tensor< TensorLHS, IndicesLHS... > lhs, indexed_static_tensor< TensorRHS, IndicesRHS... > rhs)
Definition: operator_overloads.h:93
auto operator*(indexed_dynamic_tensor< TensorLHS, IndicesLHS... > lhs, indexed_dynamic_tensor< TensorRHS, IndicesRHS... > rhs)
Definition: operator_overloads.h:24
auto constexpr index(handle< Child, Int > const h)
Definition: handle.h:119
Definition: added_contracted_static_tensor.h:7
Definition: contracted_dynamic_tensor.h:9
Definition: contracted_static_tensor.h:9
Definition: indexed_dynamic_tensor.h:28
Definition: indexed_static_tensor.h:22