Commit cfde3f10 authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh

Added an output parameter to TensorNetwork::mergeTensors such that

it will return the corresponding symbolic contraction pattern.
parent a4902ccc
......@@ -714,7 +714,8 @@ bool TensorNetwork::deleteTensor(unsigned int tensor_id)
}
bool TensorNetwork::mergeTensors(unsigned int left_id, unsigned int right_id, unsigned int result_id)
bool TensorNetwork::mergeTensors(unsigned int left_id, unsigned int right_id, unsigned int result_id,
std::string * contr_pattern)
{
if(left_id == right_id || left_id == result_id || right_id == result_id){
std::cout << "#ERROR(TensorNetwork::mergeTensors): Invalid arguments: Cannot be identical: " <<
......
......@@ -192,9 +192,10 @@ public:
result = left * right: All participating tensor ids must be distinct and not equal to 0.
The uncontracted modes of the left tensor will precede in-order the uncontracted
modes of the right tensor in the tensor-result. **/
bool mergeTensors(unsigned int left_id, //in: left tensor id (present in the tensor network)
unsigned int right_id, //in: right tensor id (present in the tensor network)
unsigned int result_id); //in: result tensor id (absent in the tensor network, to be appended)
bool mergeTensors(unsigned int left_id, //in: left tensor id (present in the tensor network)
unsigned int right_id, //in: right tensor id (present in the tensor network)
unsigned int result_id, //in: result tensor id (absent in the tensor network, to be appended)
std::string * contr_pattern = nullptr); //inout: corresponding tensor contraction pattern (owned by the caller)
/** Splits a given tensor in a finalized tensor network into two tensors by introducing new dimensions
across the cutting boundary. The original tensor dimensions are then assigned to either left or
......
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