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:
QuantumChannelQubitLossChannel 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
- 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:
EntityQuantumChannel is the channel for transmitting qubit
- install(simulator: Simulator) None[source]
installis called beforesimulatorruns 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:
EventThe event for a QNode to receive a classic packet
Module contents
- class qns.entity.qchannel.Link_Decoherence_QuantumChannel(name: str = None, node_list: List[QNode] = [], init_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 = {}, max_storage_time=0.4, min_storage_time=0.0)[source]
Bases:
QuantumChannelLink_Decoherence_QuantumChannel is the channel in which the fidelity of entangled pairs decoherence within the quantum memory.
- find_fidlity_index(fidelity)[source]
Find the entanglement pair whose fidelity is equal to the specified fidelity.
- Parameters:
fidelity – the specified fidelity.
- 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:
EntityQuantumChannel is the channel for transmitting qubit
- install(simulator: Simulator) None[source]
installis called beforesimulatorruns 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:
QuantumChannelQubitLossChannel 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:
EventThe event for a QNode to receive a classic packet