mptensor  v0.3.0
Parallel Library for Tensor Network Methods
tensor_test.hpp
Go to the documentation of this file.
1 /*
2  mptensor - Parallel Library for Tensor Network Methods
3 
4  Copyright 2016 Satoshi Morita
5 
6  mptensor is free software: you can redistribute it and/or modify it
7  under the terms of the GNU Lesser General Public License as
8  published by the Free Software Foundation, either version 3 of the
9  License, or (at your option) any later version.
10 
11  mptensor is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with mptensor. If not, see
18  <https://www.gnu.org/licenses/>.
19 */
20 
28 #ifndef _TENSOR_TEST_HPP_
29 #define _TENSOR_TEST_HPP_
30 
31 #include <iostream>
32 #include "mpi_tool.hpp"
33 
35 namespace tests {
36 
37 void test_transpose(const mpi_comm &comm, int L, std::ostream &ostrm);
38 void test_reshape(const mpi_comm &comm, int L, std::ostream &ostrm);
39 void test_slice(const mpi_comm &comm, int L, std::ostream &ostrm);
40 void test_set_slice(const mpi_comm &comm, int L, std::ostream &ostrm);
41 void test_tensordot(const mpi_comm &comm, int L, std::ostream &ostrm);
42 void test_svd(const mpi_comm &comm, int L, std::ostream &ostrm);
43 void test_qr(const mpi_comm &comm, int L, std::ostream &ostrm);
44 void test_qr_rank2(const mpi_comm &comm, int L, std::ostream &ostrm);
45 void test_eigh(const mpi_comm &comm, int L, std::ostream &ostrm);
46 void test_eigh_rank2(const mpi_comm &comm, int L, std::ostream &ostrm);
47 void test_eigh_general(const mpi_comm &comm, int L, std::ostream &ostrm);
48 void test_arithmetic(const mpi_comm &comm, int L, std::ostream &ostrm);
49 void test_trace(const mpi_comm &comm, int L, std::ostream &ostrm);
50 void test_trace2(const mpi_comm &comm, int L, std::ostream &ostrm);
51 void test_contract(const mpi_comm &comm, int L, std::ostream &ostrm);
52 void test_kron(const mpi_comm &comm, int L, std::ostream &ostrm);
53 
54 void test_transpose_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
55 void test_reshape_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
56 void test_slice_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
57 void test_set_slice_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
58 void test_tensordot_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
59 void test_svd_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
60 void test_qr_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
61 void test_qr_rank2_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
62 void test_eigh_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
63 void test_eigh_rank2_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
64 void test_eigh_general_complex(const mpi_comm &comm, int L,
65  std::ostream &ostrm);
66 void test_arithmetic_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
67 void test_trace_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
68 void test_trace2_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
69 void test_contract_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
70 void test_kron_complex(const mpi_comm &comm, int L, std::ostream &ostrm);
71 
72 } // namespace tests
73 
74 #endif // _TENSOR_TEST_HPP_
Some utilities for MPI.
MPI_Comm mpi_comm
Definition: mpi_tool.hpp:37
Test codes for Tensor.
Definition: arithmetic.cc:42
void test_eigh_rank2(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::eigh.
Definition: eigh_rank2.cc:50
void test_kron_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::kron.
Definition: kron.cc:140
void test_qr_rank2(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::qr (Matrix version)
Definition: qr_rank2.cc:51
void test_eigh_general(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::eigh (generalized eigenvalue problem)
Definition: eigh_general.cc:50
void test_set_slice_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::slice.
Definition: set_slice.cc:155
void test_qr_rank2_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::qr (Matrix version)
Definition: qr_rank2.cc:128
void test_tensordot(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::tensordot.
Definition: tensordot.cc:52
void test_trace2(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for full contraction of two tensors.
Definition: trace.cc:208
void test_eigh_rank2_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::eigh.
Definition: eigh_rank2.cc:137
void test_trace_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for full trace of tensor (complex version)
Definition: trace.cc:129
void test_trace(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for full trace of tensor.
Definition: trace.cc:51
void test_reshape_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::reshape.
Definition: reshape.cc:127
void test_set_slice(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::set_slice.
Definition: set_slice.cc:50
void test_reshape(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::reshape.
Definition: reshape.cc:50
void test_svd(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::svd.
Definition: svd.cc:61
void test_svd_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::svd.
Definition: svd.cc:162
void test_slice(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::slice.
Definition: slice.cc:50
void test_transpose_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::transpose.
Definition: transpose.cc:127
void test_eigh_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::eigh.
Definition: eigh.cc:138
void test_arithmetic(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for arithmetic operators.
Definition: arithmetic.cc:50
void test_slice_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::slice.
Definition: slice.cc:146
void test_trace2_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for full contraction of two tensors (complex version)
Definition: trace.cc:291
void test_eigh_general_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::eigh.
Definition: eigh_general.cc:153
void test_kron(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::kron.
Definition: kron.cc:50
void test_contract_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::contract (partial trace)
Definition: contract.cc:121
void test_contract(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::contract (partial trace)
Definition: contract.cc:51
void test_arithmetic_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for arithmetic operators (complex version)
Definition: arithmetic.cc:140
void test_tensordot_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::tensordot.
Definition: tensordot.cc:156
void test_qr_complex(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorC::qr.
Definition: qr.cc:150
void test_eigh(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::eigh.
Definition: eigh.cc:50
void test_transpose(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::transpose.
Definition: transpose.cc:50
void test_qr(const mpi_comm &comm, int L, std::ostream &ostrm)
Test for TensorD::qr.
Definition: qr.cc:61