graphix.extraction module¶
Functions to extract fusion network from a given graph state.
- class ResourceType(*values)[source]¶
Bases:
EnumResource type.
- GHZ = 'GHZ'¶
- LINEAR = 'LINEAR'¶
- NONE = None¶
- class ResourceGraph(cltype: ResourceType, graph: Graph)[source]¶
Bases:
objectResource graph state object.
- Parameters:
cltype (
ResourceTypeobject) – Type of the cluster.graph (
Graphobject) – Graph state of the cluster.
- cltype: ResourceType¶
- __init__(cltype: ResourceType, graph: Graph) None¶
- graph_to_fusion_network(graph: Graph, max_ghz: float = inf, max_lin: float = inf) list[ResourceGraph][source]¶
Extract GHZ and linear cluster graph state decomposition of desired resource state
Graph.Extraction algorithm is based on [1].
[1] Zilk et al., A compiler for universal photonic quantum computers, 2022 arXiv:2210.09251
- Parameters:
graph (
Graphobject) – 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:
- 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:
- Returns:
ResourceGraphobject.- Return type:
ResourceGraphobject
- 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: