qns.entity.qchannel package
Submodules
qns.entity.qchannel.losschannel module
- class qns.entity.qchannel.losschannel.QubitLossChannel(name: str | None = 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
- class qns.entity.qchannel.qchannel.QuantumChannel(name: str | None = None, node_list: List[QNode] = [], bandwidth: int = 0, 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 beforesimulator
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 = None, qubit: QuantumModel | None = None, dest: QNode | None = None, name: str | None = None, by: Any | None = None)[source]
Bases:
Event
The event for a QNode to receive a classic packet
Module contents
- class qns.entity.qchannel.QuantumChannel(name: str | None = None, node_list: List[QNode] = [], bandwidth: int = 0, 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 beforesimulator
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 = 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 = None, qubit: QuantumModel | None = None, dest: QNode | None = None, name: str | None = None, by: Any | None = None)[source]
Bases:
Event
The event for a QNode to receive a classic packet