1#ifndef XPED_ADTENSOR_HPP_
2#define XPED_ADTENSOR_HPP_
6#include "stan/math/rev.hpp"
19template <
bool AD,
typename Scalar, std::
size_t Rank, std::
size_t CoRank,
typename Symmetry,
typename AllocationPolicy = HeapPolicy>
24template <
bool AD,
typename Scalar>
25using XScalar = std::conditional_t<AD, stan::math::var_value<Scalar>, Scalar>;
27template <
typename Scalar_, std::
size_t Rank, std::
size_t CoRank,
typename Symmetry_,
typename AllocationPolicy_>
28class Tensor<Scalar_, Rank, CoRank, Symmetry_, true, AllocationPolicy_>
35 using qType =
typename Symmetry::qType;
48 using vari_type = stan::math::vari_value<value_type>;
69 : vi_(new
vari_type(basis_domain, basis_codomain, world))
77 inline const auto&
val() const noexcept {
return vi_->val(); }
78 inline auto&
val_op() noexcept {
return vi_->val_op(); }
79 inline const auto&
detach() const noexcept {
return vi_->val(); }
81 inline auto&
adj() noexcept {
return vi_->adj(); }
82 inline auto&
adj() const noexcept {
return vi_->adj(); }
83 inline auto&
adj_op() noexcept {
return vi_->adj(); }
85 constexpr std::size_t
rank() const noexcept {
return vi_->rank(); }
86 constexpr std::size_t
corank() const noexcept {
return vi_->corank(); }
87 const std::string
name()
const {
return val().name(); }
89 inline const auto&
sector()
const {
return val().sector(); }
90 inline const qType sector(std::size_t i)
const {
return val().sector(i); }
95 std::size_t
plainSize()
const {
return val().plainSize(); }
97 inline const std::array<Qbasis<Symmetry, 1, AllocationPolicy>, Rank>&
uncoupledDomain()
const {
return val().uncoupledDomain(); }
98 inline const std::array<Qbasis<Symmetry, 1, AllocationPolicy>, CoRank>&
uncoupledCodomain()
const {
return val().uncoupledCodomain(); }
105 inline auto begin()
const {
return val_op().begin(); }
106 inline auto end()
const {
return val_op().end(); }
108 inline const auto cbegin()
const {
return val().cbegin(); }
109 inline const auto cend()
const {
return val().cend(); }
111 inline auto gradbegin()
const {
return adj_op().begin(); }
112 inline auto gradend()
const {
return adj_op().end(); }
114 inline const auto cgradbegin()
const {
return adj().cbegin(); }
115 inline const auto cgradend()
const {
return adj().cend(); }
117 inline void set_data(
const Scalar* data, std::size_t size) { val_op().set_data(data, size); }
125 template <
bool TRACK = true>
128 if constexpr(TRACK) {
130 stan::math::reverse_pass_callback([curr = *
this, out]()
mutable {
131 curr.adj() += out.adj().adjoint().eval();
132 SPDLOG_WARN(
"reverse adjoint of {}, input adj norm={}, output adj norm={}", curr.name(), out.adj().norm(), curr.adj().norm());
136 return val().adjoint().eval();
140 template <
int shift, std::size_t... p,
bool TRACK>
143 if constexpr(TRACK) {
145 val().
template permute<shift, p...>(
Bool<false>{}));
146 stan::math::reverse_pass_callback([curr = *
this, out]()
mutable {
148 curr.adj() += out.adj().template permute<-shift>(inverse{},
Bool<false>{});
149 SPDLOG_WARN(
"reverse permute of {}, input adj norm={}, output adj norm={}", curr.name(), out.adj().norm(), curr.adj().norm());
153 return val().template permute<shift, p...>(
Bool<false>{});
157 template <
int shift, std::size_t... p,
bool TRACK>
168 typename OtherScalar,
169 std::size_t OtherRank,
170 std::size_t OtherCoRank,
174 constexpr auto perms = util::constFct::get_permutations<a1, Rank, a2, OtherRank, ResRank>();
175 constexpr auto p1 = std::get<0>(perms);
176 constexpr auto shift1 = std::get<1>(perms);
177 SPDLOG_INFO(
"shift1={}, p1={}", shift1, p1);
178 constexpr auto p2 = std::get<2>(perms);
179 constexpr auto shift2 = std::get<3>(perms);
180 SPDLOG_INFO(
"shift2={}, p2={}", shift2, p2);
181 constexpr auto pres = std::get<4>(perms);
182 constexpr auto shiftres = std::get<5>(perms);
183 SPDLOG_INFO(
"shiftres={}, pres={}", shiftres, pres);
187 return operator*<TRACK>(this->
template permute<shift1>(util::constFct::as_sequence<p1>(),
Bool<TRACK>{}),
188 other.template permute<shift2>(util::constFct::as_sequence<p2>(), Bool<TRACK>{}))
189 .
template permute<shiftres>(util::constFct::as_sequence<pres>(), Bool<TRACK>{});
193 template <
bool TRACK = true>
194 std::tuple<XTensor<TRACK, Scalar, Rank, 1, Symmetry, AllocationPolicy>,
195 XTensor<TRACK, Scalar, 1, 1, Symmetry, AllocationPolicy>,
196 XTensor<TRACK, Scalar, 1, CoRank, Symmetry, AllocationPolicy>>
202 bool PRESERVE_MULTIPLETS =
true,
203 bool RETURN_SPEC =
true) XPED_CONST
205 auto [Uval, Sval_real, Vdagval] = val().tSVD(maxKeep, eps_svd, truncWeight, entropy, SVspec, PRESERVE_MULTIPLETS, RETURN_SPEC);
207 if constexpr(not TRACK) {
208 return std::make_tuple(Uval, Sval, Vdagval);
214 stan::math::reverse_pass_callback([curr = *
this, U, S, Vdag]()
mutable {
215 for(std::size_t i = 0; i < curr.sector().size(); ++i) {
216 SPDLOG_INFO(
"i={}", i);
217 auto it = S.val().dict().find(curr.val().sector(i));
218 if(it == S.val().dict().end()) {
continue; }
220 auto U_b = U.val().block(j);
221 auto S_b = S.val().block(j);
222 auto S_b_real = S_b.real().eval();
223 auto Vdag_b = Vdag.val().block(j);
227 SPDLOG_INFO(
"i={}:\tU.val: {}x{}, U.adj: {}x{}, Vdag.val: {}x{}, Vdag.adj: {}x{}, S.val: {}x{}",
231 U.adj().block(i).rows(),
232 U.adj().block(i).cols(),
235 Vdag.adj().block(i).rows(),
236 Vdag.adj().block(i).cols(),
242 auto F = PlainInterface::unaryFunc<RealScalar>(
243 F_inv, [](
RealScalar d) {
return (std::abs(d) < 1.e-12) ? d / (d * d + 1.e-12) : 1. / d; });
246 auto Vdag_dV = (Vdag_b * Vdag.adj().block(j).adjoint()).eval();
248 auto J = (F.array() * (U_b.adjoint() * U.adj().block(j)).array()).matrix().eval();
249 auto K = (F.array() * Vdag_dV.array()).matrix().eval();
251 using namespace std::complex_literals;
252 auto L = (1i * Eigen::MatrixXcd(Vdag_dV.diagonal().imag().asDiagonal())).eval();
254 curr.adj().block(i) +=
255 U_b * (S.adj().block(j) + (J + J.adjoint()) * S_b + S_b * (K + K.adjoint()) - S_b.diagonal().asDiagonal().inverse() * L) *
258 curr.adj().block(i) += U_b * (S.adj().block(j) + (J + J.adjoint()) * S_b + S_b * (K + K.adjoint())) * Vdag_b;
260 if(U_b.rows() > S_b.rows()) {
261 curr.adj().block(i) += (PlainInterface::Identity<Scalar>(U_b.rows(), U_b.rows(), U.val().world()) - U_b * U_b.adjoint()) *
262 U.adj().block(j) * S_b.diagonal().asDiagonal().inverse() * Vdag_b;
264 if(Vdag_b.cols() > S_b.rows()) {
265 curr.adj().block(i) +=
266 U_b * S_b.diagonal().asDiagonal().inverse() * Vdag.adj().block(j) *
267 (PlainInterface::Identity<Scalar>(Vdag_b.cols(), Vdag_b.cols(), Vdag.val().world()) - Vdag_b.adjoint() * Vdag_b);
272 SPDLOG_WARN(
"reverse svd. U.adj.norm()={}, S.adj.norm()={}, Vdag.adj.norm()={}, output adj norm={}",
279 return std::make_tuple(U, S, Vdag);
283 template <
bool TRACK = true>
284 std::tuple<XTensor<TRACK, Scalar, Rank, 1, Symmetry, AllocationPolicy>,
290 std::map<qarray<Symmetry::Nq>,
VectorType> SVspec_dumb;
292 maxKeep, eps_svd, truncWeight, S_dumb, SVspec_dumb, PRESERVE_MULTIPLETS,
false);
295 template <
bool TRACK = true>
298 if constexpr(TRACK) {
299 Scalar tmp = val().norm();
300 stan::math::var_value<Scalar> res(tmp);
301 stan::math::reverse_pass_callback([curr = *
this, res]()
mutable {
302 curr.adj() += (curr.val() * (res.adj() / res.val())).eval();
303 SPDLOG_WARN(
"reverse norm of {}, input adj norm={}, output adj norm={}", curr.name(), res.adj(), curr.adj().norm());
311 template <
bool TRACK = true>
314 if constexpr(TRACK) {
315 std::size_t max_block;
318 Scalar tmp = val().abs().maxCoeff(max_block, max_row, max_col);
319 stan::math::var_value<Scalar> res(tmp);
320 stan::math::reverse_pass_callback([curr = *
this, res, max_block, max_row, max_col]()
mutable {
324 Zero.block(max_block)(max_row, max_col) = std::signbit(curr.val().block(max_block)(max_row, max_col)) ? -1. : 1.;
326 using namespace std::complex_literals;
327 Zero.block(max_block)(max_row, max_col) =
328 (std::real(curr.val().block(max_block)(max_row, max_col)) + 1i * std::imag(curr.val().block(max_block)(max_row, max_col))) /
329 std::abs(curr.val().block(max_block)(max_row, max_col));
331 curr.adj() += Zero * res.adj();
332 SPDLOG_WARN(
"reverse norm of {}, input adj norm={}, output adj norm={}", curr.name(), res.adj(), curr.adj().norm());
336 return val().maxNorm();
340 template <
bool TRACK = true>
343 if constexpr(TRACK) {
344 Scalar tmp = val().trace();
345 stan::math::var_value<Scalar> res(tmp);
346 stan::math::reverse_pass_callback([curr = *
this, res]()
mutable {
349 curr.adj() += Id * res.adj();
350 SPDLOG_WARN(
"reverse trace of {}, input adj norm={}, output adj norm={}", curr.name(), res.adj(), curr.adj().norm());
354 return val().trace();
368 template <
bool TRACK = true>
371 if constexpr(TRACK) {
373 stan::math::reverse_pass_callback([curr = *
this, res]()
mutable {
374 curr.adj() += res.adj().binaryExpr(res.val().diag_inv().eval(), [](
Scalar d1,
Scalar d2) { return d1 * d2 * 0.5; });
375 SPDLOG_WARN(
"reverse sqrt of {}, input adj norm={}, output adj norm={}", curr.name(), res.adj().norm(), curr.adj().norm());
379 return val().diag_sqrt().eval();
383 template <
bool TRACK = true>
386 if constexpr(TRACK) {
388 stan::math::reverse_pass_callback([curr = *
this, res]()
mutable {
389 curr.adj() += res.adj().diagBinaryExpr((res.val().square()) * -1., [](
Scalar d1,
Scalar d2) { return d1 * d2; }).eval();
390 SPDLOG_WARN(
"reverse diag_inv of {}, input adj norm={}, output adj norm={}", curr.name(), res.adj().norm(), curr.adj().norm());
394 return val().diag_inv().eval();
398 template <
bool TRACK = true>
401 if constexpr(TRACK) {
403 stan::math::reverse_pass_callback([curr = *
this, res, leg]()
mutable {
404 curr.adj() += res.adj().twist(leg);
405 SPDLOG_WARN(
"reverse twist of {}, input adj norm={}, output adj norm={}", curr.name(), res.adj().norm(), curr.adj().norm());
409 return val().twist(leg);
418 void print(std::ostream& o,
bool PRINT_MATRICES =
true)
const { val().print(o, PRINT_MATRICES); }
422 if(v.vi_ ==
nullptr) {
return os <<
"uninitialized"; }
423 return os << v.val();
427template <
bool TRACK = true,
typename Scalar, std::
size_t Rank, std::
size_t CoRank,
typename Symmetry>
430 if constexpr(TRACK) {
431 SPDLOG_CRITICAL(
"BLOCKER");
435 return (t.val() - s).eval();
439template <
bool TRACK = true,
typename Scalar, std::
size_t Rank, std::
size_t CoRank,
typename Symmetry>
442 if constexpr(TRACK) {
443 SPDLOG_CRITICAL(
"BLOCKER");
447 return (t.val() + s).eval();
451template <
bool TRACK = true,
typename Scalar, std::
size_t Rank, std::
size_t CoRank,
typename Symmetry>
454 if constexpr(TRACK) {
456 stan::math::reverse_pass_callback([res, t, s]()
mutable {
457 t.adj() += (res.adj() * s).eval();
458 SPDLOG_WARN(
"reverse vt*d with vt={}, input adj norm={}, output adj norm={}", t.name(), res.adj().norm(), t.adj().norm());
462 return (t.val() * s).eval();
466template <
bool TRACK = true,
typename Scalar, std::
size_t Rank, std::
size_t CoRank,
typename Symmetry>
469 if constexpr(TRACK) {
471 stan::math::reverse_pass_callback([res, t, s]()
mutable {
472 t.adj() += (res.adj() * s.val()).eval();
473 s.adj() += (res.adj() * t.val().adjoint()).trace();
475 "reverse vt*v with vt={}, input adj norm={}, vt adj norm={}, v adj norm={}", t.name(), res.adj().norm(), t.adj().norm(), s.adj());
479 return (t.val() * s.val()).eval();
483template <
bool TRACK = true,
typename Scalar,
typename OtherScalar, std::
size_t Rank, std::
size_t M
iddleRank, std::
size_t CoRank,
typename Symmetry>
484XTensor<TRACK, std::common_type_t<Scalar, OtherScalar>, Rank, CoRank, Symmetry>
487 if constexpr(TRACK) {
490 right.adj() += (left.adjoint() * res.adj());
491 SPDLOG_WARN(
"reverse t*vt with t={} and vt={}, input adj norm={}, output adj norm={}",
499 return left * right.val();
503template <
bool TRACK = true,
typename Scalar,
typename OtherScalar, std::
size_t Rank, std::
size_t M
iddleRank, std::
size_t CoRank,
typename Symmetry>
504XTensor<TRACK, std::common_type_t<Scalar, OtherScalar>, Rank, CoRank, Symmetry>
507 if constexpr(TRACK) {
510 left.adj() += res.adj() * right.adjoint();
511 SPDLOG_WARN(
"reverse vt*t with vt={} and t={}, input adj norm={}, output adj norm={}",
519 return left.val() * right;
523template <
bool TRACK = true,
typename Scalar,
typename OtherScalar, std::
size_t Rank, std::
size_t M
iddleRank, std::
size_t CoRank,
typename Symmetry>
524XTensor<TRACK, std::common_type_t<Scalar, OtherScalar>, Rank, CoRank, Symmetry>
527 if constexpr(TRACK) {
529 stan::math::reverse_pass_callback([res, left, right]()
mutable {
530 right.adj() += (left.val().adjoint() * res.adj());
531 left.adj() += res.adj() * right.val().adjoint();
532 SPDLOG_WARN(
"reverse vt*vt with vtl={} and vtr={}, in adj norm={}, vtl adj norm={}, vtr adj norm={}",
541 return left.val() * right.val();
577stan::math::var_value<double> real(
const stan::math::var_value<double>& z) {
return z; }
Definition: Qbasis.hpp:39
void print(std::ostream &o, bool PRINT_MATRICES=true) const
Definition: ADTensor.hpp:418
bool is_uninitialized() noexcept
Definition: ADTensor.hpp:52
XTensor< TRACK, Scalar, Rank, CoRank, Symmetry, AllocationPolicy > twist(std::size_t leg) const
Definition: ADTensor.hpp:399
constexpr std::size_t rank() const noexcept
Definition: ADTensor.hpp:85
Scalar_ Scalar
Definition: ADTensor.hpp:31
PlainInterface::cMapMType< Scalar > MatrixcMapType
Definition: ADTensor.hpp:43
PlainInterface::Indextype IndexType
Definition: ADTensor.hpp:39
std::size_t plainSize() const
Definition: ADTensor.hpp:95
auto & adj_op() noexcept
Definition: ADTensor.hpp:83
PlainInterface::TType< Scalar, Rank+CoRank > TensorType
Definition: ADTensor.hpp:44
Tensor(const Xped::Tensor< Scalar, Rank, CoRank, Symmetry, false, AllocationPolicy > &x)
Definition: ADTensor.hpp:58
const Qbasis< Symmetry, CoRank, AllocationPolicy > & coupledCodomain() const
Definition: ADTensor.hpp:101
void setConstant(Scalar c)
Definition: ADTensor.hpp:75
const auto cgradbegin() const
Definition: ADTensor.hpp:114
vari_type * vi_
Definition: ADTensor.hpp:50
void setIdentity()
Definition: ADTensor.hpp:73
void setZero()
Definition: ADTensor.hpp:74
typename Symmetry::qType qType
Definition: ADTensor.hpp:35
XTensor< TRACK, Scalar, Rank, CoRank, Symmetry, AllocationPolicy > diag_inv() const
Definition: ADTensor.hpp:384
vari_type * operator->()
Definition: ADTensor.hpp:121
auto gradend() const
Definition: ADTensor.hpp:112
friend std::ostream & operator<<(std::ostream &os, const Tensor< Scalar, Rank, CoRank, Symmetry, true, AllocationPolicy > &v)
Definition: ADTensor.hpp:420
Tensor< Scalar, Rank, CoRank, Symmetry, true, AllocationPolicy > eval() const
Definition: ADTensor.hpp:123
auto gradbegin() const
Definition: ADTensor.hpp:111
const auto cgradend() const
Definition: ADTensor.hpp:115
auto & adj() noexcept
Definition: ADTensor.hpp:81
auto adjoint() const
Definition: ADTensor.hpp:126
PlainInterface::MapMType< Scalar > MatrixMapType
Definition: ADTensor.hpp:42
const auto cend() const
Definition: ADTensor.hpp:109
const auto & sector() const
Definition: ADTensor.hpp:89
auto & adj() const noexcept
Definition: ADTensor.hpp:82
auto & val_op() noexcept
Definition: ADTensor.hpp:78
stan::math::vari_value< value_type > vari_type
Definition: ADTensor.hpp:48
PlainInterface::MapTType< Scalar, Rank+CoRank > TensorMapType
Definition: ADTensor.hpp:45
const std::array< Qbasis< Symmetry, 1, AllocationPolicy >, Rank > & uncoupledDomain() const
Definition: ADTensor.hpp:97
const std::string name() const
Definition: ADTensor.hpp:87
std::tuple< XTensor< TRACK, Scalar, Rank, 1, Symmetry, AllocationPolicy >, XTensor< TRACK, Scalar, 1, 1, Symmetry, AllocationPolicy >, XTensor< TRACK, Scalar, 1, CoRank, Symmetry, AllocationPolicy > > tSVD(std::size_t maxKeep, RealScalar eps_svd, RealScalar &truncWeight, bool PRESERVE_MULTIPLETS=true) XPED_CONST
Definition: ADTensor.hpp:287
const auto & detach() const noexcept
Definition: ADTensor.hpp:79
void setRandom()
Definition: ADTensor.hpp:72
auto end() const
Definition: ADTensor.hpp:106
XTensor< TRACK, Scalar, Rank, CoRank, Symmetry, AllocationPolicy > diag_sqrt() const
Definition: ADTensor.hpp:369
auto permute(Bool< TRACK >) const
Definition: ADTensor.hpp:141
const auto cbegin() const
Definition: ADTensor.hpp:108
void set_data(const Scalar *data, std::size_t size)
Definition: ADTensor.hpp:117
const qType sector(std::size_t i) const
Definition: ADTensor.hpp:90
const auto & val() const noexcept
Definition: ADTensor.hpp:77
const Qbasis< Symmetry, Rank, AllocationPolicy > & coupledDomain() const
Definition: ADTensor.hpp:100
XScalar< TRACK, Scalar > trace() const
Definition: ADTensor.hpp:341
Tensor(const std::array< Qbasis< Symmetry, 1, AllocationPolicy >, Rank > &basis_domain, const std::array< Qbasis< Symmetry, 1, AllocationPolicy >, CoRank > &basis_codomain, mpi::XpedWorld &world=mpi::getUniverse())
Definition: ADTensor.hpp:66
Tensor< Scalar, Rank - shift, CoRank+shift, Symmetry, true, AllocationPolicy > permute(seq::iseq< std::size_t, p... >, Bool< TRACK >) const
Definition: ADTensor.hpp:158
Symmetry_ Symmetry
Definition: ADTensor.hpp:34
constexpr bool AD_TENSOR()
Definition: ADTensor.hpp:93
PlainInterface::MType< Scalar > MatrixType
Definition: ADTensor.hpp:41
const std::array< Qbasis< Symmetry, 1, AllocationPolicy >, CoRank > & uncoupledCodomain() const
Definition: ADTensor.hpp:98
XScalar< TRACK, Scalar > maxNorm() const
Definition: ADTensor.hpp:312
constexpr std::size_t corank() const noexcept
Definition: ADTensor.hpp:86
XScalar< TRACK, Scalar > norm() const
Definition: ADTensor.hpp:296
const mpi::XpedWorld & world() const
Definition: ADTensor.hpp:103
typename ScalarTraits< Scalar >::Real RealScalar
Definition: ADTensor.hpp:32
PlainInterface::cMapTType< Scalar, Rank+CoRank > TensorcMapType
Definition: ADTensor.hpp:46
std::tuple< XTensor< TRACK, Scalar, Rank, 1, Symmetry, AllocationPolicy >, XTensor< TRACK, Scalar, 1, 1, Symmetry, AllocationPolicy >, XTensor< TRACK, Scalar, 1, CoRank, Symmetry, AllocationPolicy > > tSVD(std::size_t maxKeep, RealScalar eps_svd, RealScalar &truncWeight, RealScalar &entropy, std::map< qarray< Symmetry::Nq >, VectorType > &SVspec, bool PRESERVE_MULTIPLETS=true, bool RETURN_SPEC=true) XPED_CONST
Definition: ADTensor.hpp:197
PlainInterface::VType< Scalar > VectorType
Definition: ADTensor.hpp:40
constexpr bool CONTIGUOUS_STORAGE() const
Definition: ADTensor.hpp:92
Tensor(vari_type *vi)
Definition: ADTensor.hpp:62
Tensor()
Definition: ADTensor.hpp:54
auto begin() const
Definition: ADTensor.hpp:105
AllocationPolicy_ AllocationPolicy
Definition: ADTensor.hpp:37
Definition: Tensor.hpp:40
XpedWorld & getUniverse()
Definition: Mpi.hpp:49
constexpr auto inverse_permutation()
Definition: Constfct.hpp:40
std::conditional_t< AD, Tensor< Scalar, Rank, CoRank, Symmetry, true, AllocationPolicy >, Tensor< Scalar, Rank, CoRank, Symmetry, false, AllocationPolicy > > XTensor
Definition: ADTensor.hpp:22
XTensor< TRACK, Scalar, Rank, CoRank, Symmetry > operator-(const Tensor< Scalar, Rank, CoRank, Symmetry, true > &t, Scalar s)
Definition: ADTensor.hpp:428
XTensor< TRACK, Scalar, Rank, CoRank, Symmetry > operator+(const Tensor< Scalar, Rank, CoRank, Symmetry, true > &t, Scalar s)
Definition: ADTensor.hpp:440
void reverse_pass_callback_alloc(F &&functor)
Definition: reverse_pass_callback_alloc.hpp:40
XTensor< TRACK, Scalar, Rank, CoRank, Symmetry > operator*(const Tensor< Scalar, Rank, CoRank, Symmetry, true > &t, Scalar s)
Definition: ADTensor.hpp:452
std::conditional_t< AD, stan::math::var_value< Scalar >, Scalar > XScalar
Definition: ADTensor.hpp:25
CTF::Matrix< Scalar > MapMType
Definition: MatrixInterface_Cyclops_impl.hpp:45
static MIndextype cols(const MType< Scalar > &M)
Definition: MatrixInterface_Cyclops_impl.cpp:90
static MIndextype rows(const MType< Scalar > &M)
Definition: MatrixInterface_Cyclops_impl.cpp:84
const CTF::Matrix< Scalar > cMapMType
Definition: MatrixInterface_Cyclops_impl.hpp:47
int MIndextype
Definition: MatrixInterface_Cyclops_impl.hpp:49
CTF::Matrix< Scalar > MType
Definition: MatrixInterface_Cyclops_impl.hpp:40
static void vec_diff(VT &&vec, MType< typename ctf_traits< VT >::Scalar > &res)
int Indextype
Definition: PlainInterface_Cyclops_impl.hpp:11
Definition: ScalarTraits.hpp:10
nda::dense_array< Scalar, Rank > TType
Definition: TensorInterface_Array_impl.hpp:44
nda::dense_array_ref< Scalar, Rank > MapTType
Definition: TensorInterface_Array_impl.hpp:49
nda::const_dense_array_ref< Scalar, Rank > cMapTType
Definition: TensorInterface_Array_impl.hpp:51
CTF::Vector< Scalar > VType
Definition: VectorInterface_Cyclops_impl.hpp:12
Definition: qarray.hpp:30