pyquil.quantum_processor.transformers.graph_to_compiler_isa module¶
- exception pyquil.quantum_processor.transformers.graph_to_compiler_isa.GraphGateError[source]¶
Bases:
ValueErrorSignals an error when creating a
CompilerISAfrom annx.Graph. This may raise as a consequence of unsupported gates.
- pyquil.quantum_processor.transformers.graph_to_compiler_isa.compiler_isa_to_graph(compiler_isa: CompilerISA) Graph[source]¶
Generate an
nx.Graphbased on the qubits and edges of anyCompilerISA.
- pyquil.quantum_processor.transformers.graph_to_compiler_isa.graph_to_compiler_isa(graph: Graph, gates_1q: List[str] | None = None, gates_2q: List[str] | None = None) CompilerISA[source]¶
Generate an
CompilerISAobject from a NetworkX graph and list of 1Q and 2Q gates. May raiseGraphGateErrorif the specified gates are not supported.- Parameters:
graph – The graph topology of the quantum_processor.
gates_1q – A list of 1Q gate names to be made available for all qubits in the quantum_processor. Defaults to
DEFAULT_1Q_GATES.gates_2q – A list of 2Q gate names to be made available for all edges in the quantum_processor. Defaults to
DEFAULT_2Q_GATES.