Memory Manager

Definition of Memory Manager.

This module provides a definition for the memory manager, which tracks the state of memories on a node. There are three states of quantum memory represented by the string: “RAW”, “OCCUPIED”, “ENTANGLED”.

  • “RAW” denotes a free memory that is not entangling with other memories.

  • “OCCUPIED” denotes a memory that is allocated to protocols or applications.

  • “ENTANGLED” denotes a free memory that is entangling with other memories.

This is done through instances of the MemoryInfo class, which track a single memory.

class src.resource_management.memory_manager.MemoryInfo(memory: Memory, index: int, state='RAW')

Class to track memory information parameters for memory manager.

The memory info class chiefly tracks a memory’s entanglement state, in one of 3 allowed states:

  • RAW: Memory is unprocessed

  • OCCUPIED: Memory is occupied by some protocol

  • ENTANGLED: Memory has been successfully entangled

The class additionally tracks other memory parameters and properties.

memory

specific memory being tracked.

Type:

Memory

index

index of memory in memory array.

Type:

int

state

state of memory.

Type:

str

remote_node

name of node holding entangled memory.

Type:

str

remote_memo

name of entangled memory on remote node.

Type:

str

fidelity

fidelity of entanglement for memory.

Type:

int

expire_event

expiration event for the memory.

Type:

Event

entangle_time

time at which most recent entanglement is achieved.

Type:

int

to_entangled() None

Method to set memory to entangled state.

to_occupied() None

Method to set memory to occupied state.

to_raw() None

Method to set memory to raw (unentangled) state.

class src.resource_management.memory_manager.MemoryManager(memory_array: MemoryArray)

Class to manage a node’s memories.

The memory manager tracks the entanglement state of a node’s memories, along with other information (such as fidelity).

memory_array

memory array object to be tracked.

Type:

MemoryArray

memory_map

array of memory info objects corresponding to memory array.

Type:

List[MemoryInfo]

resource_manager

resource manager object using the memory manager.

Type:

ResourceManager

get_info_by_memory(memory: Memory) MemoryInfo

Gets memory info object for a desired memory.

set_resource_manager(resource_manager: ResourceManager) None

Method to set the resource manager.

update(memory: Memory, state: str) None

Method to update the state of a memory.

Modifies the memory info object corresponding to the memory.

Parameters:
  • memory (Memory) – memory to update.

  • state (str) – new state for memory.