Class TensorNetworkV2::Edge

Nested Relationships

This class is a nested type of Class TensorNetworkV2.

Class Documentation

class Edge

Edge in a TensorNetworkV2 = the Index annotating it + a pair of indices to identify which Tensor terminals it’s connected to.

Note

tensor terminals in a sequence of tensors are indexed as follows:

  • >0 for bra terminals (i.e. “+7” indicated connection to a bra terminal of 7th tensor object in the sequence)

  • <0 for ket terminals

  • 0 if free (not attached to any tensor objects)

  • position records the terminal’s location in the sequence of bra/ket terminals (always 0 for symmetric/antisymmetric tensors) Terminal indices are sorted by the tensor index (i.e. by the absolute value of the terminal index), followed by position

Public Functions

Edge() = default
inline explicit Edge(Vertex vertex)
inline Edge(Vertex vertex, Index index)
inline Edge &connect_to(Vertex vertex)
inline bool operator<(const Edge &other) const
inline bool operator==(const Edge &other) const
inline const Vertex &first_vertex() const
inline const Vertex &second_vertex() const
inline std::size_t vertex_count() const
Returns:

the number of attached terminals (0, 1, or 2)

inline const Index &idx() const