Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Nov 25, 2023
1 parent e81b41e commit f613395
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/stim/simulators/vector_simulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ void VectorSimulator::apply(GateType gate, size_t qubit) {
try {
apply(GATE_DATA[gate].unitary(), {qubit});
} catch (const std::out_of_range &) {
throw std::out_of_range("Single qubit gate isn't supported by VectorSimulator: " + std::string(GATE_DATA[gate].name));
throw std::out_of_range(
"Single qubit gate isn't supported by VectorSimulator: " + std::string(GATE_DATA[gate].name));
}
}

void VectorSimulator::apply(GateType gate, size_t qubit1, size_t qubit2) {
try {
apply(GATE_DATA[gate].unitary(), {qubit1, qubit2});
} catch (const std::out_of_range &) {
throw std::out_of_range("Two qubit gate isn't supported by VectorSimulator: " + std::string(GATE_DATA[gate].name));
throw std::out_of_range(
"Two qubit gate isn't supported by VectorSimulator: " + std::string(GATE_DATA[gate].name));
}
}

Expand Down

0 comments on commit f613395

Please sign in to comment.