Skip to content

Commit

Permalink
Fix syntax error in README (Qiskit#33)
Browse files Browse the repository at this point in the history
* update readme

* clarify staging vs prod
  • Loading branch information
jyu00 authored and GitHub Enterprise committed Apr 7, 2021
1 parent 696975d commit 3a241ee
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ This repo is used to store artifacts for the near time compute THINK demos.
- contains runtime programs
- demo notebooks are in the root directory

### Steps to run the demo notebooks using Aer
### To run the demo notebooks locally using Aer

1. Install all the requirements: `pip install -U -r requirements.txt`
2. Open the notebook
3. Modify the environment variables at the top of the notebook, if necessary:
2. Install the special `qiskit-ibmq-provider` branch:
`pip install git+https://github.com/jyu00/qiskit-ibmq-provider@runtime-service`
3. Set the environment variables:

- `PYTHON_EXEC` needs to point to your python executable, which may live in your `virtualenv`
or `conda` directory (e.g. `/Users/jessieyu/.pyenv/versions/qka-demo/bin/python3`)
Expand All @@ -27,29 +28,25 @@ This repo is used to store artifacts for the near time compute THINK demos.
- `NTC_PROGRAM_FILE` needs to point to the runtime program file (e.g. `runtime/qka_runtime.py`)


### Steps to run demo notebooks using real runtime

If a notebook doesn't have the 3 environment variables mentioned above (`PYTHON_EXEC`,
`NTC_DOC_FILE`, and `NTC_PROGRAM_FILE`) in the first cell, then it's already set up to use real
runtime on production.
### To run demo notebooks using real runtime environments


#### Requirements

To use runtime via Qiskit you'll need to

- be in the `ibm-q-internal/near-time/qiskit-runtime` provider
- install the latest Qiskit release
- install the special `qiskit-ibmq-provider` branch:
`pip install git+https://github.com/jyu00/qiskit-ibmq-provider@runtime-real`
- has the `near-time-systems` role if you want to upload new programs.

The only device setup for runtime is `ibmq_montreal`.
#### Additional requirements for staging

#### Staging
- be in the `rte-test/lp-all/renierm` provider
- set the `NTC_URL` environment variable to
`https://api-ntc.processing-staging-5dd5718798d097eccc65fac4e78a33ce-0000.us-east.containers.appdomain.cloud`

If you want to use the staging system instead of production, change the `NTC_URL` environment variable
to point to staging, e.g.
For example:

```
import os
Expand All @@ -59,6 +56,14 @@ os.environ["NTC_URL"] = 'https://api-ntc.processing-staging-5dd5718798d097eccc65
IBMQ.enable_account(STAGING_TOKEN, url='https://auth-dev.quantum-computing.ibm.com/api')
```

#### Additional requirements for production

- be in the `ibm-q-internal/near-time/qiskit-runtime` provider
- Set the `NTC_URL` environment variable to
`https://api-ntc.processing-prod-5dd5718798d097eccc65fac4e78a33ce-0000.us-east.containers.appdomain.cloud`

The only production device setup for runtime is `ibmq_montreal`.

#### Syntax

```python
Expand All @@ -71,18 +76,21 @@ provider = IBMQ.get_provider(project='qiskit-runtime')
program_id = provider.runtime.upload_program(name='circuit-runner', data='runtime/circuit_runner.py')
print(program_id)

# See what's available
provider.runtime.print_programs()
# Print all available programs
provider.runtime.pprint_programs(refresh=True)

# Delete a program
provider.runtime.delete_program(program_id='id-to-delete')

# Execute a program
backend = provider.get_backend('ibmq_montreal')
runtime_params = {
runtime_inputs = {
'circuits': circuit
}
options = {'backend_name': backend.name()}
job = provider.runtime.run(program_id="circuit-runner",
options=options,
params=runtime_params,
inputs=runtime_inputs,
)

# See job status
Expand All @@ -92,5 +100,7 @@ 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.
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
retworkx==0.7.2 # until 0.8 wheel is fixed
retworkx>=0.8.0
qiskit-terra
qiskit-aqua
qiskit-aer
cvxopt
jupyter
matplotlib
git+https://github.com/jyu00/qiskit-ibmq-provider.git@runtime-service

0 comments on commit 3a241ee

Please sign in to comment.