documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Document primitive option precedence rules

Open ihincks opened this issue 3 months ago • 3 comments

URL, if applicable

No response

Describe the new content you are requesting.

When a user sets options like this,

from qiskit_ibm_runtime import EstimatorV2, QiskitRuntimeService
from qiskit import QuantumCircuit

service = QiskitRuntimeService()
backend = service.backend("ibm_auckland")

estimator = EstimatorV2(backend)

estimator.options.default_shots = 100
estimator.options.resilience_level = 0
estimator.options.resilience.zne_mitigation = True

it might not be clear how the resilience level might interact with the other options, because the resilience level itself can modify the mitigation strategy. In this example, does setting the resilience level to 0 have the effect of turning off the attempt to add zne_mitigation? (spoiler: no)

What needs to be documented is that that the resilience level is FIRST used to set a base configuration on any options it thinks are relevant, and THEN any other user-specified options are updated on top of that. So it would be possible, for example, though pointless, to completely undo the effect of setting the resilience level by reversing all of its intentions manually.

If this new content request is accepted, do you want to write the content?

I can help the team by providing enough information to write the material

ihincks avatar Apr 26 '24 18:04 ihincks