You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

projectq.patch001 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --- ProjectQ-0.5.1/projectq/backends/_sim/_cppkernels/simulator.hpp 2020-06-05 21:07:57.000000000 +0800
  2. +++ ProjectQ-0.5.1_new/projectq/backends/_sim/_cppkernels/simulator.hpp 2021-01-14 10:52:24.822039389 +0800
  3. @@ -33,7 +33,6 @@
  4. #include <random>
  5. #include <functional>
  6. -
  7. class Simulator{
  8. public:
  9. using calc_type = double;
  10. @@ -44,8 +43,9 @@ public:
  11. using Term = std::vector<std::pair<unsigned, char>>;
  12. using TermsDict = std::vector<std::pair<Term, calc_type>>;
  13. using ComplexTermsDict = std::vector<std::pair<Term, complex_type>>;
  14. + StateVector vec_;
  15. - Simulator(unsigned seed = 1) : N_(0), vec_(1,0.), fusion_qubits_min_(4),
  16. + Simulator(unsigned seed = 1) : vec_(1,0.), N_(0), fusion_qubits_min_(4),
  17. fusion_qubits_max_(5), rnd_eng_(seed) {
  18. vec_[0]=1.; // all-zero initial state
  19. std::uniform_real_distribution<double> dist(0., 1.);
  20. @@ -562,7 +562,6 @@ private:
  21. }
  22. unsigned N_; // #qubits
  23. - StateVector vec_;
  24. Map map_;
  25. Fusion fused_gates_;
  26. unsigned fusion_qubits_min_, fusion_qubits_max_;
  27. @@ -570,10 +569,8 @@ private:
  28. std::function<double()> rng_;
  29. // large array buffers to avoid costly reallocations
  30. - static StateVector tmpBuff1_, tmpBuff2_;
  31. + StateVector tmpBuff1_, tmpBuff2_;
  32. };
  33. -Simulator::StateVector Simulator::tmpBuff1_;
  34. -Simulator::StateVector Simulator::tmpBuff2_;
  35. #endif