• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sfc-aqua / quisp / 4329255112

pending completion
4329255112

Pull #504

github

GitHub
Merge 948c96a03 into 3166d7e57
Pull Request #504: Integrate Message Exchange (Purification/Entanglement Swapping) into RuleSet and Runtime

957 of 957 new or added lines in 22 files covered. (100.0%)

2287 of 5806 relevant lines covered (39.39%)

46937.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.9
/quisp/runtime/types.cc
1
#include "types.h"
2

3
#include <functional>
4
#include <iostream>
5
#include <string>
6

7
namespace quisp::runtime {
8

9
QNodeAddr::QNodeAddr(int val) : val(val) {}
71✔
10
std::ostream& operator<<(std::ostream& stream, const QNodeAddr& value) {
×
11
  stream << "QNodeAddr(" << std::to_string(value.val) << ")";
×
12
  return stream;
×
13
}
×
14
bool operator<(const QNodeAddr& a, const QNodeAddr& b) { return a.val < b.val; }
486✔
15
bool operator==(const QNodeAddr& a, const QNodeAddr& b) { return a.val == b.val; }
154✔
16

17
QubitId::QubitId(int val) : val(val) {}
45✔
18
size_t QubitId::operator()(const QubitId& id) const { return std::hash<int>()(id.val); }
×
19
std::ostream& operator<<(std::ostream& stream, const QubitId& value) {
×
20
  stream << "QubitId(" << std::to_string(value.val) << ")";
×
21
  return stream;
×
22
}
×
23
bool operator<(const QubitId& a, const QubitId& b) { return a.val < b.val; }
×
24
bool operator==(const QubitId& a, const QubitId& b) { return a.val == b.val; }
50✔
25

26
Label::Label(std::string val) : val(val) {}
81✔
27
std::ostream& operator<<(std::ostream& stream, const Label& label) {
×
28
  stream << "Label(" << label.val << ")";
×
29
  return stream;
×
30
}
×
31
bool operator==(const Label& a, const Label& b) { return a.val == b.val; }
43✔
32

33
MemoryKey::MemoryKey(std::string key) : val(key) {}
21✔
34
std::ostream& operator<<(std::ostream& stream, const MemoryKey& key) {
×
35
  stream << "MemoryKey(" << key.val << ")";
×
36
  return stream;
×
37
}
×
38
bool operator==(const MemoryKey& a, const MemoryKey& b) { return a.val == b.val; }
48✔
39

40
std::ostream& operator<<(std::ostream& stream, const RegId& value) {
3✔
41
  switch (value) {
3✔
42
    case RegId::REG0:
1✔
43
      stream << std::string("REG0");
1✔
44
      break;
1✔
45
    case RegId::REG1:
1✔
46
      stream << std::string("REG1");
1✔
47
      break;
1✔
48
    case RegId::REG2:
1✔
49
      stream << std::string("REG2");
1✔
50
      break;
1✔
51
    case RegId::REG3:
×
52
      stream << std::string("REG3");
×
53
      break;
×
54
    case RegId::REG4:
×
55
      stream << std::string("REG4");
×
56
      break;
×
57
  }
3✔
58
  return stream;
3✔
59
};
3✔
60

61
std::ostream& operator<<(std::ostream& stream, const ReturnCode& value) {
1✔
62
  switch (value) {
1✔
63
    case ReturnCode::COND_FAILED:
×
64
      stream << std::string("COND_FAILED");
×
65
      break;
×
66
    case ReturnCode::COND_PASSED:
×
67
      stream << std::string("COND_PASSED");
×
68
      break;
×
69
    case ReturnCode::NONE:
×
70
      stream << std::string("NONE");
×
71
      break;
×
72
    case ReturnCode::RS_TERMINATED:
×
73
      stream << std::string("RS_TERMINATED");
×
74
      break;
×
75
    case ReturnCode::ERROR:
1✔
76
      stream << std::string("ERROR");
1✔
77
      break;
1✔
78
  }
1✔
79
  return stream;
1✔
80
};
1✔
81

82
std::ostream& operator<<(std::ostream& stream, const Basis& value) {
×
83
  switch (value) {
×
84
    case Basis::X:
×
85
      stream << std::string("X");
×
86
      break;
×
87
    case Basis::Z:
×
88
      stream << std::string("Z");
×
89
      break;
×
90
    case Basis::Y:
×
91
      stream << std::string("Y");
×
92
      break;
×
93
    case Basis::RANDOM:
×
94
      stream << std::string("RANDOM");
×
95
      break;
×
96
  }
×
97
  return stream;
×
98
};
×
99
}  // namespace quisp::runtime
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc