Skip to content

Commit

Permalink
missing switch statement
Browse files Browse the repository at this point in the history
* Add missing switch statement for manually selecting "statevector" qasm method
  • Loading branch information
chriseclectic committed Oct 1, 2019
1 parent c8dd423 commit e28c62a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/simulators/qasm/qasm_controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,18 @@ QasmController::simulation_method(const Circuit &circ,
bool validate) const {
// Check simulation method and validate state
switch(simulation_method_) {
case Method::statevector: {
if (validate) {
if (simulation_precision_ == Precision::single_precision) {
Statevector::State<QV::QubitVector<float>> state;
validate_state(state, circ, noise_model, true);
} else {
Statevector::State<QV::QubitVector<>> state;
validate_state(state, circ, noise_model, true);
}
}
return Method::statevector;
}
case Method::density_matrix: {
if (validate)
validate_state(DensityMatrix::State<>(), circ, noise_model, true);
Expand Down

0 comments on commit e28c62a

Please sign in to comment.