diff --git a/src/stim/simulators/error_analyzer.cc b/src/stim/simulators/error_analyzer.cc index 1fe3a9be..5795cb8d 100644 --- a/src/stim/simulators/error_analyzer.cc +++ b/src/stim/simulators/error_analyzer.cc @@ -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'"; diff --git a/src/stim/stabilizers/pauli_string_ref.inl b/src/stim/stabilizers/pauli_string_ref.inl index 1be812e7..7fcd5f65 100644 --- a/src/stim/stabilizers/pauli_string_ref.inl +++ b/src/stim/stabilizers/pauli_string_ref.inl @@ -989,9 +989,9 @@ template void PauliStringRef::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]); } @@ -1195,9 +1195,9 @@ template void PauliStringRef::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); } } @@ -1238,9 +1238,9 @@ template void PauliStringRef::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); } }