cotengra.nodeops¶
Attributes¶
Classes¶
Namespace for interacting with frozenset[int] as contraction tree nodes. |
|
A bitset for keeping track of dense sets of integers. Subclass of |
|
Namespace for interacting with BitSetInt as contraction tree nodes. |
|
Functions¶
|
Get the node operations namespace for the given node type. |
Module Contents¶
- class cotengra.nodeops.NodeOpsFrozenset[source]¶
Namespace for interacting with frozenset[int] as contraction tree nodes.
- __slots__ = ()¶
- node_type¶
The type used for nodes, to check isinstance with.
- node_size¶
Function to get the size of a node.
- node_from_seq¶
From a sequence of integers, construct node (
frozenset).
- new_node_for_seq¶
- class cotengra.nodeops.BitSetInt[source]¶
Bases:
intA bitset for keeping track of dense sets of integers. Subclass of
intthat overrides-,&and|and provides__len__and__iter__. As of python 3.8 doesn’t seem much better than using frozenset[int] (slower and limited memory savings).- Parameters:
it (Iterable[int] or int) – If sequence of
int, treat these as the set members. If rawintinterpret as bitset directly.
- __slots__ = ()¶
- class cotengra.nodeops.NodeOpsBitSetInt[source]¶
Namespace for interacting with BitSetInt as contraction tree nodes.
- __slots__ = ()¶
- class cotengra.nodeops.NodeOpsSSA(N)[source]¶
- __slots__ = ('ssa', 'N')¶
- ssa¶
- N¶
- node_type¶
- new_node_for_union(nodes)[source]¶
Get a new node label for the union of nodes. We use this rather than the above methods to be explicit that we can only create new node labels, not reconstruct labels from the constituent nodes.
- cotengra.nodeops.nodeops_frozenset¶
- cotengra.nodeops.nodeops_bitsetint¶