Export Device Gateway Files
Use the Python SDK to generate device topology JSON and PNG files and download Qubex configuration for a device gateway. These operations do not start measurements or update server configuration.
Prerequisites
Install an SDK build with device_topology and qubex helpers, then configure a local profile with an API token and project ID using the Python reference. For a source checkout, run pip install -e sdks/python from the repository root. The project needs a master calibration note and its chip data; the server also needs its Qubex configuration directory populated. Choose physical qubit IDs from that chip.
Export Files
Create a client and generate the topology. Replace the qubit IDs below. The server uses the chip associated with the project's latest master calibration note.
device_idlabels the output; it does not select a chip.pythonfrom qdash.sdk import QDash qdash = QDash.from_profile("local") topology = qdash.device_topology.create( qubits=["0", "2", "3"], )Omitted
nameanddevice_iduse the selected profile name (localin this example). Explicit labels override these defaults independently. WithQDash.from_env()orQDash(config), supply both labels; there is no profile name to use.To reuse a gateway request file, pass
**json.load(file)tocreate()instead.exclude_couplingsandconditionaccept the request's filters. Omitted filters use server defaults, including freshness filtering and the largest connected component. Inspecttopology.qubitsandtopology.couplingsto confirm which passed the filters.Save the JSON and PNG in the current directory.
pythontopology.save("device_topology.json") plot = topology.plot() plot.save("device_topology.png")A notebook displays
plotdirectly. Files are written only bysave(); parent directories must exist. Existing files raiseFileExistsError. Useoverwrite=Trueonly when you intend to replace them.Download the configuration.
pythonqdash.qubex.download_config("./qubex-config")The directory contains the server's configuration tree, including any
.gitmetadata, pluscalib_note.jsoncontaining the latest note'snotefield. The note replaces any archive file of the same name. Useinclude_calibration_note=Falseto download only the configuration archive, orqdash.qubex.calibration_note()to inspect the note separately. Configuration and note are separate reads, not a single consistent snapshot.
Confirm that the JSON has the expected device label and physical qubits, the PNG opens, and qubex-config contains the configuration files and calibration note. Point the gateway at these local paths using its configuration; the SDK does not configure or restart it.
Repeat or Recover an Export
A missing destination directory is created if its parent exists. Existing files are kept unless overwrite=True; unrelated files are never removed. Prefer a new directory when comparing exports. Updating an existing directory is not atomic across all files, so an operating-system failure may leave a partial update; retry into a new directory to recover. With overwrite=False, a file created by another export during the download is also kept, and the download raises FileExistsError. Writing into an existing directory with this setting requires filesystem support for hard links; otherwise, export into a new directory.
A missing calibration note fails the download before writing files. Check the selected project and calibration history, or omit the note explicitly. A topology request without the required note or chip data currently returns QDashApiError; verify those prerequisites. Malformed archives, path traversal, symlink members, and paths that differ only in case are rejected before extraction, including on case-sensitive filesystems.
How this works: Python SDK.