Graph state generation
graphix.extraction module
This provides functions to extract clusters from a given the graph state.
- class graphix.extraction.ResourceGraph(type: ResourceType, graph: Optional[GraphState] = None)[source]
resource graph state object.
- Parameters
type (
ResourceTypeobject) – Type of the cluster.graph (
GraphStateobject) – Graph state of the cluster.
- __init__(type: ResourceType, graph: Optional[GraphState] = None)[source]
- graphix.extraction.get_fusion_network_from_graph(graph: BaseGraphState, max_ghz: int | float = inf, max_lin: int | float = inf) list[graphix.extraction.ResourceGraph][source]
Extract GHZ and linear cluster graph state decomposition of desired resource state
GraphState. Extraction algorithm is based on [1].[1] Zilk et al., A compiler for universal photonic quantum computers, 2022 arXiv:2210.09251
- Parameters
graph (
GraphStateobject) – Graph state.phasedict (dict) – Dictionary of phases for each node.
max_ghz – Maximum size of ghz clusters
max_lin – Maximum size of linear clusters
- Returns
List of
ResourceGraphobjects.- Return type
list
- graphix.extraction.create_resource_graph(node_ids: list[int], root: Optional[int] = None, use_rustworkx=False) ResourceGraph[source]
Create a resource graph state (GHZ or linear) from node ids.
- Parameters
node_ids (list) – List of node ids.
root (int) – Root of the ghz cluster. If None, it’s a linear cluster.
- Returns
Cluster object.
- Return type
Clusterobject
- graphix.extraction.get_fusion_nodes(c1: ResourceGraph, c2: ResourceGraph) list[int][source]
Get the nodes that are fused between two resource states. Currently, we consider only type-I fusion. See [2] for the definition of fusion operation.
[2] Daniel E. Browne and Terry Rudolph. Resource-efficient linear optical quantum computation. Physical Review Letters, 95(1):010501, 2005.
- Parameters
c1 (
ResourceGraphobject) – First resource state to be fused.c2 (
ResourceGraphobject) – Second resource state to be fused.
- Returns
List of nodes that are fused between the two clusters.
- Return type
list