qiskit.providers.ibmq.runtime.RuntimeProgram¶
-
class
RuntimeProgram
(program_name, program_id, description, parameters=None, return_values=None, interim_results=None, max_execution_time=0, version='0', backend_requirements=None, creation_date='', is_public=False)[source]¶ Class representing program metadata.
This class contains the metadata describing a program, such as its name, ID, description, etc.
You can use the
IBMRuntimeService
to retrieve the metadata of a specific program or all programs. For example:from qiskit import IBMQ provider = IBMQ.load_account() # To retrieve metadata of all programs. programs = provider.runtime.programs() # To retrieve metadata of a single program. program = provider.runtime.program(program_id='circuit-runner') print(f"Program {program.name} takes parameters {program.parameters().metadata}")
RuntimeProgram constructor.
- Parameters
program_name (
str
) – Program name.program_id (
str
) – Program ID.description (
str
) – Program description.parameters (
Optional
[List
]) – Documentation on program parameters.return_values (
Optional
[List
]) – Documentation on program return values.interim_results (
Optional
[List
]) – Documentation on program interim results.max_execution_time (
int
) – Maximum execution time.version (
str
) – Program version.backend_requirements (
Optional
[Dict
]) – Backend requirements.creation_date (
str
) – Program creation date.is_public (
bool
) –True
if program is visible to all.False
if it’s only visible to you.
-
__init__
(program_name, program_id, description, parameters=None, return_values=None, interim_results=None, max_execution_time=0, version='0', backend_requirements=None, creation_date='', is_public=False)[source]¶ RuntimeProgram constructor.
- Parameters
program_name (
str
) – Program name.program_id (
str
) – Program ID.description (
str
) – Program description.parameters (
Optional
[List
]) – Documentation on program parameters.return_values (
Optional
[List
]) – Documentation on program return values.interim_results (
Optional
[List
]) – Documentation on program interim results.max_execution_time (
int
) – Maximum execution time.version (
str
) – Program version.backend_requirements (
Optional
[Dict
]) – Backend requirements.creation_date (
str
) – Program creation date.is_public (
bool
) –True
if program is visible to all.False
if it’s only visible to you.
Methods
__init__
(program_name, program_id, description)RuntimeProgram constructor.
Program parameter namespace.
to_dict
()Convert program metadata to dictionary format.
Attributes
Backend requirements.
Program creation date.
Program description.
Program interim result definitions.
Whether the program is visible to all.
Maximum execution time in seconds.
Program name.
Program ID.
Program return value definitions.
Program version.
-
property
backend_requirements
¶ Backend requirements.
- Return type
Dict
- Returns
Backend requirements for this program.
-
property
creation_date
¶ Program creation date.
- Return type
str
- Returns
Program creation date.
-
property
description
¶ Program description.
- Return type
str
- Returns
Program description.
-
property
interim_results
¶ Program interim result definitions.
- Return type
List
[ProgramResult
]- Returns
Interim result definitions for this program.
-
property
is_public
¶ Whether the program is visible to all.
- Return type
bool
- Returns
Whether the program is public.
-
property
max_execution_time
¶ Maximum execution time in seconds.
A program execution exceeding this time will be forcibly terminated.
- Return type
int
- Returns
Maximum execution time.
-
property
name
¶ Program name.
- Return type
str
- Returns
Program name.
-
parameters
()[source]¶ Program parameter namespace.
You can use the returned namespace to assign parameter values and pass the namespace to
qiskit.providers.ibmq.runtime.IBMRuntimeService.run()
. The namespace allows you to use auto-completion to find program parameters.Note that each call to this method returns a new namespace instance and does not include any modification to the previous instance.
- Return type
ParameterNamespace
- Returns
Program parameter namespace.
-
property
program_id
¶ Program ID.
- Return type
str
- Returns
Program ID.
-
property
return_values
¶ Program return value definitions.
- Return type
List
[ProgramResult
]- Returns
Return value definitions for this program.
-
to_dict
()[source]¶ Convert program metadata to dictionary format.
- Return type
Dict
- Returns
Program metadata in dictionary format.
-
property
version
¶ Program version.
- Return type
str
- Returns
Program version.