Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resilience input options not handled correctly #777

Closed
merav-aharoni opened this issue Mar 29, 2023 · 0 comments · Fixed by #778
Closed

Resilience input options not handled correctly #777

merav-aharoni opened this issue Mar 29, 2023 · 0 comments · Fixed by #778
Assignees
Labels
bug Something isn't working
Milestone

Comments

@merav-aharoni
Copy link
Contributor

Describe the bug
When one of the resilience_options is passed as input, the Options object created contains only this option and disregards the other default resilience_options.

Steps to reproduce

from qiskit_ibm_runtime import Options
options1 = Options(
            simulator={"noise_model": "aaa"},
        )
print(options1)
options2 = Options(
            resilience={"noise_amplifier": "GlobalFoldingAmplifier"},
        )
print(options2)

Result is:

Options(optimization_level=None, resilience_level=None, max_execution_time=None, transpilation=TranspilationOptions(skip_transpilation=False, initial_layout=None, layout_method=None, routing_method=None, approximation_degree=None), resilience=ResilienceOptions(noise_amplifier='TwoQubitAmplifier', noise_factors=(1, 3, 5), extrapolator='LinearExtrapolator'), execution=ExecutionOptions(shots=4000, init_qubits=True), environment=EnvironmentOptions(log_level='WARNING', callback=None, job_tags=[]), simulator=SimulatorOptions(noise_model='aaa', seed_simulator=None, coupling_map=None, basis_gates=None))
Options(optimization_level=None, resilience_level=None, max_execution_time=None, transpilation=TranspilationOptions(skip_transpilation=False, initial_layout=None, layout_method=None, routing_method=None, approximation_degree=None), resilience={'noise_amplifier': 'GlobalFoldingAmplifier'}, execution=ExecutionOptions(shots=4000, init_qubits=True), environment=EnvironmentOptions(log_level='WARNING', callback=None, job_tags=[]), simulator=SimulatorOptions(noise_model=None, seed_simulator=None, coupling_map=None, basis_gates=None))

Expected behavior
Should be as for other option types.

Suggested solutions
Add line in Options:

_obj_fields: ClassVar[dict] = {
        "transpilation": TranspilationOptions,
        "execution": ExecutionOptions,
        "environment": EnvironmentOptions,
        "simulator": SimulatorOptions,
        "resilience": ResilienceOptions
    }

Additional Information

  • qiskit-ibm-runtime version:
  • Python version:
  • Operating system:
@merav-aharoni merav-aharoni added the bug Something isn't working label Mar 29, 2023
@merav-aharoni merav-aharoni self-assigned this Mar 29, 2023
@kt474 kt474 added this to the 0.9.3 milestone Apr 3, 2023
@kt474 kt474 closed this as completed in #778 Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants