Commit 93d0cfbb authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh

Implemented TensorNetwork::importContractionSequence() method.

parent 949a5264
Pipeline #86221 passed with stage
in 4 minutes and 14 seconds
/** ExaTN::Numerics: Tensor network
REVISION: 2019/12/31
REVISION: 2020/01/13
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
Copyright (C) 2018-2020 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2020 Oak Ridge National Laboratory (UT-Battelle) **/
#include "tensor_network.hpp"
#include "tensor_symbol.hpp"
......@@ -486,6 +486,16 @@ double TensorNetwork::determineContractionSequence(ContractionSeqOptimizer & con
}
void TensorNetwork::importContractionSequence(const std::list<ContrTriple> & contr_sequence)
{
assert(finalized_ != 0); //tensor network must be in finalized state
contraction_seq_.clear();
contraction_seq_ = contr_sequence;
contraction_seq_flops_ = 0.0; //flop count is unknown yet
return;
}
bool TensorNetwork::placeTensor(unsigned int tensor_id, //in: tensor id (unique within the tensor network)
std::shared_ptr<Tensor> tensor, //in: appended tensor
const std::vector<TensorLeg> & connections, //in: tensor connections (fully specified)
......
/** ExaTN::Numerics: Tensor network
REVISION: 2019/12/31
REVISION: 2020/01/13
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
Copyright (C) 2018-2020 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2020 Oak Ridge National Laboratory (UT-Battelle) **/
/** Rationale:
(a) A tensor network is a set of connected tensors.
......@@ -332,6 +332,9 @@ protected:
No contraction sequence is generated for tensor networks consisting of a single input tensor. **/
double determineContractionSequence(ContractionSeqOptimizer & contr_seq_optimizer);
/** Imports and caches an externally provided tensor contraction sequence. **/
void importContractionSequence(const std::list<ContrTriple> & contr_sequence);
private:
/** Resets the output tensor in a finalized tensor network to a new
......
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