.qnet File Format
Load, save, and manipulate network topologies as JSON files.
QNetFile
Container for .qnet JSON (load/save/diff).
QNetFile(name: str)
| Field / Method | Signature | Description |
|---|---|---|
nodes | — | List of nodes in this file |
links | — | List of links in this file |
metadata | QNetMetadata | Metadata accessor |
add_node(id, memory_lifetime_ms?, memory_capacity?, node_type?) | (str, float?, int?, QNetNodeType?) -> None | Push a node onto the file |
add_link(id, src, to, distance_km, base_fidelity, generation_rate_hz, link_type?, satellite?) | (str, str, str, float, float, float, QNetLinkType?, QNetSatelliteExtension?) -> None | Push a link onto the file |
save(filepath) | (str) -> None | Write pretty-printed JSON to disk |
QNetNode
Node for .qnet format.
QNetNode(id: str, memory_lifetime_ms?: float, memory_capacity?: int, node_type?: QNetNodeType)
| Field | Type | Default | Description |
|---|---|---|---|
id | str | — | Node ID |
memory_lifetime_ms | float | — | Memory lifetime (ms) |
memory_capacity | int | — | Memory capacity |
node_type | QNetNodeType | — | Node type classification |
QNetLink
Link for .qnet format.
QNetLink(id: str, src: str, to: str, distance_km: float, base_fidelity: float, generation_rate_hz: float, link_type?: QNetLinkType, satellite?: QNetSatelliteExtension)
| Field | Type | Default | Description |
|---|---|---|---|
id | str | — | Link ID |
src | str | — | Source node ID |
to | str | — | Destination node ID |
distance_km | float | — | Physical distance (km) |
base_fidelity | float | — | Raw link entanglement fidelity |
generation_rate_hz | float | — | Photon pair generation rate (Hz) |
link_type | QNetLinkType | — | Link type classification |
satellite | QNetSatelliteExtension | None | Satellite extension data |
QNetConfig
Physics config for .qnet files.
QNetConfig(alpha_loss?: float, beta_fidelity_decay?: float, gamma_swapping?: float, max_attempts?: int)
| Field | Type | Default | Description |
|---|---|---|---|
alpha_loss | float | — | Alpha loss parameter |
beta_fidelity_decay | float | — | Beta fidelity decay parameter |
gamma_swapping | float | — | Gamma swapping parameter |
max_attempts | int | — | Maximum entanglement attempts |
QNetConstraints
Constraints for .qnet files (supports __eq__).
QNetConstraints(fidelity_target?: float, max_latency_ms?: float)
| Field | Type | Default | Description |
|---|---|---|---|
fidelity_target | float | — | Required fidelity |
max_latency_ms | float | — | Max allowed latency (ms) |
QNetMetadata
Metadata for .qnet files.
QNetMetadata(name: str, description?: str, author?: str, created_at?: str)
| Field | Type | Default | Description |
|---|---|---|---|
name | str | — | File name |
description | str | None | File description |
author | str | None | Author |
created_at | str | None | Creation timestamp |
QNetSatelliteExtension
Satellite extension for .qnet links.
| Field | Type | Default | Description |
|---|---|---|---|
visibility | float | — | Satellite visibility factor |
weather_factor | float | — | Weather attenuation factor |