Pattern Generation
graphix.transpiler module
- class graphix.transpiler.Circuit(width)[source]
Gate-to-MBQC transpiler.
Holds gate operations and translates into MBQC measurement patterns.
- width
Number of logical qubits (for gate network)
- Type
int
- instruction
List containing the gate sequence applied.
- Type
list
- transpile()[source]
gate-to-MBQC transpile function.
- Returns
pattern
- Return type
graphix.pattern.Patternobject
- standardize_and_transpile()[source]
gate-to-MBQC transpile function. Commutes all byproduct through gates, instead of through measurement commands, to generate standardized measurement pattern.
- Returns
pattern
- Return type
graphix.pattern.Patternobject
Flow-based pattern generation
- graphix.gflow.generate_from_graph(graph, angles, inputs, outputs, timeout=100)[source]
Generate the measurement pattern from open graph and measurement angles.
This function takes an open graph G = (nodes, edges, input, outputs), specified by networks.Graph and two lists specifying input and output nodes. Currently we support XY-plane measurements.
Searches for the flow in the open graph using
flow()and if found, construct the measurement pattern according to the theorem 1 of [NJP 9, 250 (2007)].Then, if no flow was found, searches for gflow using
gflow(), from which measurement pattern can be constructed from theorem 2 of [NJP 9, 250 (2007)].The constructed measurement pattern deterministically realize the unitary embedding
\[U = \left( \prod_i \langle +_{\alpha_i} |_i \right) E_G N_{I^C},\]where the measurements (bras) with always \(\langle+|\) bases determined by the measurement angles \(\alpha_i\) are applied to the measuring nodes, i.e. the randomness of the measurement is eliminated by the added byproduct commands.
See also
- Parameters
graph (networkx.Graph) – graph on which MBQC should be performed
angles (dict) – measurement angles for each nodes on the graph (unit of pi), except output nodes
inputs (list) – list of node indices for input nodes
outputs (list) – list of node indices for output nodes
timeout (int) – optional argument for flow and gflow search depth
- Returns
pattern – constructed pattern.
- Return type
graphix.pattern.Pattern object