Skip to content

Add shim-garnet-mock local service - #169

Open
stonea wants to merge 1 commit into
openQSE:mainfrom
stonea:shim_garnet_mock
Open

stonea wants to merge 1 commit into
openQSE:mainfrom
stonea:shim_garnet_mock

Conversation

@stonea

@stonea stonea commented Oct 23, 2026 •

Copy link
Copy Markdown

Add a local shim-garnet-mock service so QFw examples can exercise the iqm-garnet-mock device through the QPM shim and IQM Resonance's mock garnet API.

fake-iqm is insufficient for an example that uses the MQT compiler, which is passed a qiskit target. We use the QPM telemetry service to populate this target, and the data returned from fake-iqm is insufficient.

To use this in QFw-SLURM-Cluster, use qfw-site-services to start the directory and shim services. Copy garnet-mock-device-access.yaml.example and garnet-mock-creds.json.example alongside it (removing the .example suffix), fill in your credentials, and point the QFW_EXAMPLE_DEVICE_ACCESS_CONFIG environment variable at your copy of the .yaml file. The run your example (e.g. ./qfw_qiskit_simple.sh) passing in --backend shim.

Related

Complements openQSE/QFw-SLURM-Cluster#72, which makes the IQM Garnet mock available as a QFw device.

Note: changes in this PR were produced with AI assistance (GitHub
Copilot, using various Claude models).

Add a local service definition for IQM Resonance's noiseless 20-qubit
Garnet mock simulator, so the qpm shim can be exercised against a real
provider endpoint without hardware access, and teach the examples to
start it.

Summary of changes:

* share/qfw/config/services/local-services.yaml: add the
  `shim-garnet-mock` service, backed by `svc_lib_qpm` with the
  `qrmi-qdmi` provider launch. It is `credential-mode: required`, so
  device access is always resolved from site.yaml's
  `service.device-access-config`, even in `--service-mode local`.
* examples/qfw_example_common.sh: map the `shim`, `garnet-mock` and
  `iqm-garnet-mock` backends to `shim-garnet-mock`. When
  `QFW_EXAMPLE_DEVICE_ACCESS_CONFIG` is set, pass a site config built
  from that file to the local setup, so the root-only site
  device-access file is not needed.
* examples/qfw_garnet_mock_device_access.yaml: add a sample
  device-access file for the `iqm-garnet-mock` QPU (provider `iqm`,
  provider device id `garnet:mock`), with instructions for pointing
  `QFW_EXAMPLE_DEVICE_ACCESS_CONFIG` at a user-owned copy so root is
  not needed. The credentials file holding the API key is not included.

The changes in this commit were produced with AI assistance (GitHub
Copilot, using various Claude models).

---
Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
@DougSO

DougSO commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this. Couple of notes:

  1. --backend garnet-mock and --backend iqm-garnet-mock start the service, but the example then fails. The backend name goes to QFwBackend(provider=...), which only accepts the names in backends/qfw_qiskit/qpm_selection.py, so both raise "unsupported QPM provider". Only --backend shim gets through. Adding a garnet-mock entry there that maps to provider shim (the way pasqal does) would make the alias work.

  2. With item 1 fixed, could shim stay out of the local mapping? In site mode --backend shim means whatever shim the site runs, and on the cluster that is the real ORNL q20. Having the same name mean the Garnet mock in local mode is easy to trip over. The comment that it is "the only such service" will also go stale once a second one is added.

  3. The PR description says to start the site directory and shim services first. In local mode (the default) the example starts its own directory and QPM. Is that step needed? If not, please drop it. On the cluster, starting the site shim and then adding --service-mode site would send the run to the q20 instead of the mock.

  4. The shipped local manifest now names iqm-garnet-mock, but QFw does not define that device anywhere. It only exists in QFw-SLURM-Cluster#72. Could the device-access and credentials templates live in examples/ here, like qfw_shim_device_access.yaml, so the example also works outside the cluster?

  5. Optional: tests/test_qfw_example_result_output.py already drives qfw_example_setup_backend_service. A case for the new mapping and the QFW_EXAMPLE_DEVICE_ACCESS_CONFIG branch would keep them working.

Could you also note which examples you ran against the mock, and through which library (QRMI or QDMI)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants