Graph state generation¶
graphix.extraction module¶
This module provides functions to extract clusters from a given graph state.
Functions to extract fusion network from a given graph state.
- class graphix.extraction.ResourceGraph(cltype: ResourceType, graph: GraphState)[source]¶
Resource graph state object.
- Parameters:
cltype (
ResourceTypeobject) – Type of the cluster.graph (
GraphStateobject) – Graph state of the cluster.
- __init__(cltype: ResourceType, graph: GraphState) None¶
- graphix.extraction.get_fusion_network_from_graph(graph: GraphState, max_ghz: float = inf, max_lin: float = inf) list[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: int | None = None) 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:
ResourceGraphobject.- Return type:
ResourceGraphobject
- 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