message: Fix crash when running IBM accelerator
  Currently, running the ibm accelerator with backend set to the default
  will cause a crash. Fix this by making calls to IBM APIs just like other
  backends.
  And while we're in that file, support running on open IBM devices.
diff: @@ -60,17 +60,19 @@ void IBMAccelerator::initialize(const HeterogeneousMap &params) {
  // We should have backend set by now
  - if (!hub.empty()) {
  + if (hub.empty() && group.empty() && project.empty()) {
  + // Fallback to public API credentials
  + hub = "ibm-q";
  + group = "open";
  + project = "main";
  + }
  +
  IBM_CREDENTIALS_PATH =
  "/api/Network/" + hub + "/Groups/" + group + "/Projects/" + project;
  getBackendPath = IBM_CREDENTIALS_PATH + "/devices?access_token=";
  getBackendPropertiesPath = "/api/Network/" + hub + "/Groups/" + group +
  "/Projects/" + project + "/devices/" +
  backend + "/properties";
  - } else {
  - xacc::error(
  - "We do not currently support running on the open IBM devices.");
  - }
  // Post apiKey to get temp api key
  tokenParam += apiKey + "\"}";
  @@ -90,12 +92,11 @@ void IBMAccelerator::initialize(const HeterogeneousMap &params) {
  getBackendPropsResponse = "{\"backends\":" + response + "}";
  // Get current backend properties
  - if (backend != DEFAULT_IBM_BACKEND) {
  - auto response = get(IBM_API_URL, getBackendPropertiesPath, {},
  + auto backend_props_response = get(IBM_API_URL, getBackendPropertiesPath, {},
  {std::make_pair("version", "1"),
  std::make_pair("access_token", currentApiToken)});
  - xacc::info("Backend property:\n" + response);
  - auto props = json::parse(response);
  + xacc::info("Backend property:\n" + backend_props_response);
  + auto props = json::parse(backend_props_response);
  backendProperties.insert({backend, props});
  for (auto &b : backends_root["backends"]) {
  if (b.count("backend_name") &&
  @@ -112,7 +113,7 @@ void IBMAccelerator::initialize(const HeterogeneousMap &params) {
  {std::make_pair("version", "1"),
  std::make_pair("access_token", currentApiToken)});
  xacc::info("Backend default:\n" + defaults_response);
  - }
  +
  initialized = true;
  }
  }
  