24 #ifndef EXATN_NUMERICS_TENSOR_OPERATOR_HPP_
25 #define EXATN_NUMERICS_TENSOR_OPERATOR_HPP_
27 #include "tensor_basic.hpp"
28 #include "tensor_network.hpp"
45 std::shared_ptr<TensorNetwork> network;
47 std::vector<std::pair<unsigned int, unsigned int>> ket_legs;
49 std::vector<std::pair<unsigned int, unsigned int>> bra_legs;
51 std::complex<double> coefficient;
54 using Iterator =
typename std::vector<OperatorComponent>::iterator;
55 using ConstIterator =
typename std::vector<OperatorComponent>::const_iterator;
65 inline Iterator begin() {
return components_.begin();}
66 inline Iterator end() {
return components_.end();}
67 inline ConstIterator cbegin()
const {
return components_.cbegin();}
68 inline ConstIterator cend()
const {
return components_.cend();}
71 inline const std::string &
getName()
const{
78 if(!(components_.empty()))
return components_[0].network->getRank();
84 return components_.size();
89 assert(component_num < components_.size());
90 return components_[component_num];
99 const std::vector<std::pair<unsigned int, unsigned int>> & ket_pairing,
100 const std::vector<std::pair<unsigned int, unsigned int>> & bra_pairing,
101 const std::complex<double> coefficient);
114 std::vector<OperatorComponent> components_;
121 #endif //EXATN_NUMERICS_TENSOR_OPERATOR_HPP_