compiled_parametric_graph_state

forest.benchmarking.entangled_states.compiled_parametric_graph_state(compiler: pyquil.api._compiler.QPUCompiler, graph: networkx.classes.graph.Graph, focal_node: int, num_shots: int = 1000)

Construct a program to create and measure a graph state, map it to qubits using addressing, and compile to an ISA.

Hackily implement a parameterized program by compiling a program with a particular angle, finding where that angle appears in the results, and replacing it with "{angle}" so the resulting compiled program can be run many times by using python’s str.format method.

Parameters:
  • graph – A networkx graph defining the graph state
  • focal_node – The node of the graph to measure
  • compiler – The compiler to do the compiling.
  • num_shots – The number of shots to take when measuring the graph state.
Returns:

an executable that constructs and measures a graph state.