qns.entity.qchannel package

Submodules

qns.entity.qchannel.losschannel module

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

Bases: qns.entity.qchannel.qchannel.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: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, drop_rate: float = 0, max_buffer_size: int = 0, length: float = 0, decoherence_rate: Optional[float] = 0, transfer_error_model_args: dict = {})[source]

Bases: qns.entity.entity.Entity

QuantumChannel is the channel for transmitting qubit

install(simulator: qns.simulator.simulator.Simulator) None[source]

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

Parameters

simulator (Simulator) – the simulator

send(qubit: qns.models.core.backend.QuantumModel, next_hop: qns.entity.node.node.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: Optional[qns.simulator.ts.Time] = None, qchannel: Optional[qns.entity.qchannel.qchannel.QuantumChannel] = None, qubit: Optional[qns.models.core.backend.QuantumModel] = None, dest: Optional[qns.entity.node.node.QNode] = None, name: Optional[str] = None, by: Optional[Any] = None)[source]

Bases: qns.simulator.event.Event

The event for a QNode to receive a classic packet

invoke() None[source]

Invoke the event, should be implemented

Module contents

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

Bases: qns.entity.entity.Entity

QuantumChannel is the channel for transmitting qubit

install(simulator: qns.simulator.simulator.Simulator) None[source]

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

Parameters

simulator (Simulator) – the simulator

send(qubit: qns.models.core.backend.QuantumModel, next_hop: qns.entity.node.node.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: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, p_init: float = 0, attenuation_rate: float = 0, max_buffer_size: int = 0, length: float = 0, decoherence_rate: Optional[float] = 0, transfer_error_model_args: dict = {})[source]

Bases: qns.entity.qchannel.qchannel.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: Optional[qns.simulator.ts.Time] = None, qchannel: Optional[qns.entity.qchannel.qchannel.QuantumChannel] = None, qubit: Optional[qns.models.core.backend.QuantumModel] = None, dest: Optional[qns.entity.node.node.QNode] = None, name: Optional[str] = None, by: Optional[Any] = None)[source]

Bases: qns.simulator.event.Event

The event for a QNode to receive a classic packet

invoke() None[source]

Invoke the event, should be implemented