English
Languages
English
Japanese
Spanish

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. See RuntimeOptions 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:

    1. Job ID

    2. Job result.

  • result_decoder (Union[Type[ResultDecoder], Sequence[Type[ResultDecoder]], None]) – A ResultDecoder 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 default ResultDecoder 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:

RuntimeJob

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.