Qiskit / qiskit-ibm-runtime

IBM Client for Qiskit Runtime
https://docs.quantum.ibm.com/api/qiskit-ibm-runtime
Apache License 2.0
139 stars 149 forks source link

Document supported backend filters #689

Closed kevinsung closed 1 year ago

kevinsung commented 1 year ago

What is the expected feature or enhancement? At https://qiskit.org/documentation/partners/qiskit_ibm_provider/stubs/qiskit_ibm_provider.IBMProvider.backends.html it says

**kwargs – Simple filters that specify a True/False criteria in the backend configuration, backends status, or provider credentials. An example to get the operational backends with 5 qubits: IBMProvider.backends(n_qubits=5, operational=True)

This gives an example of a simple filter ("operational") but doesn't actually provide a list of supported options.

Acceptance criteria I don't know what this issue template field is for.

kt474 commented 1 year ago

The link is documentation for qiskit-ibm-provider but the docstrings of the backends() methods from both repos can be improved.

For **kwargs, as mentioned, any True/False criteria in the backend configuration or attributes (link) can be used - there are too many options to list all of them, but we could add a couple more examples

The filter parameter is similar but not restricted to only a boolean True/False - lambda functions can be used

To see exactly how the filtering is done, we use the filter_backends method in terra.

We'll add a couple more examples to the docstring to make it more clear

merav-aharoni commented 1 year ago

@kt474 - I am a bit confused about the filtering mechanism. Here are my thoughts/observations:

kt474 commented 1 year ago

@kt474 - I am a bit confused about the filtering mechanism. Here are my thoughts/observations:

  • Yes I agree - it would be ideal to have documentation in a central location, but I think it would still be good to have it at least once in each repo
  • Sure, I think that would be helpful
  • Yes that example can be removed
  • Yes that's correct, those filters can only be done through a lambda function