cirq.contrib.graph_device.UndirectedHypergraph(
*,
vertices: Optional[Iterable[Hashable]] = None,
labelled_edges: Optional[Dict[Iterable[Hashable], Any]] = None
) -> None
Args |
vertices
|
The vertices.
|
labelled_edges
|
The labelled edges, as a mapping from (frozen) sets
of vertices to the corresponding labels. Vertices are
automatically added.
|
Attributes |
edges
|
|
labelled_edges
|
|
vertices
|
|
Methods
add_edge
View source
add_edge(
vertices: Iterable[Hashable], label: Any = None
) -> None
add_edges
View source
add_edges(
edges: Dict[Iterable[Hashable], Any]
)
add_vertex
View source
add_vertex(
vertex: Hashable
) -> None
add_vertices
View source
add_vertices(
vertices: Iterable[Hashable]
) -> None
random
View source
@classmethod
random(
vertices: Union[int, Iterable], edge_probs: Mapping[int, float]
) -> 'UndirectedHypergraph'
A random hypergraph.
Every possible edge is included with probability edge_prob[len(edge)].
All edges are labelled with None.
Args |
vertices
|
The vertex set. If an integer i, the vertex set is
{0, ..., i - 1}.
|
edge_probs
|
The probabilities of edges of given sizes. Non-positive
values mean the edge is never included and values at least 1
mean that it is always included.
|
remove_vertex
View source
remove_vertex(
vertex: Hashable
) -> None
remove_vertices
View source
remove_vertices(
vertices
)
__add__
View source
__add__(
other
)
__eq__
View source
__eq__(
other
)
Return self==value.