cirq.contrib.graph_device.UndirectedHypergraph
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]