qrunch.quantum.circuits.synthesis.synthesized_circuit
Module containing the SynthesizedCircuit dataclass.
Classes
A circuit that has been mapped to a device topology by a layout synthesizer. |
|
A universal gate circuit that has been mapped to a device topology by a layout synthesizer. |
- class SynthesizedCircuit
Bases:
objectA circuit that has been mapped to a device topology by a layout synthesizer.
All fields are immutable (
frozen=True) so an instance can be safely reused.- Parameters:
original_circuit – The circuit before layout synthesis.
mapped_circuit – The circuit after layout synthesis, with SWAP gates inserted for the target topology.
device – The device data for the target topology, if available.
initial_mapping – The initial logical-to-physical qubit mapping before synthesis.
final_mapping – The final logical-to-physical qubit mapping produced by synthesis.
- __init__(original_circuit: UniversalGateCircuit, mapped_circuit: Circuit, device: DeviceData | None, initial_mapping: QubitMap, final_mapping: QubitMap) None
- Parameters:
original_circuit (UniversalGateCircuit)
mapped_circuit (Circuit)
device (DeviceData | None)
initial_mapping (QubitMap)
final_mapping (QubitMap)
- Return type:
None
- device: DeviceData | None
- classmethod from_unswapped_circuit(circuit: UniversalGateCircuit, device: DeviceData | None = None) SynthesizedCircuit
Create a SynthesizedCircuit from an unswapped circuit.
This is useful for cases where no SWAP gates are needed, and the original circuit can be used as the mapped circuit.
- Parameters:
circuit (UniversalGateCircuit) – The original circuit that does not require any SWAP gates.
device (DeviceData | None) – The device data for the target topology, if available.
- Return type:
- original_circuit: UniversalGateCircuit
- class SynthesizedUniversalGateCircuit
Bases:
objectA universal gate circuit that has been mapped to a device topology by a layout synthesizer.
All fields are immutable (
frozen=True) so an instance can be safely reused.- Parameters:
original_circuit – The circuit before layout synthesis.
mapped_circuit – The circuit after layout synthesis, with SWAP gates inserted for the target topology.
device – The device data for the target topology, if available.
initial_mapping – The initial logical-to-physical qubit mapping before synthesis.
final_mapping – The final logical-to-physical qubit mapping produced by synthesis.
- __init__(original_circuit: UniversalGateCircuit, mapped_circuit: UniversalGateCircuit, device: DeviceData | None, initial_mapping: QubitMap, final_mapping: QubitMap) None
- Parameters:
original_circuit (UniversalGateCircuit)
mapped_circuit (UniversalGateCircuit)
device (DeviceData | None)
initial_mapping (QubitMap)
final_mapping (QubitMap)
- Return type:
None
- device: DeviceData | None
- classmethod from_unswapped_circuit(circuit: UniversalGateCircuit) SynthesizedUniversalGateCircuit
Create a SynthesizedUniversalGateCircuit from an unswapped circuit.
This is useful for cases where no SWAP gates are needed, and the original circuit can be used as the mapped circuit.
- Parameters:
circuit (UniversalGateCircuit) – The original circuit that does not require any SWAP gates.
- Return type:
- get_measured_qubits() list[PhysicalQubit]
Return the list of physical qubits that are measured in the circuit.
- Return type:
list[PhysicalQubit]
- mapped_circuit: UniversalGateCircuit
- original_circuit: UniversalGateCircuit