Skip to content

Commit

Permalink
Fix mac build errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jul 31, 2024
1 parent b75d04a commit a438be4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/stim/simulators/error_analyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void ErrorAnalyzer::check_for_gauge(
if (has_detectors) {
error_msg << "The circuit contains non-deterministic detectors.\n";
}
size_t range_start = num_ticks_in_past - std::min(num_ticks_in_past, size_t{5});
size_t range_start = num_ticks_in_past - std::min((size_t)num_ticks_in_past, size_t{5});
size_t range_end = num_ticks_in_past + 5;
error_msg << "\nTo make an SVG picture of the problem, you can use the python API like this:\n ";
error_msg << "your_circuit.diagram('detslice-with-ops-svg'";
Expand Down
18 changes: 9 additions & 9 deletions src/stim/stabilizers/pauli_string_ref.inl
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,9 @@ template <bool reverse_order>
void PauliStringRef<W>::do_SWAP(const CircuitInstruction &inst) {
const auto &targets = inst.targets;
assert((targets.size() & 1) == 0);
for (size_t k = 0; k < inst.targets.size(); k += 2) {
size_t k2 = reverse_order ? inst.targets.size() - 2 - k : k;
size_t q1 = inst.targets[k2].data, q2 = inst.targets[k2 + 1].data;
for (size_t k = 0; k < targets.size(); k += 2) {
size_t k2 = reverse_order ? targets.size() - 2 - k : k;
size_t q1 = targets[k2].data, q2 = targets[k2 + 1].data;
zs[q1].swap_with(zs[q2]);
xs[q1].swap_with(xs[q2]);
}
Expand Down Expand Up @@ -1195,9 +1195,9 @@ template <bool reverse_order>
void PauliStringRef<W>::do_XCZ(const CircuitInstruction &inst) {
const auto &targets = inst.targets;
assert((targets.size() & 1) == 0);
for (size_t k = 0; k < inst.targets.size(); k += 2) {
size_t k2 = reverse_order ? inst.targets.size() - 2 - k : k;
size_t q1 = inst.targets[k2].data, q2 = inst.targets[k2 + 1].data;
for (size_t k = 0; k < targets.size(); k += 2) {
size_t k2 = reverse_order ? targets.size() - 2 - k : k;
size_t q1 = targets[k2].data, q2 = targets[k2 + 1].data;
do_single_cx(inst, q2, q1);
}
}
Expand Down Expand Up @@ -1238,9 +1238,9 @@ template <bool reverse_order>
void PauliStringRef<W>::do_YCZ(const CircuitInstruction &inst) {
const auto &targets = inst.targets;
assert((targets.size() & 1) == 0);
for (size_t k = 0; k < inst.targets.size(); k += 2) {
size_t k2 = reverse_order ? inst.targets.size() - 2 - k : k;
size_t q1 = inst.targets[k2].data, q2 = inst.targets[k2 + 1].data;
for (size_t k = 0; k < targets.size(); k += 2) {
size_t k2 = reverse_order ? targets.size() - 2 - k : k;
size_t q1 = targets[k2].data, q2 = targets[k2 + 1].data;
do_single_cy(inst, q2, q1);
}
}
Expand Down

0 comments on commit a438be4

Please sign in to comment.