QiskitRuntimeService.run¶
- QiskitRuntimeService.run(program_id, inputs, options=None, callback=None, result_decoder=None, session_id=None, start_session=False)[source]¶
Execute the runtime program.
- Parameters:
program_id (
str
) – Program ID.inputs (
Union
[Dict
,ParameterNamespace
]) – Program input parameters. These input values are passed to the runtime program.options (
Union
[RuntimeOptions
,Dict
,None
]) – Runtime options that control the execution environment. SeeRuntimeOptions
for all available options.callback (
Optional
[Callable
]) –Callback function to be invoked for any interim results and final result. The callback function will receive 2 positional parameters:
Job ID
Job result.
result_decoder (
Union
[Type
[ResultDecoder
],Sequence
[Type
[ResultDecoder
]],None
]) – AResultDecoder
subclass used to decode job results. If more than one decoder is specified, the first is used for interim results and the second final results. If not specified, a program-specific decoder or the defaultResultDecoder
is used.session_id (
Optional
[str
]) – Job ID of the first job in a runtime session.start_session (
Optional
[bool
]) – Set to True to explicitly start a runtime session. Defaults to False.
- Return type:
- Returns:
A
RuntimeJob
instance representing the execution.- Raises:
IBMInputValueError – If input is invalid.
RuntimeProgramNotFound – If the program cannot be found.
IBMRuntimeError – An error occurred running the program.