QNLP  v1.0
sim_factory.cpp
Go to the documentation of this file.
1 
11 #include "Simulator.hpp"
12 #include "IntelSimulator.cpp"
13 
14 #include <stdexcept>
15 #include <memory>
16 
17 using namespace QNLP;
18 
19 //Add new backends to the enum here.
20 enum SimBackend { intelqs=0, unknown=1 };
21 
29 template<class regType, class gateType>
30 std::unique_ptr<Simulator<regType,gateType>> Simulator<regType,gateType>::createSimulator(SimBackend sim, std::size_t numQubits){
31  //For new backends, please extend the switch case below.
32  switch( sim ){
33  case SimBackend::intelqs:
34  return std::make_unique<IntelSimulator>(numQubits);
35  default:
36  printf("No simulator chosen.");
37  throw std::runtime_error("Unknown simulator backend.");
38  }
39 }
40 
SimBackend
Definition: sim_factory.cpp:20