mptensor v0.6.0
Parallel Library for Tensor Network Methods
Loading...
Searching...
No Matches
mptensor_test Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  TensorTypeNames
 Readable names ("double" / "complex") in gtest output. More...
 

Typedefs

template<typename T >
using DistMatrix = scalapack::Matrix< T >
 
using TensorD = Tensor< DistMatrix< double > >
 
using TensorC = Tensor< DistMatrix< complex > >
 
using TensorTypes = ::testing::Types< TensorD, TensorC >
 Tensor types every TYPED_TEST runs with.
 
using LocalTensorD = Tensor< lapack::Matrix< double > >
 Non-distributed tensor types (always LAPACK).
 
using LocalTensorC = Tensor< lapack::Matrix< complex > >
 

Functions

double max_over_ranks (double local, MPI_Comm comm)
 Maximum of local over all ranks of comm. Collective.
 
int world_size ()
 Number of processes in MPI_COMM_WORLD.
 
template<typename T >
T func2_1 (const Index &idx, const Shape &shape)
 Analytic matrix element (legacy func2_1 / cfunc2_1).
 
template<typename T >
T func4_1 (const Index &idx, const Shape &shape)
 Analytic rank-4 element (legacy func4_1 / cfunc4_1).
 
template<typename T >
T func4_2 (const Index &idx, const Shape &shape)
 Analytic rank-4 element (legacy func4_2 / cfunc4_2).
 
double conj_value (double x)
 Complex conjugate that keeps double as double.
 
complex conj_value (const complex &x)
 
template<typename TensorType , typename F >
void fill_tensor (TensorType &t, F f)
 Set every local element to f(global_index, shape).
 
template<typename TensorType , typename F >
double max_error (const TensorType &t, F exact)
 Maximum over all ranks of |t[idx] - exact(idx)|. Collective.
 
template<typename TensorType >
TensorType make_initial_tensor ()
 
std::string data_filename (const std::string &prefix, int proc_size)
 "<prefix>_mpi000N" (same names as legacy).
 
std::string binary_filename (const std::string &base, int rank)
 Per-rank binary file written by Tensor::save: "<base>.NNNN.bin".
 

Variables

constexpr int kL = 10
 Base size of test tensors (legacy default N).
 
constexpr double kEps = 1.0e-10
 Default tolerance.
 
constexpr std::size_t kFileIoN = 6
 

Typedef Documentation

◆ DistMatrix

template<typename T >
using mptensor_test::DistMatrix = typedef scalapack::Matrix<T>

◆ LocalTensorC

◆ LocalTensorD

Non-distributed tensor types (always LAPACK).

◆ TensorC

◆ TensorD

◆ TensorTypes

Tensor types every TYPED_TEST runs with.

Function Documentation

◆ binary_filename()

std::string mptensor_test::binary_filename ( const std::string &  base,
int  rank 
)
inline

Per-rank binary file written by Tensor::save: "<base>.NNNN.bin".

◆ conj_value() [1/2]

complex mptensor_test::conj_value ( const complex &  x)
inline

◆ conj_value() [2/2]

double mptensor_test::conj_value ( double  x)
inline

Complex conjugate that keeps double as double.

◆ data_filename()

std::string mptensor_test::data_filename ( const std::string &  prefix,
int  proc_size 
)
inline

"<prefix>_mpi000N" (same names as legacy).

◆ fill_tensor()

template<typename TensorType , typename F >
void mptensor_test::fill_tensor ( TensorType &  t,
F  f 
)

Set every local element to f(global_index, shape).

◆ func2_1()

template<typename T >
T mptensor_test::func2_1 ( const Index &  idx,
const Shape &  shape 
)

Analytic matrix element (legacy func2_1 / cfunc2_1).

◆ func4_1()

template<typename T >
T mptensor_test::func4_1 ( const Index &  idx,
const Shape &  shape 
)

Analytic rank-4 element (legacy func4_1 / cfunc4_1).

◆ func4_2()

template<typename T >
T mptensor_test::func4_2 ( const Index &  idx,
const Shape &  shape 
)

Analytic rank-4 element (legacy func4_2 / cfunc4_2).

◆ make_initial_tensor()

template<typename TensorType >
TensorType mptensor_test::make_initial_tensor ( )

Shape (n, n+1, n+2, n+3), values i0 + 100 i1 + 10^4 i2 + 10^6 i3, then transposed by (3,1,0,2) so that axes_map is non-trivial.

◆ max_error()

template<typename TensorType , typename F >
double mptensor_test::max_error ( const TensorType &  t,
F  exact 
)

Maximum over all ranks of |t[idx] - exact(idx)|. Collective.

◆ max_over_ranks()

double mptensor_test::max_over_ranks ( double  local,
MPI_Comm  comm 
)
inline

Maximum of local over all ranks of comm. Collective.

◆ world_size()

int mptensor_test::world_size ( )
inline

Number of processes in MPI_COMM_WORLD.

Variable Documentation

◆ kEps

constexpr double mptensor_test::kEps = 1.0e-10
constexpr

Default tolerance.

◆ kFileIoN

constexpr std::size_t mptensor_test::kFileIoN = 6
constexpr

◆ kL

constexpr int mptensor_test::kL = 10
constexpr

Base size of test tensors (legacy default N).