This class stores chains for embeddings, and performs qubit-use accounting.
labelis the index number for the variable represented by this chain. The
linksmember of a chain is an unordered map storing the linking information for this chain. The
datamember of a chain stores the connectivity information for the chain.
vare variables which are connected by an edge, the following must be true: either chain_u or chain_v is empty,
chain_u.links[v] is a key in chain_u.data, chain_v.links[u] is a key in chain_v.data, and (chain_u.links[v], chain_v.links[u]) are adjacent in the qubit graph
Moreover, (chain_u.links[u]) must exist if chain_u is not empty, and this is considered the root of the chain.
datamember stores the connectivity information. More precisely,
datais a mapping
parentis also contained in the chain
refsis the total number of references to
qubit, counting both parents and links the chain root is its own parent.