Documentation ¶
Overview ¶
Package photon provides utilities for handling photon-encoded qubits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSimulatedChannel ¶
func NewSimulatedChannel(pMain, muLo, muMed, muHi, pLo, pMed, pHi float64, sendRand, receiveRand *rand.Rand) (*SimulatedSender, *SimulatedReceiver)
NewSimulatedChannel creates a pair of (Sender, Receiver) structs simulating a Quantum channel. It is expected that each call to Send() will be mirrored by a call to Receive(). Expect errors if that is not the case, and for calls to Send() to hang if more than 1 of them are made before a Receive().
Types ¶
type Receiver ¶
type Receiver interface { // Next returns the results of sending the next batch of qbits: // - bits contains the logical bit values sent/received // - bases specifies whether the "main" basis was used (0) or the "test" // basis (1), as in basis-biased BB84. For efficient qbit usage, the // ratio of 0s to 1s should be high. // - dropped provides a bitmask indicating which pulses we failed to detect // at all. Next(bytes int) (bits, bases, dropped []byte, err error) }
A Receiver receives linearly-polarized photons and decodes them in a given measurement basis.
type Sender ¶
type Sender interface { // Next returns the results of sending the next batch of qbits: // - bits contains the logical bit values sent/received // - bases specifies whether the "main" basis was used (0) or the "test" // basis (1), as in basis-biased BB84. For efficient qbit usage, the // ratio of 0s to 1s should be high. // - lo, med, and hi provide bitmasks which indicate the pulse strength // used to send the corresponding qbit. Next(bytes int) (bits, bases, lo, med, hi []byte, err error) }
A Sender sends qubits encoded as linearly-polarized photons to a Receiver.
type SimulatedReceiver ¶
type SimulatedSender ¶
type SimulatedSender struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.