SimulaQron.cqc.backend package¶
Subpackages¶
SimulaQron.cqc.backend.cqcHeader module¶
-
class
SimulaQron.cqc.backend.cqcHeader.
CQCCmdHeader
(headerBytes=None)[source]¶ Bases:
object
Header for a command instruction packet.
-
class
SimulaQron.cqc.backend.cqcHeader.
CQCHeader
(headerBytes=None)[source]¶ Bases:
object
Definition of the general CQC header.
-
class
SimulaQron.cqc.backend.cqcHeader.
CQCNotifyHeader
(headerBytes=None)[source]¶ Bases:
object
Header used to specify notification details.
SimulaQron.cqc.backend.cqcProtocol module¶
-
class
SimulaQron.cqc.backend.cqcProtocol.
CQCFactory
(host, name, cqcNet)[source]¶ Bases:
twisted.internet.protocol.Factory
-
lookup
(ip, port)[source]¶ Lookup name of remote host used within SimulaQron given ip and portnumber.
-
-
class
SimulaQron.cqc.backend.cqcProtocol.
CQCProtocol
(factory)[source]¶ Bases:
twisted.internet.protocol.Protocol
-
cmd_epr
(cqc_header, cmd, xtra)[source]¶ Create EPR pair with another node. Depending on the ips and ports this will either create an EPR-pair and send one part, or just receive.
-
cmd_epr_recv
(cqc_header, cmd, xtra)[source]¶ Receive half of epr from another node. Block until qubit is received.
-
cmd_i
(cqc_header, cmd, xtra)[source]¶ Do nothing. In reality we would wait a timestep but in SimulaQron we just do nothing.
-
cmd_new
(cqc_header, cmd, xtra, return_q_id=False)[source]¶ Request a new qubit. Since we don’t need it, this python CQC just provides very crude timing information. (return_q_id is used internally)
-
cmd_recv
(cqc_header, cmd, xtra)[source]¶ Receive qubit from another node. Block until qubit is received.
-
dataReceived
(data)[source]¶ Receive data. We will always wait to receive enough data for the header, and then the entire packet first before commencing processing.
-
get_virt_qubit
(header, qubit_id)[source]¶ Get reference to the virtual qubit reference in SimulaQron given app and qubit id, if it exists. If not found, send back no qubit error.
Caution: Twisted PB does not allow references to objects to be passed back between connections. If you need to pass a qubit reference back to the Twisted PB on a _different_ connection, then use get_virt_qubit_indep below.
-
get_virt_qubit_indep
(header, qubit_id)[source]¶ Get NUMBER (not reference!) to virtual qubit in SimulaQron specific to this connection. If not found, send back no qubit error.
-
handle_hello
(header, data)[source]¶ Hello just requires us to return hello - for testing availablility.
-
hasXtra
(cmd)[source]¶ Check whether this command includes an extra header with additional information.
-
new_ent_id
(host_app_id, remote_node, remote_app_id)[source]¶ Returns a new unique entanglement id for the specified host_app_id, remote_node and remote_app_id. Used by cmd_epr.
-