Skip to main content

.qnet File Format

Load, save, and manipulate network topologies as JSON files.

QNetFile​

Container for .qnet JSON (load/save/diff).

QNetFile(name: str)
Field / MethodSignatureDescription
nodes—List of nodes in this file
links—List of links in this file
metadataQNetMetadataMetadata accessor
add_node(id, memory_lifetime_ms?, memory_capacity?, node_type?)(str, float?, int?, QNetNodeType?) -> NonePush 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?) -> NonePush a link onto the file
save(filepath)(str) -> NoneWrite pretty-printed JSON to disk

QNetNode​

Node for .qnet format.

QNetNode(id: str, memory_lifetime_ms?: float, memory_capacity?: int, node_type?: QNetNodeType)
FieldTypeDefaultDescription
idstr—Node ID
memory_lifetime_msfloat—Memory lifetime (ms)
memory_capacityint—Memory capacity
node_typeQNetNodeType—Node type classification

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)
FieldTypeDefaultDescription
idstr—Link ID
srcstr—Source node ID
tostr—Destination node ID
distance_kmfloat—Physical distance (km)
base_fidelityfloat—Raw link entanglement fidelity
generation_rate_hzfloat—Photon pair generation rate (Hz)
link_typeQNetLinkType—Link type classification
satelliteQNetSatelliteExtensionNoneSatellite extension data

QNetConfig​

Physics config for .qnet files.

QNetConfig(alpha_loss?: float, beta_fidelity_decay?: float, gamma_swapping?: float, max_attempts?: int)
FieldTypeDefaultDescription
alpha_lossfloat—Alpha loss parameter
beta_fidelity_decayfloat—Beta fidelity decay parameter
gamma_swappingfloat—Gamma swapping parameter
max_attemptsint—Maximum entanglement attempts

QNetConstraints​

Constraints for .qnet files (supports __eq__).

QNetConstraints(fidelity_target?: float, max_latency_ms?: float)
FieldTypeDefaultDescription
fidelity_targetfloat—Required fidelity
max_latency_msfloat—Max allowed latency (ms)

QNetMetadata​

Metadata for .qnet files.

QNetMetadata(name: str, description?: str, author?: str, created_at?: str)
FieldTypeDefaultDescription
namestr—File name
descriptionstrNoneFile description
authorstrNoneAuthor
created_atstrNoneCreation timestamp

QNetSatelliteExtension​

Satellite extension for .qnet links.

FieldTypeDefaultDescription
visibilityfloat—Satellite visibility factor
weather_factorfloat—Weather attenuation factor