qiskit.providers.ibmq.runtime.IBMRuntimeService.upload_program¶
-
IBMRuntimeService.
upload_program
(data, metadata=None, name=None, max_execution_time=None, description=None, version=None, backend_requirements=None, parameters=None, return_values=None, interim_results=None)[source]¶ 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.- Parameters
data (
Union
[bytes
,str
]) – Name of the program file or 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. Seeprogram/program_metadata_sample.yaml
for an example.name (
Optional
[str
]) – Name of the program. Required if not specified via metadata.max_execution_time (
Optional
[int
]) – Maximum execution time in seconds. Required if not specified via metadata.description (
Optional
[str
]) – Program description. Required if not specified via metadata.version (
Optional
[float
]) – Program version. The default is 1.0 if not specified.backend_requirements (
Optional
[str
]) – Backend requirements.parameters (
Optional
[List
[ProgramParameter
]]) – A list of program input parameters.return_values (
Optional
[List
[ProgramResult
]]) – A list of program return values.interim_results (
Optional
[List
[ProgramResult
]]) – A list of program interim results.
- Return type
str
- Returns
Program ID.
- Raises
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.