Unverified Commit 6ee30259 authored by Mccaskey, Alex's avatar Mccaskey, Alex Committed by GitHub
Browse files

Merge pull request #82 from tnguyen-ornl/tnguyen/apple-clang-fixes

Fixes for Clang toolchain
parents a9c78844 f5af3f10
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -291,7 +291,8 @@ double PhaseEstimationObjFuncEval::evaluate(
    for (const auto &[ampl, phase] : pronyFit) {
      const double freq = -std::arg(phase) * SAMPLING_FREQ;
      // Normalize
      const double amplitude = std::abs(ampl) / sumA;
      const bool isZeroOverZero = (std::abs(sumA) < 1e-12) && (std::abs(ampl) < 1e-12);
      const double amplitude = isZeroOverZero ? 1.0 : std::abs(ampl) / sumA;
      xacc::info("A = " + std::to_string(amplitude) +
                 "; Freq = " + std::to_string(freq));
      // Generic expectation value estimation (Eq. 22)
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ class NISQ : public ::quantum::QuantumRuntime {

  void exp(qreg q, const double theta,
           std::shared_ptr<xacc::Observable> Hptr_input) override {
    std::unordered_map<std::string, xacc::quantum::Term> terms;
    std::map<std::string, xacc::quantum::Term> terms;

    auto obs_str = Hptr_input->toString();
    auto fermi_to_pauli = xacc::getService<xacc::ObservableTransform>("jw");