Skip to content

Commit

Permalink
add max_execution_time (Qiskit#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyu00 authored and GitHub Enterprise committed Apr 12, 2021
1 parent 539d534 commit 360f00c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,25 @@ The only production device setup for runtime is `ibmq_montreal`.

#### Syntax

**Note:**

1. When updating a program, it is important to specify a `max_execution_time`, which is the maximum
amount of time, in seconds, the program is allowed to run. If the execution time exceeds this
number, a second runtime program will be started.
2. Job cancel doesn't work yet.


```python
from qiskit import IBMQ

IBMQ.load_account()
provider = IBMQ.get_provider(project='qiskit-runtime')

# Upload a new runtime program
program_id = provider.runtime.upload_program(name='circuit-runner', data='runtime/circuit_runner.py')
# Upload a new runtime program.
program_id = provider.runtime.upload_program(
name='circuit-runner',
data='runtime/circuit_runner.py',
max_execution_time=86400)
print(program_id)

# Print all available programs
Expand Down Expand Up @@ -105,7 +116,5 @@ print(job.status())
result = job.result()
```

Note: Job cancel doesn't work yet.

See the [design doc](https://github.ibm.com/IBM-Q-Software/design-docs/blob/master/docs/quantum_services/Quantum_Program_Runtime/qiskit_interface.md)
for more details.

0 comments on commit 360f00c

Please sign in to comment.