Memory¶
Models for simulation of quantum memories.
This module defines the Memory class to simulate single atom memories as well as the MemoryArray class to aggregate memories. Memories will attempt to send photons through the send_qubit interface of nodes. Photons should be routed to a BSM device for entanglement generation, or through optical hardware for purification and swapping.
- class src.components.memory.AbsorptiveMemory(name: str, timeline: Timeline, frequency: float, absorption_efficiency: float, afc_efficiency: ~typing.Callable, mode_number: int, wavelength: int, prepare_time: int = 0, afc_lifetime: float = -1, coherence_time: float = -1, fidelity: float = 1, overlap_error: float = 0, is_spinwave=False, is_reversed=False, destination=None, spin_efficiency=<function const>)¶
Atomic ensemble absorptive memory.
This class models an AFC(-spinwave) absorptive memory, where the quantum state is stored as collective excitation of atomic ensemble. Rephasing time (predetermined storage time for AFC type) is given by temporal mode number and length of each temporal mode bin. This class does not support qubit state manipulation, individual photons should be manipulated instead.
Before invoking methods like “get” and “retrieve”, need to call “prepare” first to prepare the AFC, will take finite simulation time. Retrieved photon sequence might be reversed (only for AFC-spinwave), which is physically determined by RF pulses used during spinwave. Note that for AFC (not spinwave) type, is_reversed must be False.
Note that the memory is reusable (available for other rounds of absorption) as long as AFC structure is still usable. Once AFC structure expires the memory also expires, and the memory needs to be re-prepared so stored photons cannot be retrieved. Spinwave coherence time determines whether a certain cycle of absorption and re-emission will be successful. Eg. If on-demand storage time is longer than spinwave coherence time, the information stored in this cycle will be cleared.
However, if the AFC structure retains usability (in this example AFC_lifetime > coherence_time), the memory itself is not expired.
- name¶
label for memory instance.
- Type:
str
- fidelity¶
(current) fidelity of memory’s entanglement.
- Type:
float
- frequency¶
maximum frequency of absorption for memory (total frequency bandwidth of AFC memory) (in Hz).
- Type:
float
- absorption_efficiency¶
probability of absorbing a photon when arriving at the memory.
- Type:
float
- afc_efficiency¶
probability of emitting a photon as a function of AFC re-emission time of optical AFC.
- Type:
Callable
- spin_efficiency¶
effeciency of spinwave storage as a function of storage time.
- Type:
Callable
- mode_number¶
number of temporal modes available for storing photons, i.e. number of peaks in Atomic Frequency Comb.
- Type:
int
- mode_bin¶
- Type:
int
- afc_lifetime¶
average usable lifetime of AFC structure (in s), 0 means infinite lifetime.
- Type:
float
- coherence_time¶
average usable lifetime of spinwave storage (spinwave transition coherence time) (in s), 0 means infinite coherence time.
- Type:
float
- wavelength¶
wavelength (in nm) of absorbed and emitted photons.
- Type:
float
- total_time¶
AFC re-phasing time (in ps)
- Type:
float
- overlap_error¶
error due to photon overlap in one temporal mode, will degrade fidelity.
- Type:
float
- prepare_time¶
time to prepare AFC (in ps).
- Type:
float
- photon_counter¶
counts number of detection events.
- Type:
int
- absorb_start_time¶
start time (in ps) of photon absorption.
- Type:
int
- retrieve_start_time¶
start time (in ps) of photon retrieval.
- Type:
int
- is_spinwave¶
determines if the memory is AFC or AFC-spinwave, default False.
- Type:
Bool
- is_reversed¶
determines re-emission sequence, physically determined by RF pulses during spinwave, default False.
- Type:
Bool
- is_prepared¶
determines if AFC is successfully prepared.
- Type:
Bool
- memory_array¶
memory array aggregating current memory.
- Type:
- destination¶
name of predetermined re-emission destination node, default None.
- Type:
str
- entangled_memory¶
tracks entanglement state of memory with a memory.
- Type:
Dict[str, Any]
- stored_photons¶
photons stored in memory temporal modes.
- Type:
List[Dict]
- detach(observer: EntanglementProtocol)¶
Method to remove an observer.
- expire() None ¶
Method to handle memory expiration due to AFC expiration.
- Side Effects:
Will notify upper entities of expiration via the pop interface. Will modify information stored by the memory.
- get_expire_time() int ¶
Method to get the simulation time when the memory is expired
- init()¶
Implementation of Entity interface (see base class).
- notify(msg: Dict[str, Any])¶
Method to notify all attached observers of an update.
- prepare()¶
Method to emulate the effect on timeline by AFC preparation.
Will schedule a preparation event in the future, after which is_prepared is set to true.
- reset() None ¶
Method to clear quantum memory.
Will reset memory state to no photon stored and will clear entanglement information. Will reset AFC to unprepared state.
- Side Effects:
Will modify internal parameters and photon storage information.
- retrieve(dst='')¶
Method to re-emit all stored photons in normal/reverse sequence on demand.
Efficiency is a function of time.
- set_memory_array(memory_array: MemoryArray)¶
Method to set the memory array to which the memory belongs
- Parameters:
memory_array (MemoryArray) – memory array to which the memory belongs
- storage_reset() None ¶
Method to clear information stored in one cycle of photon storage.
- update_expire_time(time: int)¶
Method to change time of expiration.
Should not normally be called by protocols.
- Parameters:
time (int) – new expiration time.
- class src.components.memory.Memory(name: str, timeline: Timeline, fidelity: float, frequency: float, efficiency: float, coherence_time: float, wavelength: int)¶
Individual single-atom memory.
This class models a single-atom memory, where the quantum state is stored as the spin of a single ion. This class will replace the older implementation once completed.
- name¶
label for memory instance.
- Type:
str
- fidelity¶
(current) fidelity of memory.
- Type:
float
- frequency¶
maximum frequency at which memory can be excited.
- Type:
float
- efficiency¶
probability of emitting a photon when excited.
- Type:
float
- coherence_time¶
average usable lifetime of memory (in seconds).
- Type:
float
- wavelength¶
wavelength (in nm) of emitted photons.
- Type:
float
- qstate_key¶
key for associated quantum state in timeline’s quantum manager.
- Type:
int
- entangled_memory¶
tracks entanglement state of memory.
- Type:
Dict[str, Any]
- detach(observer: EntanglementProtocol)¶
Method to remove an observer.
- excite(dst='') None ¶
Method to excite memory and potentially emit a photon.
If it is possible to emit a photon, the photon may be marked as null based on the state of the memory.
- Parameters:
dst (str) – name of destination node for emitted photon (default “”).
- Side Effects:
May modify quantum state of memory. May schedule photon transmission to destination node.
- expire() None ¶
Method to handle memory expiration.
Is scheduled automatically by the set_plus memory operation.
- Side Effects:
Will notify upper entities of expiration via the pop interface. Will modify the quantum state of the memory.
- init()¶
Method to initialize entity (abstract).
Entity init methods are invoked for all timeline entities when the timeline is initialized. This method can be used to perform any necessary functions before simulation.
- notify(msg: Dict[str, Any])¶
Method to notify all attached observers of an update.
- reset() None ¶
Method to clear quantum memory.
Will reset quantum state to |0> and will clear entanglement information.
- Side Effects:
Will modify internal parameters and quantum state.
- update_expire_time(time: int)¶
Method to change time of expiration.
Should not normally be called by protocols.
- Parameters:
time (int) – new expiration time.
- update_state(state: List[complex]) None ¶
Method to set the memory state to an arbitrary pure state.
- Parameters:
state (List[complex]) – array of amplitudes for pure state in Z-basis.
- Side Effects:
Will modify internal quantum state and parameters. May schedule expiration event.
- class src.components.memory.MemoryArray(name: str, timeline: Timeline, num_memories=10, fidelity=0.85, frequency=80000000.0, efficiency=1, coherence_time=- 1, wavelength=500)¶
Aggregator for Memory objects.
The MemoryArray can be accessed as a list to get individual memories.
- name¶
label for memory array instance.
- Type:
str
- init()¶
Implementation of Entity interface (see base class).
Set the owner of memory as the owner of memory array.
- class src.components.memory.MemoryWithRandomCoherenceTime(name: str, timeline: Timeline, fidelity: float, frequency: float, efficiency: float, coherence_time: float, coherence_time_stdev: float, wavelength: int)¶
Individual single-atom memory.
This class inherits Memory class and provides possibility to use stochastic model of coherence time. This means that loss of entanglement of the memory with a photon occurs at random time given by truncated normal distribution with average value set by ‘coherence_time’ input parameter and with standard deviation set by ‘coherence_time_stdev’ input parameter. If coherence_time_stdev <= 0.0 is passed, the class behaves exactly as original Memory class.
- name¶
label for memory instance.
- Type:
str
- fidelity¶
(current) fidelity of memory.
- Type:
float
- frequency¶
maximum frequency at which memory can be excited.
- Type:
float
- efficiency¶
probability of emitting a photon when excited.
- Type:
float
- coherence_time¶
average usable lifetime of memory (in seconds).
- Type:
float
- coherence_time_stdev¶
standard deviation of coherence time
- Type:
float
- wavelength¶
wavelength (in nm) of emitted photons.
- Type:
float
- qstate_key¶
key for associated quantum state in timeline’s quantum manager.
- Type:
int
- entangled_memory¶
tracks entanglement state of memory.
- Type:
Dict[str, Any]
- src.components.memory.const(t)¶
Constant function thal always returns 1. For AFC memory default spin efficiency.