Skip to content

Commit

Permalink
autoformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jan 24, 2024
1 parent 4d1ac5c commit 7b61b0c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 6 additions & 2 deletions src/stim/circuit/export_qasm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ struct QasmExporter {
target = t1;
break;
default:
throw std::invalid_argument("Not implemented in output_two_qubit_unitary_instruction_with_possible_feedback: " + instruction.str());
throw std::invalid_argument(
"Not implemented in output_two_qubit_unitary_instruction_with_possible_feedback: " +
instruction.str());
}

out << "if (";
Expand All @@ -279,7 +281,9 @@ struct QasmExporter {
}
out << "sweep[" << control.value() << "]";
} else {
throw std::invalid_argument("Not implemented in output_two_qubit_unitary_instruction_with_possible_feedback: " + instruction.str());
throw std::invalid_argument(
"Not implemented in output_two_qubit_unitary_instruction_with_possible_feedback: " +
instruction.str());
}
out << ") {\n";
out << " " << basis << " q[" << target.qubit_value() << "];\n";
Expand Down
3 changes: 2 additions & 1 deletion src/stim/simulators/error_matcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ void ErrorMatcher::rev_process_instruction(const CircuitInstruction &op) {
} else if (op.gate_type == GateType::M || op.gate_type == GateType::MR) {
err_m(op, TARGET_PAULI_Z_BIT);
} else {
throw std::invalid_argument("Not implemented in ErrorMatcher::rev_process_instruction: " + std::string(GATE_DATA[op.gate_type].name));
throw std::invalid_argument(
"Not implemented in ErrorMatcher::rev_process_instruction: " + std::string(GATE_DATA[op.gate_type].name));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/stim/stabilizers/pauli_string_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ struct PauliStringRef {

size_t weight() const;

private:
private:
void check_avoids_MPP(const CircuitInstruction &inst);
void check_avoids_reset(const CircuitInstruction &inst);
void check_avoids_measurement(const CircuitInstruction &inst);
Expand Down
9 changes: 5 additions & 4 deletions src/stim/stabilizers/pauli_string_ref.inl
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ bool PauliStringRef<W>::commutes(const PauliStringRef<W> &other) const noexcept
}

template <size_t W>
void PauliStringRef<W>::do_tableau(
const Tableau<W> &tableau, SpanRef<const size_t> indices, bool inverse) {
void PauliStringRef<W>::do_tableau(const Tableau<W> &tableau, SpanRef<const size_t> indices, bool inverse) {
if (tableau.num_qubits == 0 || indices.size() % tableau.num_qubits != 0) {
throw std::invalid_argument("len(tableau) == 0 or len(indices) % len(tableau) != 0");
}
Expand Down Expand Up @@ -254,7 +253,8 @@ void PauliStringRef<W>::check_avoids_MPP(const CircuitInstruction &inst) {
template <size_t W>
void PauliStringRef<W>::do_instruction(const CircuitInstruction &inst) {
for (const auto &t : inst.targets) {
if (t.has_qubit_value() && t.qubit_value() >= num_qubits && !(GATE_DATA[inst.gate_type].flags & GATE_HAS_NO_EFFECT_ON_QUBITS)) {
if (t.has_qubit_value() && t.qubit_value() >= num_qubits &&
!(GATE_DATA[inst.gate_type].flags & GATE_HAS_NO_EFFECT_ON_QUBITS)) {
std::stringstream ss;
ss << "The instruction '" << inst;
ss << "' targets qubits outside the pauli string '" << *this;
Expand Down Expand Up @@ -422,7 +422,8 @@ void PauliStringRef<W>::do_instruction(const CircuitInstruction &inst) {
template <size_t W>
void PauliStringRef<W>::undo_instruction(const CircuitInstruction &inst) {
for (const auto &t : inst.targets) {
if (t.has_qubit_value() && t.qubit_value() >= num_qubits && !(GATE_DATA[inst.gate_type].flags & GATE_HAS_NO_EFFECT_ON_QUBITS)) {
if (t.has_qubit_value() && t.qubit_value() >= num_qubits &&
!(GATE_DATA[inst.gate_type].flags & GATE_HAS_NO_EFFECT_ON_QUBITS)) {
std::stringstream ss;
ss << "The instruction '" << inst;
ss << "' targets qubits outside the pauli string '" << *this;
Expand Down

0 comments on commit 7b61b0c

Please sign in to comment.