248 lines
6.0 KiB
Plaintext
248 lines
6.0 KiB
Plaintext
---
|
||
title: RuntimeProgram
|
||
description: API reference for qiskit.providers.ibmq.runtime.RuntimeProgram
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.providers.ibmq.runtime.RuntimeProgram
|
||
---
|
||
|
||
# RuntimeProgram
|
||
|
||
<Class id="qiskit.providers.ibmq.runtime.RuntimeProgram" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-ibmq-provider/tree/stable/0.18/qiskit/providers/ibmq/runtime/runtime_program.py" signature="RuntimeProgram(program_name, program_id, description, parameters=None, return_values=None, interim_results=None, max_execution_time=0, backend_requirements=None, creation_date='', update_date='', is_public=False, data='', api_client=None)" modifiers="class">
|
||
Bases: `object`
|
||
|
||
Class representing program metadata.
|
||
|
||
This class contains the metadata describing a program, such as its name, ID, description, etc.
|
||
|
||
You can use the [`IBMRuntimeService`](qiskit.providers.ibmq.runtime.IBMRuntimeService "qiskit.providers.ibmq.runtime.IBMRuntimeService") to retrieve the metadata of a specific program or all programs. For example:
|
||
|
||
```python
|
||
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`\[`Dict`]) – Documentation on program parameters.
|
||
* **return\_values** (`Optional`\[`Dict`]) – Documentation on program return values.
|
||
* **interim\_results** (`Optional`\[`Dict`]) – Documentation on program interim results.
|
||
* **max\_execution\_time** (`int`) – Maximum execution time.
|
||
* **backend\_requirements** (`Optional`\[`Dict`]) – Backend requirements.
|
||
* **creation\_date** (`str`) – Program creation date.
|
||
* **update\_date** (`str`) – Program last updated date.
|
||
* **is\_public** (`Optional`\[`bool`]) – `True` if program is visible to all. `False` if it’s only visible to you.
|
||
* **data** (`str`) – Program data.
|
||
* **api\_client** (`Optional`\[`RuntimeClient`]) – Runtime api client.
|
||
|
||
## Methods
|
||
|
||
### parameters
|
||
|
||
<Function id="qiskit.providers.ibmq.runtime.RuntimeProgram.parameters" signature="RuntimeProgram.parameters()">
|
||
Program parameter namespace.
|
||
|
||
You can use the returned namespace to assign parameter values and pass the namespace to [`qiskit.providers.ibmq.runtime.IBMRuntimeService.run()`](qiskit.providers.ibmq.runtime.IBMRuntimeService#run "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.
|
||
</Function>
|
||
|
||
### to\_dict
|
||
|
||
<Function id="qiskit.providers.ibmq.runtime.RuntimeProgram.to_dict" signature="RuntimeProgram.to_dict()">
|
||
Convert program metadata to dictionary format.
|
||
|
||
**Return type**
|
||
|
||
`Dict`
|
||
|
||
**Returns**
|
||
|
||
Program metadata in dictionary format.
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### backend\_requirements
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.backend_requirements">
|
||
Backend requirements.
|
||
|
||
**Return type**
|
||
|
||
`Dict`
|
||
|
||
**Returns**
|
||
|
||
Backend requirements for this program.
|
||
</Attribute>
|
||
|
||
### creation\_date
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.creation_date">
|
||
Program creation date.
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Program creation date.
|
||
</Attribute>
|
||
|
||
### data
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.data">
|
||
Program data.
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Program data.
|
||
|
||
**Raises**
|
||
|
||
**IBMQNotAuthorizedError** – if user is not the program author.
|
||
</Attribute>
|
||
|
||
### description
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.description">
|
||
Program description.
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Program description.
|
||
</Attribute>
|
||
|
||
### interim\_results
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.interim_results">
|
||
Program interim result definitions.
|
||
|
||
**Return type**
|
||
|
||
`Dict`
|
||
|
||
**Returns**
|
||
|
||
Interim result definitions for this program.
|
||
</Attribute>
|
||
|
||
### is\_public
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.is_public">
|
||
Whether the program is visible to all.
|
||
|
||
**Return type**
|
||
|
||
`bool`
|
||
|
||
**Returns**
|
||
|
||
Whether the program is public.
|
||
</Attribute>
|
||
|
||
### max\_execution\_time
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.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.
|
||
</Attribute>
|
||
|
||
### name
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.name">
|
||
Program name.
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Program name.
|
||
</Attribute>
|
||
|
||
### program\_id
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.program_id">
|
||
Program ID.
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Program ID.
|
||
</Attribute>
|
||
|
||
### return\_values
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.return_values">
|
||
Program return value definitions.
|
||
|
||
**Return type**
|
||
|
||
`Dict`
|
||
|
||
**Returns**
|
||
|
||
Return value definitions for this program.
|
||
</Attribute>
|
||
|
||
### update\_date
|
||
|
||
<Attribute id="qiskit.providers.ibmq.runtime.RuntimeProgram.update_date">
|
||
Program last updated date.
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Program last updated date.
|
||
</Attribute>
|
||
</Class>
|
||
|