28 #ifndef _FUNCTIONS_HPP_
29 #define _FUNCTIONS_HPP_
45 double x0 = double(idx[0]) / double(
shape[0]);
46 double x1 = double(idx[1]) / double(
shape[1]);
47 return 1.0 / (1.0 + std::abs(x0 -
std::sqrt(x1)));
51 double x0 = double(idx[0]) / double(
shape[0]);
52 double x1 = double(idx[1]) / double(
shape[1]);
57 double x0 = double(idx[0]) / double(
shape[0]);
58 double x1 = double(idx[1]) / double(
shape[1]);
59 double x2 = double(idx[2]) / double(
shape[2]);
60 double x3 = double(idx[3]) / double(
shape[3]);
61 return (x0 + x1) / (1.0 + std::abs(x2 - x3));
65 double x0 = double(idx[0]) / double(
shape[0]);
66 double x1 = double(idx[1]) / double(
shape[1]);
67 double x2 = double(idx[2]) / double(
shape[2]);
68 double x3 = double(idx[3]) / double(
shape[3]);
69 return std::cos(x0 * x3) + std::sin(x1 / (x2 + 1.0));
73 double x0 = double(idx[0]) / double(
shape[0]);
74 double x1 = double(idx[1]) / double(
shape[1]);
75 double x2 = double(idx[2]) / double(
shape[2]);
76 double x3 = double(idx[3]) / double(
shape[3]);
81 double x0 = double(idx[0]) / double(
shape[0]);
82 double x1 = double(idx[1]) / double(
shape[1]);
83 double x2 = double(idx[2]) / double(
shape[2]);
84 double x3 = double(idx[3]) / double(
shape[3]);
85 return complex(std::cos(x0 * x3), std::sin(x1 / (x2 + 1.0)));
std::complex< double > complex
Definition: complex.hpp:38
Tensor< Matrix, C > sqrt(Tensor< Matrix, C > t)
Take square-root of each element.
Index(size_t j0)
Definition: index_constructor.hpp:11
Top header file of mptensor.
Index Shape
Definition: tensor.hpp:46
tuple shape
Definition: output.py:28
Test codes for Tensor.
Definition: arithmetic.cc:42
complex cfunc4_1(Index idx, Shape shape)
Definition: functions.hpp:72
double func2_1(Index idx, Shape shape)
Definition: functions.hpp:44
double func4_2(Index idx, Shape shape)
Definition: functions.hpp:64
complex cfunc2_1(Index idx, Shape shape)
Definition: functions.hpp:50
double func4_1(Index idx, Shape shape)
Definition: functions.hpp:56
complex cfunc4_2(Index idx, Shape shape)
Definition: functions.hpp:80