QuISP
Loading...
Searching...
No Matches
quisp::runtime Namespace Reference

Classes

struct  Instruction
 This class represents IR (intermediate representation) instruction. Program consists of Instructions. More...
 
struct  InstructionVisitor
 Visitor class for instructions in a Program. More...
 
struct  Label
 label to annotate the instruction index in a Program. More...
 
struct  MemoryKey
 a key of memory key-value store in a RuleSet More...
 
class  MemoryValue
 memory value More...
 
struct  Op
 
class  Program
 The Program is a list of Instructions with metadata. The Runtime can execute the Program. More...
 
struct  QNodeAddr
 internal class to describe QNode's address. More...
 
struct  QubitId
 describes Qubit id in a Program. This is like a local variable name in a runtime::Program. Be careful, this is not used for RuleEngine or QNIC. More...
 
struct  Register
 
class  Rule
 The Runtime executable Rule in a RuleSet. More...
 
class  RuleSet
 The RuleSet. More...
 
class  Runtime
 Runtime class is responsible for executing the given RuleSet and the states' management. More...
 
class  RuntimeManager
 
union  ValueUnion
 actual memory value that can hold multiple types of values. More...
 

Typedefs

using InstructionTypes
 a variant that is capable of storing all instructions
 
using QubitResources = std::multimap<std::pair<QNodeAddr, RuleId>, IQubitRecord*>
 (partner's qnode addr, assigned RuleId) => [local half of the bell pair qubit record]
 
using QubitResourcesWithSequenceNumbers = std::map<std::tuple<QNodeAddr, RuleId, SequenceNumber>, IQubitRecord*>
 (partner's qnode addr, assigned RuleId, sequence number) => [local half of the stationary bell pair qubit record]
 
using SequenceNumberTracker = std::map<IQubitRecord*, std::tuple<QNodeAddr, RuleId, SequenceNumber>>
 
using SequenceNumberCounter = std::map<std::pair<QNodeAddr, RuleId>, SequenceNumber>
 ResourceId needs to be increment each time a qubit of certain properties (same <QNodeAddr>) is added to the Rule.
 
using MessageResources = std::map<RuleId, std::deque<MessageRecord>>
 Store messages for each rule for decision making mainly used for WaitRules (e.g., purification, Pauli Frame correction).
 
using QubitNameMap = std::unordered_map<QubitId, IQubitRecord*>
 QubitId and qubit record map. This is initialized in before each Program execution.
 
using Memory = std::unordered_map<MemoryKey, MemoryValue>
 Memory is a simple dict to store the value during RuleSet execution.
 
using RuleId = int
 
using SequenceNumber = unsigned long
 describes the order which Qubit is assigned to a Stage/Rule. This allows us to make assumptions that the same resource will be used in the same order across multiple nodes.
 
using MessageRecord = std::vector<int32_t>
 describes message received that takes part in decision making of RuleSet.
 
using String = std::string
 
using IQubitRecord = quisp::modules::qrsa::IQubitRecord
 
using MeasurementOutcome = quisp::backends::MeasurementOutcome
 measurement outcome for Instructions.
 
using Time = omnetpp::SimTime
 alias for omnetpp's simulation time.
 
using PurType = int
 purification type for Instructions. see rules::PurType enum.
 
using None = std::nullptr_t
 
using LabelMap = std::unordered_map<Label, int>
 utility type for storing a label and corresponding instruction index.
 

Enumerations

enum  OpType : int
 
enum class  RegId : int {
  REG0 , REG1 , REG2 , REG3 ,
  REG4
}
 internal register id representation for Instructions. More...
 
enum class  ReturnCode : int {
  NONE , COND_FAILED , COND_PASSED , RS_TERMINATED ,
  ERROR
}
 Program specify a ReturnCode during the execution. Then, the Runtime determines to perform the action, execute the next Rule, or stop the RuleSet. More...
 
enum class  Basis : int { Z , X , Y , RANDOM }
 basis for measurement instruction in a Program. More...
 
enum class  ValueType { INT , MEASUREMENT_OUTCOME }
 enum for memory value types More...
 

Functions

std::ostream & operator<< (std::ostream &stream, const QNodeAddr &value)
 
bool operator< (const QNodeAddr &a, const QNodeAddr &b)
 
bool operator== (const QNodeAddr &a, const QNodeAddr &b)
 
std::ostream & operator<< (std::ostream &stream, const QubitId &value)
 
bool operator< (const QubitId &a, const QubitId &b)
 
bool operator== (const QubitId &a, const QubitId &b)
 
std::ostream & operator<< (std::ostream &stream, const Label &label)
 
bool operator== (const Label &a, const Label &b)
 
std::ostream & operator<< (std::ostream &stream, const MemoryKey &key)
 
bool operator== (const MemoryKey &a, const MemoryKey &b)
 
std::ostream & operator<< (std::ostream &stream, const RegId &value)
 
std::ostream & operator<< (std::ostream &stream, const ReturnCode &value)
 
std::ostream & operator<< (std::ostream &stream, const Basis &value)
 
std::ostream & operator<< (std::ostream &stream, const MemoryValue &value)
 

Variables

static const std::string OpTypeStr []
 

Typedef Documentation

◆ InstructionTypes

a variant that is capable of storing all instructions

◆ IQubitRecord

◆ LabelMap

using quisp::runtime::LabelMap = std::unordered_map<Label, int>

utility type for storing a label and corresponding instruction index.

◆ MeasurementOutcome

measurement outcome for Instructions.

◆ Memory

using quisp::runtime::Memory = std::unordered_map<MemoryKey, MemoryValue>

Memory is a simple dict to store the value during RuleSet execution.

◆ MessageRecord

using quisp::runtime::MessageRecord = std::vector<int32_t>

describes message received that takes part in decision making of RuleSet.

first index [0], always contain the sequence number.

◆ MessageResources

using quisp::runtime::MessageResources = std::map<RuleId, std::deque<MessageRecord>>

Store messages for each rule for decision making mainly used for WaitRules (e.g., purification, Pauli Frame correction).

◆ None

using quisp::runtime::None = std::nullptr_t

◆ PurType

purification type for Instructions. see rules::PurType enum.

◆ QubitNameMap

using quisp::runtime::QubitNameMap = std::unordered_map<QubitId, IQubitRecord*>

QubitId and qubit record map. This is initialized in before each Program execution.

◆ QubitResources

using quisp::runtime::QubitResources = std::multimap<std::pair<QNodeAddr, RuleId>, IQubitRecord*>

(partner's qnode addr, assigned RuleId) => [local half of the bell pair qubit record]

◆ QubitResourcesWithSequenceNumbers

(partner's qnode addr, assigned RuleId, sequence number) => [local half of the stationary bell pair qubit record]

◆ RuleId

◆ SequenceNumber

using quisp::runtime::SequenceNumber = unsigned long

describes the order which Qubit is assigned to a Stage/Rule. This allows us to make assumptions that the same resource will be used in the same order across multiple nodes.

◆ SequenceNumberCounter

ResourceId needs to be increment each time a qubit of certain properties (same <QNodeAddr>) is added to the Rule.

◆ SequenceNumberTracker

◆ String

using quisp::runtime::String = std::string

◆ Time

using quisp::runtime::Time = omnetpp::SimTime

alias for omnetpp's simulation time.

Enumeration Type Documentation

◆ Basis

enum class quisp::runtime::Basis : int
strong

basis for measurement instruction in a Program.

Enumerator
RANDOM 

◆ OpType

◆ RegId

enum class quisp::runtime::RegId : int
strong

internal register id representation for Instructions.

Enumerator
REG0 
REG1 
REG2 
REG3 
REG4 

◆ ReturnCode

enum class quisp::runtime::ReturnCode : int
strong

Program specify a ReturnCode during the execution. Then, the Runtime determines to perform the action, execute the next Rule, or stop the RuleSet.

Enumerator
NONE 

do nothing.

COND_FAILED 

condition failed. stop the rule execution.

COND_PASSED 

condition passed. will perform the action.

RS_TERMINATED 

RuleSet terminated. will delete the RuleSet and the Runtime.

ERROR 

unrecorverable error raised. stop the simulation.

◆ ValueType

enum class quisp::runtime::ValueType
strong

enum for memory value types

Enumerator
INT 
MEASUREMENT_OUTCOME 

Function Documentation

◆ operator<() [1/2]

bool quisp::runtime::operator< ( const QNodeAddr & a,
const QNodeAddr & b )

◆ operator<() [2/2]

bool quisp::runtime::operator< ( const QubitId & a,
const QubitId & b )

◆ operator<<() [1/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const Basis & value )

◆ operator<<() [2/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const Label & label )

◆ operator<<() [3/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const MemoryKey & key )

◆ operator<<() [4/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const MemoryValue & value )

◆ operator<<() [5/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const QNodeAddr & value )

◆ operator<<() [6/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const QubitId & value )

◆ operator<<() [7/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const RegId & value )

◆ operator<<() [8/8]

std::ostream & quisp::runtime::operator<< ( std::ostream & stream,
const ReturnCode & value )

◆ operator==() [1/4]

bool quisp::runtime::operator== ( const Label & a,
const Label & b )

◆ operator==() [2/4]

bool quisp::runtime::operator== ( const MemoryKey & a,
const MemoryKey & b )

◆ operator==() [3/4]

bool quisp::runtime::operator== ( const QNodeAddr & a,
const QNodeAddr & b )

◆ operator==() [4/4]

bool quisp::runtime::operator== ( const QubitId & a,
const QubitId & b )

Variable Documentation

◆ OpTypeStr

const std::string quisp::runtime::OpTypeStr[]
static