qns.entity.qchannel package

Submodules

qns.entity.qchannel.losschannel module

class qns.entity.qchannel.losschannel.QubitLossChannel(name: str = None, node_list: List[QNode] = [], bandwidth: int = 0, delay: float | DelayModel = 0, p_init: float = 0, attenuation_rate: float = 0, max_buffer_size: int = 0, length: float = 0, decoherence_rate: float | None = 0, transfer_error_model_args: dict = {})[source]

Bases: QuantumChannel

QubitLossChannel is the channel that can loss qubits.

The loss rate is: 1-(1-p_init)*10^{- attenuation_rate * length / 10}

qns.entity.qchannel.qchannel module

exception qns.entity.qchannel.qchannel.NextHopNotConnectionException[source]

Bases: Exception

class qns.entity.qchannel.qchannel.QuantumChannel(name: str = None, node_list: List[QNode] = [], fidelity: float = 0.8, bandwidth: int = 1, delay: float | DelayModel = 0, drop_rate: float = 0, max_buffer_size: int = 0, length: float = 0, decoherence_rate: float | None = 0, transfer_error_model_args: dict = {})[source]

Bases: Entity

QuantumChannel is the channel for transmitting qubit

install(simulator: Simulator) None[source]

install is called before simulator runs to initialize or set initial events

Parameters:

simulator (Simulator) – the simulator

send(qubit: QuantumModel, next_hop: QNode)[source]

Send a qubit to the next_hop

Parameters:
  • qubit (QuantumModel) – the transmitting qubit

  • next_hop (QNode) – the next hop QNode

Raises:

NextHopNotConnectionException – the next_hop is not connected to this channel

class qns.entity.qchannel.qchannel.RecvQubitPacket(t: Time | None = None, qchannel: QuantumChannel = None, qubit: QuantumModel = None, dest: QNode = None, name: str | None = None, by: Any | None = None)[source]

Bases: Event

The event for a QNode to receive a classic packet

invoke() None[source]

Invoke the event, should be implemented

Module contents

Bases: QuantumChannel

Link_Decoherence_QuantumChannel is the channel in which the fidelity of entangled pairs decoherence within the quantum memory.

Creat entangled pairs.

Find the entanglement pair whose fidelity is equal to the specified fidelity.

Parameters:

fidelity – the specified fidelity.

Find the entanglement pairs with maximum and minimum fidelity.

Remove the entanglement pair whose fidelity is equal to the specified fidelity.

Remove the entanglement pair whose fidelity is equal to the specified index.

class qns.entity.qchannel.QuantumChannel(name: str = None, node_list: List[QNode] = [], fidelity: float = 0.8, bandwidth: int = 1, delay: float | DelayModel = 0, drop_rate: float = 0, max_buffer_size: int = 0, length: float = 0, decoherence_rate: float | None = 0, transfer_error_model_args: dict = {})[source]

Bases: Entity

QuantumChannel is the channel for transmitting qubit

install(simulator: Simulator) None[source]

install is called before simulator runs to initialize or set initial events

Parameters:

simulator (Simulator) – the simulator

send(qubit: QuantumModel, next_hop: QNode)[source]

Send a qubit to the next_hop

Parameters:
  • qubit (QuantumModel) – the transmitting qubit

  • next_hop (QNode) – the next hop QNode

Raises:

NextHopNotConnectionException – the next_hop is not connected to this channel

class qns.entity.qchannel.QubitLossChannel(name: str = None, node_list: List[QNode] = [], bandwidth: int = 0, delay: float | DelayModel = 0, p_init: float = 0, attenuation_rate: float = 0, max_buffer_size: int = 0, length: float = 0, decoherence_rate: float | None = 0, transfer_error_model_args: dict = {})[source]

Bases: QuantumChannel

QubitLossChannel is the channel that can loss qubits.

The loss rate is: 1-(1-p_init)*10^{- attenuation_rate * length / 10}

class qns.entity.qchannel.RecvQubitPacket(t: Time | None = None, qchannel: QuantumChannel = None, qubit: QuantumModel = None, dest: QNode = None, name: str | None = None, by: Any | None = None)[source]

Bases: Event

The event for a QNode to receive a classic packet

invoke() None[source]

Invoke the event, should be implemented