Commit 38e6a311 authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh

Merge branch 'devel_dil' into devel

parents feadeec2 50324f8c
Pipeline #110274 passed with stage
in 13 minutes and 8 seconds
/** ExaTN::Numerics: Numerical server
REVISION: 2020/07/06
REVISION: 2020/07/07
Copyright (C) 2018-2020 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2020 Oak Ridge National Laboratory (UT-Battelle) **/
......
......@@ -28,6 +28,7 @@
#define EXATN_TEST13
#define EXATN_TEST14
#define EXATN_TEST15
#define EXATN_TEST16
#ifdef EXATN_TEST0
......@@ -1679,6 +1680,42 @@ TEST(NumServerTester, MPSBuilderNumServer)
}
#endif
#ifdef EXATN_TEST16
TEST(NumServerTester, TestSVD)
{
using exatn::Tensor;
using exatn::TensorShape;
using exatn::TensorSignature;
using exatn::TensorNetwork;
using exatn::TensorOperator;
using exatn::TensorExpansion;
using exatn::TensorElementType;
bool success = true;
success = exatn::createTensor("D",TensorElementType::REAL64,TensorShape{2,2,2,2,2}); assert(success);
success = exatn::createTensor("L",TensorElementType::REAL64,TensorShape{2,2,2,2}); assert(success);
success = exatn::createTensor("R",TensorElementType::REAL64,TensorShape{2,2,2,2,2}); assert(success);
success = exatn::createTensor("S",TensorElementType::REAL64,TensorShape{2,2}); assert(success);
success = exatn::initTensorRndSync("D"); assert(success);
success = exatn::initTensorSync("L",0.0); assert(success);
success = exatn::initTensorSync("R",0.0); assert(success);
success = exatn::initTensorSync("S",0.0); assert(success);
exatn::sync();
success = exatn::decomposeTensorSVDSync("D(a,b,c,d,e)=L(c,i,e,j)*S(i,j)*R(b,j,a,i,d)"); assert(success);
success = exatn::destroyTensor("S"); assert(success);
success = exatn::destroyTensor("R"); assert(success);
success = exatn::destroyTensor("L"); assert(success);
success = exatn::destroyTensor("D"); assert(success);
exatn::sync();
}
#endif
int main(int argc, char **argv) {
exatn::ParamConf exatn_parameters;
......
/** ExaTN::Numerics: Tensor operation
REVISION: 2020/06/26
REVISION: 2020/07/07
Copyright (C) 2018-2020 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2020 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -226,6 +226,9 @@ std::string TensorOperation::getIndexPatternReduced() const
}
}
}
if(opcode_ == TensorOpCode::DECOMPOSE_SVD3){ //delete the middle tensor from the symbolic specification
tensors.erase(tensors.begin()+2);
}
reduced = assemble_symbolic_tensor_network(tensors);
}else{
std::cout << "#ERROR(exatn::numerics::TensorOperation::getIndexPatternReduced): "
......
/** ExaTN::Numerics: Tensor operation
REVISION: 2020/06/25
REVISION: 2020/07/07
Copyright (C) 2018-2020 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2020 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -131,7 +131,9 @@ public:
const std::string & getIndexPattern() const;
/** Returns a reduced symbolic tensor operation specification (index pattern)
in which indices associated with tensor dimensions of extent 1 are removed. **/
in which indices associated with tensor dimensions of extent 1 are removed.
Also, specifically for tensor operation DECOMPOSE_SVD3, the middle SVD
tensor will be removed completely per requirements of the TAL-SH backend. **/
std::string getIndexPatternReduced() const;
/** Sets the symbolic tensor operation specification (index pattern).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment