Class TensorNetwork::Edge

Nested Relationships

This class is a nested type of Class TensorNetwork.

Class Documentation

class Edge

Edge in a TensorNetwork = 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(int terminal_idx, int position = 0)
inline Edge(int terminal_idx, const Index *idxptr, int position = 0)
inline Edge &connect_to(int terminal_idx, int position = 0)
inline bool operator<(const Edge &other) const
inline bool operator==(const Edge &other) const
inline auto first() const
inline auto second() const
inline auto first_position() const
inline auto second_position() const
inline auto size() const
Returns:

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

inline const Index &idx() const