Japanese
言語
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

警告

The package qiskit-ibmq-provider is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in https://ibm.biz/provider_migration_guide

qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program

IBMRuntimeService.upload_program(data, metadata=None)[ソース]

Upload a runtime program.

In addition to program data, the following program metadata is also required:

  • name

  • max_execution_time

  • description

Program metadata can be specified using the metadata parameter or individual parameter (for example, name and description). If the same metadata field is specified in both places, the individual parameter takes precedence. For example, if you specify:

upload_program(metadata={"name": "name1"}, name="name2")

name2 will be used as the program name.

パラメータ
  • data (str) – Program data or path of the file containing program data to upload.

  • metadata (Union[Dict, str, None]) –

    Name of the program metadata file or metadata dictionary. A metadata file needs to be in the JSON format. The parameters, return_values, and interim_results should be defined as JSON Schema. See program/program_metadata_sample.json for an example. The fields in metadata are explained below.

    • name: Name of the program. Required.

    • max_execution_time: Maximum execution time in seconds. Required.

    • description: Program description. Required.

    • is_public: Whether the runtime program should be visible to the public.

      The default is False.

    • spec: Specifications for backend characteristics and input parameters

      required to run the program, interim results and final result.

      • backend_requirements: Backend requirements.

      • parameters: Program input parameters in JSON schema format.

      • return_values: Program return values in JSON schema format.

      • interim_results: Program interim results in JSON schema format.

戻り値の型

str

戻り値

Program ID.

例外
  • IBMQInputValueError – If required metadata is missing.

  • RuntimeDuplicateProgramError – If a program with the same name already exists.

  • IBMQNotAuthorizedError – If you are not authorized to upload programs.

  • QiskitRuntimeError – If the upload failed.