QuISP
Loading...
Searching...
No Matches
quisp::modules::HardwareMonitor Class Reference

HardwareMonitor. More...

#include <HardwareMonitor.h>

Inheritance diagram for quisp::modules::HardwareMonitor:
Collaboration diagram for quisp::modules::HardwareMonitor:

Classes

struct  SingleQubitError
 

Public Member Functions

 HardwareMonitor ()
 
 ~HardwareMonitor ()
 
int getQnicNumQubits (int qnic_index, QNIC_type qnic_type) override
 
std::unique_ptr< InterfaceInfofindInterfaceByNeighborAddr (int neighbor_address) override
 
std::unique_ptr< ConnectionSetupInfofindConnectionInfoByQnicAddr (int qnic_address) override
 
- Public Member Functions inherited from quisp::modules::IHardwareMonitor
virtual ~IHardwareMonitor ()
 

Protected Member Functions

void initialize (int stage) override
 
void finish () override
 
void handleMessage (cMessage *msg) override
 
int numInitStages () const override
 
void prepareNeighborTable ()
 
virtual std::unique_ptr< NeighborInfocreateNeighborInfo (const cModule &thisNode)
 
virtual std::unique_ptr< NeighborInfogetNeighbor (cModule *qnic_pointer)
 
virtual cModule * getQNodeWithAddress (int address)
 
virtual InterfaceInfo getQnicInterfaceByQnicAddr (int qnic_index, QNIC_type qnic_type)
 
virtual void sendLinkTomographyRuleSet (int my_address, int partner_address, QNIC_type qnic_type, int qnic_index, unsigned long rule_id)
 
virtual Eigen::Matrix4cd reconstruct_density_matrix (int qnic_id, int partner)
 
virtual unsigned long createUniqueId ()
 
virtual void writeToFile_Topology_with_LinkCost (int qnic_id, double link_cost, double fidelity, double bellpair_per_sec)
 
std::unique_ptr< quisp::rules::RuleconstructPurifyRule (const std::string &rule_name, const rules::PurType pur_type, const int partner_address, const QNIC_type qnic_type, const int qnic_index, const int send_tag) const
 
std::unique_ptr< quisp::rules::RuleconstructCorrelationCheckRule (const std::string &rule_name, const rules::PurType pur_type, const int partner_address, const QNIC_type qnic_type, const int qnic_index, const int receive_tag) const
 

Protected Attributes

utils::ComponentProvider provider
 

Private Member Functions

cModule * getQnic (int qnic_index, QNIC_type qnic_type)
 

Private Attributes

int my_address
 
int num_qnic
 
int num_qnic_r
 
int num_qnic_rp
 
int num_qnic_total
 
bool do_link_level_tomography = false
 
int num_purification = 0
 
bool X_Purification = false
 
bool Z_Purification = false
 
int num_measure
 
int num_end_nodes
 
std::map< int, int > qnic_partner_map
 
IRoutingDaemonrouting_daemon
 
NeighborTable neighbor_table
 
RawDatatomography_data
 
SingleQubitError Pauli
 
TomographyOutcomeTabletemporal_tomography_output
 
LinkCostMaptomography_runningtime_holder
 
std::string tomography_output_filename
 
std::string file_dir_name
 
std::string purification_type
 

Detailed Description

Constructor & Destructor Documentation

◆ HardwareMonitor()

quisp::modules::HardwareMonitor::HardwareMonitor ( )

◆ ~HardwareMonitor()

quisp::modules::HardwareMonitor::~HardwareMonitor ( )

Member Function Documentation

◆ constructCorrelationCheckRule()

std::unique_ptr< Rule > quisp::modules::HardwareMonitor::constructCorrelationCheckRule ( const std::string & rule_name,
const rules::PurType pur_type,
const int partner_address,
const QNIC_type qnic_type,
const int qnic_index,
const int receive_tag ) const
protected

◆ constructPurifyRule()

std::unique_ptr< Rule > quisp::modules::HardwareMonitor::constructPurifyRule ( const std::string & rule_name,
const rules::PurType pur_type,
const int partner_address,
const QNIC_type qnic_type,
const int qnic_index,
const int send_tag ) const
protected

◆ createNeighborInfo()

std::unique_ptr< NeighborInfo > quisp::modules::HardwareMonitor::createNeighborInfo ( const cModule & thisNode)
protectedvirtual

◆ createUniqueId()

unsigned long quisp::modules::HardwareMonitor::createUniqueId ( )
protectedvirtual

◆ findConnectionInfoByQnicAddr()

std::unique_ptr< ConnectionSetupInfo > quisp::modules::HardwareMonitor::findConnectionInfoByQnicAddr ( int qnic_address)
overridevirtual

◆ findInterfaceByNeighborAddr()

std::unique_ptr< InterfaceInfo > quisp::modules::HardwareMonitor::findInterfaceByNeighborAddr ( int neighbor_address)
overridevirtual

◆ finish()

void quisp::modules::HardwareMonitor::finish ( )
overrideprotected

◆ getNeighbor()

std::unique_ptr< NeighborInfo > quisp::modules::HardwareMonitor::getNeighbor ( cModule * qnic_pointer)
protectedvirtual

◆ getQnic()

cModule * quisp::modules::HardwareMonitor::getQnic ( int qnic_index,
QNIC_type qnic_type )
private

◆ getQnicInterfaceByQnicAddr()

InterfaceInfo quisp::modules::HardwareMonitor::getQnicInterfaceByQnicAddr ( int qnic_index,
QNIC_type qnic_type )
protectedvirtual

◆ getQnicNumQubits()

int quisp::modules::HardwareMonitor::getQnicNumQubits ( int qnic_index,
QNIC_type qnic_type )
overridevirtual

◆ getQNodeWithAddress()

cModule * quisp::modules::HardwareMonitor::getQNodeWithAddress ( int address)
protectedvirtual

◆ handleMessage()

void quisp::modules::HardwareMonitor::handleMessage ( cMessage * msg)
overrideprotected

◆ initialize()

void quisp::modules::HardwareMonitor::initialize ( int stage)
overrideprotected

◆ numInitStages()

int quisp::modules::HardwareMonitor::numInitStages ( ) const
inlineoverrideprotected

◆ prepareNeighborTable()

void quisp::modules::HardwareMonitor::prepareNeighborTable ( )
protected

◆ reconstruct_density_matrix()

Matrix4cd quisp::modules::HardwareMonitor::reconstruct_density_matrix ( int qnic_id,
int partner )
protectedvirtual

◆ sendLinkTomographyRuleSet()

void quisp::modules::HardwareMonitor::sendLinkTomographyRuleSet ( int my_address,
int partner_address,
QNIC_type qnic_type,
int qnic_index,
unsigned long RuleSet_id )
protectedvirtual

A complex function defining RuleSets for purification and tomography on the link. This function creates one rule per purification. As the work proceeds, a resource gets promoted from rule to rule (on purification success), so if you ask for three rounds of purification, it will emit three purification rules.

For example, with "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z", the first instance of "first stage X purification" (Rule0) includes allocating the resources from the base pair pool, executing the purification circuit (including measurement), exchanging the result messages, comparing and either promoting or discarding, so a one-way classical messaging latency is incurred here.

Then, the "second stage Z purification" (Rule1, the first time through the loop) begins by drawing two Bell pairs that have each been promoted by the first X purification (rule 0). An additional one-way latency is incurred here.

These actions are alternated initial_purification times, for a total of 2n rules (and 2n times the one-way latency). Note that the semantics of initial_purification vary depending on the purification_type. In the descriptions below, $n$ is initial_purification.

Pumping doesn't really work because of the way resources are controlled as they are promoted from rule to rule. At the moment, base Bell pairs (those created directly by the link) exist in a pool, ordered by age. Over in Action.cc, you will find Action::getResource_fromTop(). This selects the oldest Bell pair. At the moment, only the first rule (Rule0) draws from this pool; however, pumping would require that later rules also be able to draw from the pool.

A purification scheme must be characterized by both the circuit being executed, and the scheduling discipline for selecting the inputs to the circuit. The scheduling discipline in theory can be pumping, symmetric tree (perfect binary tree), or banded, and should also specify how the resources are sorted. Currently, this is hard-coded to select oldest first, and is geared toward symmetric tree.

Purification_type "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z":

  • name: Ss-Sp / perfect binary tree, even rounds
  • rounds: 2n
  • input Bell pairs per round: 2
  • total Bell pairs: 2^(2n)
  • circuit: Fig. 6.3 in Takaaki's master's thesis
  • scheduling: symmetric tree

description:

Ss-Sp is single selection, single error purification. Between rounds, Hadamard gates are applied to switch basis, creating alternating rounds of X and Z purification.

The only difference between "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" and "N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" is the semantics of initial_purification. Here, each iteration results in two rules, guaranteeing an even number of rounds.

X always goes first.

Purification_type "N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z":

  • name: Ss-Sp / perfect binary tree, odd or even rounds
  • rounds: n
  • input Bell pairs per round: 2
  • total Bell pairs: 2^n
  • circuit: Fig. 6.3 in Takaaki's master's thesis
  • scheduling: perfect binary (symmetric) tree

description:

Ss-Sp is single selection, single error purification. Between rounds, Hadamard gates are applied to switch basis, creating alternating rounds of X and Z purification.

The only difference between "2N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" and "N_ALTERNATE_SINGLE_X_WITH_SINGLE_Z" is the semantics of initial_purification. Here, each iteration results in one rule, X for even-numbered rounds (counting from zero), Z for odd-numbered ones, so it is possible to do XZX or XZXZX (but not ZXZ or ZXZXZ).

Purification_type "N_SINGLE_XZ":

  • name: Ss-Dp XZ Purification
  • rounds: n
  • input Bell pairs per round: 3
  • total Bell pairs: 3^n
  • circuit: Fig. 12 in arXiv:1904.08605
  • scheduling: symmetric tree

description:

Both X and Z purification in a single action. If A is the pair being purified, and C and E are tools, CNOT(A,C), MEAS(C), CNOT(E,A), MEAS(E) then select after comparing outcomes. Note that bases are not flipped between rounds. Similar to "N_ALTERNATE_SINGLE_XZ_WITH_SINGLE_ZX".

Purification_type "N_ALTERNATE_SINGLE_XZ_WITH_SINGLE_ZX":

  • name: Ss-Dp XZ, ZX alternating
  • rounds: n
  • input Bell pairs per round: 3
  • total Bell pairs: 3^n
  • circuit: almost Fig. 12 from arXiv:1904.08605, but order of CNOTs reversed in alternating rounds
  • scheduling: symmetric tree

description:

Almost the same as "N_SINGLE_XZ", but first round is XZ, second round is ZX. Results in better alternating error suppression, but still not great.

Purification_type "N_DOUBLE_X":

  • name: Ds-Sp: Fujii-san's Double selection purification
  • rounds: n
  • input Bell pairs per round: 3
  • total Bell pairs: 3^n
  • circuit: Fig. 13 in arXiv:1904.08605
  • scheduling: symmetric tree

description:

Similar to "N_SINGLE_XZ" and "N_ALTERNATE_SINGLE_XZ_WITH_SINGLE_ZX" except that the control and target of the first CNOT are flipped, corresponding to Fujii-san's paper (PRA 80, 042308). Every round is identical. Note there is no basis change between rounds.

Purification_type "N_ALTERNATE_DOUBLE_X_WITH_DOUBLE_Z":

  • name: Ds-Sp: Fujii-san's Double selection purification (alternating)
  • rounds: n
  • input Bell pairs per round: 3
  • total Bell pairs: 3^n
  • circuit: almost Fig. 13 in arXiv:1904.08605, except that the order of the CNOTs alternates between rounds
  • scheduling: symmetric tree

description:

Similar to "N_DOUBLE_X", almost corresponding to Fujii-san's paper (PRA 80, 042308). Note there is no basis change between rounds, but that the first round is XZ, second is ZX.

Purification_type "N_ALTERNATE_DOUBLE_XZ_WITH_DOUBLE_ZX":

  • name: Ds-Dp: full double selection purification (alternating)
  • rounds: n
  • input Bell pairs per round: 5
  • total Bell pairs: 5^n
  • circuit: Fig. 14 in arXiv:1904.08605, except that the order of the CNOTs alternates between rounds
  • scheduling: symmetric tree

description:

A combination of "N_SINGLE_XZ" and "N_DOUBLE_X" (Figs. 12 & 13). Resource requirements are high; two rounds of this requires 25 Bell pairs. With a low base Bell pair generation rate and realistic memory decoherence, this will be impractical.

Purification_type "N_ALTERNATE_DOUBLE_X_SINGLE_Z_WITH_DOUBLE_Z_SINGLE_X":

  • name: half double selection, half single selection
  • rounds: n
  • input Bell pairs per round: 4
  • total Bell pairs: 4^n
  • circuit: no figure available
  • scheduling: symmetric tree

description:

Does double selection on X, single selection on Z Switches bases between rounds. Investigated for possibly highly asymmetric X/Z error rates in base Bell pairs. Initial results weren't very promised, not extensively used.

Purification_type "2+N_DOUBLE_X_THEN_DOUBLE_Z_ALTERNATE_SINGLE_X_WITH_SINGLE_Z":

  • name: Switching (B)
  • rounds: n
  • input Bell pairs per round: 3 in first two rounds, then 2
  • total Bell pairs: (complicated)
  • circuit: Fig. 21, case B in arXiv:1904.08605
  • scheduling: symmetric tree (*)

description:

Two rounds of Ds-Sp, then Ss-Sp. The point of this was to show that you don't have to stick with one scheme, but can use different schemes in different rounds.

Purification_type "1+N_DOUBLE_X_ALTERNATE_SINGLE_Z_WITH_SINGLE_X":

  • name: Switching (A)
  • rounds: n
  • input Bell pairs per round: 3 in first round, then 2
  • total Bell pairs: (complicated)
  • circuit: Fig. 21, case A in arXiv:1904.08605
  • scheduling: symmetric tree (*)

description:

One round of Ds-Sp, then Ss-Sp. The point of this was to show that you don't have to stick with one scheme, but can use different schemes in different rounds.

Purification_type default:

  • name: Boolean-driven (obsolete)
  • rounds: 1
  • input Bell pairs: 2 or 3
  • total Bell pairs: 2 or 3
  • circuit: <reference a figure>
  • scheduling: (commonly pumping, symmetric tree, or banded)

description:

uses X_Purification and Z_purification booleans, but is obsolete. Creates a single purification only, or a single round of double purification. Use of this for new work is deprecated.

◆ writeToFile_Topology_with_LinkCost()

void quisp::modules::HardwareMonitor::writeToFile_Topology_with_LinkCost ( int qnic_id,
double link_cost,
double fidelity,
double bellpair_per_sec )
protectedvirtual

Member Data Documentation

◆ do_link_level_tomography

bool quisp::modules::HardwareMonitor::do_link_level_tomography = false
private

◆ file_dir_name

std::string quisp::modules::HardwareMonitor::file_dir_name
private

◆ my_address

int quisp::modules::HardwareMonitor::my_address
private

◆ neighbor_table

NeighborTable quisp::modules::HardwareMonitor::neighbor_table
private

◆ num_end_nodes

int quisp::modules::HardwareMonitor::num_end_nodes
private

◆ num_measure

int quisp::modules::HardwareMonitor::num_measure
private

◆ num_purification

int quisp::modules::HardwareMonitor::num_purification = 0
private

◆ num_qnic

int quisp::modules::HardwareMonitor::num_qnic
private

◆ num_qnic_r

int quisp::modules::HardwareMonitor::num_qnic_r
private

◆ num_qnic_rp

int quisp::modules::HardwareMonitor::num_qnic_rp
private

◆ num_qnic_total

int quisp::modules::HardwareMonitor::num_qnic_total
private

◆ Pauli

SingleQubitError quisp::modules::HardwareMonitor::Pauli
private

◆ provider

utils::ComponentProvider quisp::modules::HardwareMonitor::provider
protected

◆ purification_type

std::string quisp::modules::HardwareMonitor::purification_type
private

◆ qnic_partner_map

std::map<int, int> quisp::modules::HardwareMonitor::qnic_partner_map
private

◆ routing_daemon

IRoutingDaemon* quisp::modules::HardwareMonitor::routing_daemon
private

◆ temporal_tomography_output

TomographyOutcomeTable* quisp::modules::HardwareMonitor::temporal_tomography_output
private

◆ tomography_data

RawData* quisp::modules::HardwareMonitor::tomography_data
private

◆ tomography_output_filename

std::string quisp::modules::HardwareMonitor::tomography_output_filename
private

◆ tomography_runningtime_holder

LinkCostMap* quisp::modules::HardwareMonitor::tomography_runningtime_holder
private

◆ X_Purification

bool quisp::modules::HardwareMonitor::X_Purification = false
private

◆ Z_Purification

bool quisp::modules::HardwareMonitor::Z_Purification = false
private

The documentation for this class was generated from the following files: