message: Added a unit test for Qpp  VQE mode
diff: @@ -499,6 +499,45 @@ TEST(QppAcceleratorTester, testDeuteronVqeH3Shots)
  // EXPECT_NEAR((*buffer)["opt-val"].as<double>(), -2.04482, 0.25);
  }
  +TEST(QppAcceleratorTester, testVqeMode)
  +{
  + // Use Qpp accelerator
  + auto accelerator = xacc::getAccelerator("qpp", {{"vqe-mode", true}});
  + EXPECT_EQ(accelerator->name(), "qpp");
  +
  + // Create the N=2 deuteron Hamiltonian
  + auto H_N_2 = xacc::quantum::getObservable(
  + "pauli", std::string("5.907 - 2.1433 X0X1 "
  + "- 2.1433 Y0Y1"
  + "+ .21829 Z0 - 6.125 Z1"));
  +
  + auto optimizer = xacc::getOptimizer("nlopt");
  + xacc::qasm(R"(
  + .compiler xasm
  + .circuit deuteron_ansatz
  + .parameters theta
  + .qbit q
  + X(q[0]);
  + Ry(q[1], theta);
  + CNOT(q[1],q[0]);
  + )");
  + auto ansatz = xacc::getCompiled("deuteron_ansatz");
  +
  + // Get the VQE Algorithm and initialize it
  + auto vqe = xacc::getAlgorithm("vqe");
  + vqe->initialize({std::make_pair("ansatz", ansatz),
  + std::make_pair("observable", H_N_2),
  + std::make_pair("accelerator", accelerator),
  + std::make_pair("optimizer", optimizer)});
  +
  + // Allocate some qubits and execute
  + auto buffer = xacc::qalloc(2);
  + vqe->execute(buffer);
  +
  + // Expected result: -1.74886
  + EXPECT_NEAR((*buffer)["opt-val"].as<double>(), -1.74886, 1e-4);
  +}
  +
  int main(int argc, char **argv) {
  xacc::Initialize();
  