Skip to content

transpilation Module

The pyqpanda3.transpilation module provides circuit transpilation, topology generation, and gate decomposition utilities. It maps logical quantum circuits onto physical hardware topologies, optimizes gate sequences, and decomposes high-level operations into native gate sets.

Overview

Transpilation is the process of transforming an abstract quantum program so that it can be executed on a specific quantum device. This module provides three core capabilities:

  • Topology generation -- Create connectivity graphs that describe the physical coupling map of a quantum chip.
  • Transpilation -- Map virtual qubits to physical qubits, insert SWAP gates for routing, translate gates into the device's native gate set, and apply circuit optimizations.
  • Decomposition -- Break down composite quantum operations (QProg, QCircuit, or unitary matrices) into a target set of basic gates.

A typical workflow first generates or obtains a chip topology, then constructs a Transpiler and calls transpile() to produce a hardware-compatible program. The decompose() function can be used independently to rewrite a circuit in terms of a specific gate basis.

This module also exports ChipBackend, a data class that encapsulates chip topology, supported gates, timing information, and other hardware properties for use with the transpile() backend overload.

Sub-topics

TopicDescription
TranspilerTranspiler class with transpile() overloads for topology-aware circuit mapping
Topologygenerate_topology() function for creating chip connectivity graphs
Decomposedecompose() overloads for QProg, QCircuit, and matrix decomposition

Released under the MIT License.