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 | None = None)[source]

Resource graph state object.

Parameters:
  • cltype (ResourceType object) – Type of the cluster.

  • graph (GraphState object) – Graph state of the cluster.

__init__(cltype: ResourceType, graph: GraphState | None = None)[source]
class graphix.extraction.ResourceType(value)[source]

Resource type.

graphix.extraction.get_fusion_network_from_graph(graph: BaseGraphState, 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 (GraphState object) – 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 ResourceGraph objects.

Return type:

list

graphix.extraction.create_resource_graph(node_ids: list[int], root: int | None = 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:

ResourceGraph object.

Return type:

ResourceGraph object

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 (ResourceGraph object) – First resource state to be fused.

  • c2 (ResourceGraph object) – Second resource state to be fused.

Returns:

List of nodes that are fused between the two clusters.

Return type:

list