Skip to content

Commit

Permalink
Regenerate Runtime docs to use module reorganization (Qiskit#1270)
Browse files Browse the repository at this point in the history
Applies the changes made in
Qiskit#1240.

Also updates the dev docs more generally.

Before:

<img width="272" alt="Screenshot 2024-05-01 at 11 46 46 AM"
src="https://github.com/Qiskit/documentation/assets/14852634/d3655237-7a1e-4d3a-bc51-f8465b520b84">

After:

<img width="271" alt="Screenshot 2024-05-01 at 11 48 22 AM"
src="https://github.com/Qiskit/documentation/assets/14852634/748bfbbc-6610-47c8-8d2d-4826feb0e20f">
  • Loading branch information
Eric-Arellano authored May 1, 2024
1 parent 8a33b4a commit eb51244
Show file tree
Hide file tree
Showing 35 changed files with 490 additions and 246 deletions.
19 changes: 10 additions & 9 deletions docs/api/qiskit-ibm-runtime/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -548,17 +548,18 @@
}
]
},
{
"title": "...transpiler",
"url": "/api/qiskit-ibm-runtime/transpiler"
},
{
"title": "...transpiler.passes",
"url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.transpiler.passes"
},
{
"title": "...transpiler.passes.basis",
"url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.transpiler.passes.basis"
"children": [
{
"title": "Module overview",
"url": "/api/qiskit-ibm-runtime/transpiler"
},
{
"title": "ConvertIdToDelay",
"url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.transpiler.passes.ConvertIdToDelay"
}
]
},
{
"title": "...transpiler.passes.scheduling",
Expand Down
19 changes: 10 additions & 9 deletions docs/api/qiskit-ibm-runtime/dev/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -548,17 +548,18 @@
}
]
},
{
"title": "...transpiler",
"url": "/api/qiskit-ibm-runtime/dev/transpiler"
},
{
"title": "...transpiler.passes",
"url": "/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.transpiler.passes"
},
{
"title": "...transpiler.passes.basis",
"url": "/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.transpiler.passes.basis"
"children": [
{
"title": "Module overview",
"url": "/api/qiskit-ibm-runtime/dev/transpiler"
},
{
"title": "ConvertIdToDelay",
"url": "/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.transpiler.passes.ConvertIdToDelay"
}
]
},
{
"title": "...transpiler.passes.scheduling",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/qiskit-ibm-runtime/dev/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ description: API documentation for qiskit-ibm-runtime

* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
* [Primitive options (`qiskit_ibm_runtime.options`)](options)
* [IBM Backend Transpiler Tools (`qiskit_ibm_runtime.transpiler`)](transpiler)
* [Transpiler passes (`qiskit_ibm_runtime.transpiler.passes`)](transpiler)
* [Fake Provider (`qiskit_ibm_runtime.fake_provider`)](fake_provider)

6 changes: 3 additions & 3 deletions docs/api/qiskit-ibm-runtime/dev/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ python_api_name: qiskit_ibm_runtime.options

Options that can be passed to the primitives.

**V2 Primitives**
## V2 Primitives

`SamplerV2` and `EstimatorV2` each have their own options. You can use the `options` attribute to set the options. For example:

Expand All @@ -45,10 +45,10 @@ estimator.options.update(resilience_level=1)
Refer to [`SamplerOptions`](qiskit_ibm_runtime.options.SamplerOptions "qiskit_ibm_runtime.options.SamplerOptions") and [`EstimatorOptions`](qiskit_ibm_runtime.options.EstimatorOptions "qiskit_ibm_runtime.options.EstimatorOptions") for V2 Sampler and V2 Estimator options, respectively.

<Admonition title="Note" type="note">
If an option is not specified, the server default value is used. The default values are subject to change. See the [API Reference](/api/qiskit-ibm-runtime/options) for the most up-to-date default values.
If an option is not specified, the server default value is used. The default values are subject to change. Refer to this current module’s documentation for the latest defaults.
</Admonition>

**V1 Primitives**
## V1 Primitives

The [`Options`](qiskit_ibm_runtime.options.Options "qiskit_ibm_runtime.options.Options") class encapsulates all the options you can specify when invoking a V1 primitive. It includes frequently used options, such as `optimization_level` and `resilience_level` as well as sub-categories, such as `transpilation` and `execution`. You can use auto-complete to easily find the options inside each sub-category, for example:

Expand Down
51 changes: 36 additions & 15 deletions docs/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.Batch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ python_api_name: qiskit_ibm_runtime.Batch

### backend

<Function id="qiskit_ibm_runtime.Batch.backend" name="backend" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L236-L244" signature="backend()">
<Function id="qiskit_ibm_runtime.Batch.backend" name="backend" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L231-L239" signature="backend()">
Return backend for this session.

**Return type**
Expand All @@ -109,7 +109,7 @@ python_api_name: qiskit_ibm_runtime.Batch

### cancel

<Function id="qiskit_ibm_runtime.Batch.cancel" name="cancel" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L222-L226" signature="cancel()">
<Function id="qiskit_ibm_runtime.Batch.cancel" name="cancel" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L217-L221" signature="cancel()">
Cancel all pending jobs in a session.

**Return type**
Expand All @@ -119,7 +119,7 @@ python_api_name: qiskit_ibm_runtime.Batch

### close

<Function id="qiskit_ibm_runtime.Batch.close" name="close" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L228-L234" signature="close()">
<Function id="qiskit_ibm_runtime.Batch.close" name="close" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L223-L229" signature="close()">
Close the session so new jobs will no longer be accepted, but existing queued or running jobs will run to completion. The session will be terminated once there are no more pending jobs.

**Return type**
Expand All @@ -129,21 +129,36 @@ python_api_name: qiskit_ibm_runtime.Batch

### details

<Function id="qiskit_ibm_runtime.Batch.details" name="details" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L272-L313" signature="details()">
<Function id="qiskit_ibm_runtime.Batch.details" name="details" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L268-L310" signature="details()">
Return session details.

**Returns**
**Return type**

id: id of the session. backend\_name: backend used for the session. interactive\_timeout: The maximum idle time (in seconds) between jobs that is allowed to occur before the session is deactivated. max\_time: Maximum allowed time (in seconds) for the session, subject to plan limits. active\_timeout: The maximum time (in seconds) a session can stay active. state: State of the session - open, active, inactive, or closed. accepting\_jobs: Whether or not the session is accepting jobs. last\_job\_started: Timestamp of when the last job in the session started. last\_job\_completed: Timestamp of when the last job in the session completed. started\_at: Timestamp of when the session was started. closed\_at: Timestamp of when the session was closed. activated\_at: Timestamp of when the session state was changed to active. mode: Execution mode of the session. usage\_time: The usage time, in seconds, of this Session or Batch. Usage is defined as the time a quantum system is committed to complete a job.
`Optional`\[`Dict`\[`str`, `Any`]]

**Return type**
**Returns**

A dictionary with the sessions details, including
A dictionary with the sessions details.

* `id`: id of the session.
* `backend_name`: backend used for the session.
* `interactive_timeout`: The maximum idle time (in seconds) between jobs that is allowed to occur before the session is deactivated.
* `max_time`: Maximum allowed time (in seconds) for the session, subject to plan limits.
* `active_timeout`: The maximum time (in seconds) a session can stay active.
* `state`: State of the session - open, active, inactive, or closed.
* `accepting_jobs`: Whether or not the session is accepting jobs.
* `last_job_started`: Timestamp of when the last job in the session started.
* `last_job_completed`: Timestamp of when the last job in the session completed.
* `started_at`: Timestamp of when the session was started.
* `closed_at`: Timestamp of when the session was closed.
* `activated_at`: Timestamp of when the session state was changed to active.
* `mode`: Execution mode of the session.
* `usage_time`: The usage time, in seconds, of this Session or Batch. Usage is defined as the time a quantum system is committed to complete a job.
</Function>

### from\_id

<Function id="qiskit_ibm_runtime.Batch.from_id" name="from_id" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L333-L376" signature="classmethod from_id(session_id, service=None)">
<Function id="qiskit_ibm_runtime.Batch.from_id" name="from_id" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L330-L373" signature="classmethod from_id(session_id, service=None)">
Construct a Session object with a given session\_id

**Parameters**
Expand Down Expand Up @@ -171,7 +186,7 @@ python_api_name: qiskit_ibm_runtime.Batch

### run

<Function id="qiskit_ibm_runtime.Batch.run" name="run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L170-L220" signature="run(program_id, inputs, options=None, callback=None, result_decoder=None)">
<Function id="qiskit_ibm_runtime.Batch.run" name="run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L165-L215" signature="run(program_id, inputs, options=None, callback=None, result_decoder=None)">
Run a program in the session.

**Parameters**
Expand All @@ -192,16 +207,22 @@ python_api_name: qiskit_ibm_runtime.Batch

### status

<Function id="qiskit_ibm_runtime.Batch.status" name="status" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L246-L270" signature="status()">
<Function id="qiskit_ibm_runtime.Batch.status" name="status" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/session.py#L241-L266" signature="status()">
Return current session status.

**Returns**
**Return type**

Pending: Session is created but not active. It will become active when the next job of this session is dequeued. In progress, accepting new jobs: session is active and accepting new jobs. In progress, not accepting new jobs: session is active and not accepting new jobs. Closed: max\_time expired or session was explicitly closed. None: status details are not available.
`Optional`\[`str`]

**Return type**
**Returns**

Session status as a string.

The current status of the session, including
* `Pending`: Session is created but not active. It will become active when the next job of this session is dequeued.
* `In progress, accepting new jobs`: session is active and accepting new jobs.
* `In progress, not accepting new jobs`: session is active and not accepting new jobs.
* `Closed`: max\_time expired or session was explicitly closed.
* `None`: status details are not available.
</Function>
</Class>

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.Estimator

# Estimator

<Attribute id="qiskit_ibm_runtime.Estimator" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L182-L366">
<Attribute id="qiskit_ibm_runtime.Estimator" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L218-L402">
alias of [`EstimatorV1`](qiskit_ibm_runtime.EstimatorV1 "qiskit_ibm_runtime.estimator.EstimatorV1")
</Attribute>

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.EstimatorV1

# EstimatorV1

<Class id="qiskit_ibm_runtime.EstimatorV1" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L182-L366" signature="EstimatorV1(backend=None, session=None, options=None)">
<Class id="qiskit_ibm_runtime.EstimatorV1" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L218-L402" signature="EstimatorV1(backend=None, session=None, options=None)">
Class for interacting with Qiskit Runtime Estimator primitive service.

Qiskit Runtime Estimator primitive service estimates expectation values of quantum circuits and observables.
Expand Down Expand Up @@ -95,7 +95,7 @@ python_api_name: qiskit_ibm_runtime.EstimatorV1

### run

<Function id="qiskit_ibm_runtime.EstimatorV1.run" name="run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L261-L295" signature="run(circuits, observables, parameter_values=None, **kwargs)">
<Function id="qiskit_ibm_runtime.EstimatorV1.run" name="run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L297-L331" signature="run(circuits, observables, parameter_values=None, **kwargs)">
Submit a request to the estimator primitive.

**Parameters**
Expand All @@ -120,7 +120,7 @@ python_api_name: qiskit_ibm_runtime.EstimatorV1

### set\_options

<Function id="qiskit_ibm_runtime.EstimatorV1.set_options" name="set_options" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/base_primitive.py#L437-L445" signature="set_options(**fields)">
<Function id="qiskit_ibm_runtime.EstimatorV1.set_options" name="set_options" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/base_primitive.py#L439-L447" signature="set_options(**fields)">
Set options values for the sampler.

**Parameters**
Expand Down
30 changes: 27 additions & 3 deletions docs/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.EstimatorV2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.EstimatorV2

# EstimatorV2

<Class id="qiskit_ibm_runtime.EstimatorV2" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L49-L179" signature="EstimatorV2(backend=None, session=None, options=None)">
<Class id="qiskit_ibm_runtime.EstimatorV2" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L53-L215" signature="EstimatorV2(mode=None, backend=None, session=None, options=None)">
Class for interacting with Qiskit Runtime Estimator primitive service.

Qiskit Runtime Estimator primitive service estimates expectation values of quantum circuits and observables.
Expand Down Expand Up @@ -53,7 +53,17 @@ python_api_name: qiskit_ibm_runtime.EstimatorV2

**Parameters**

* **backend** (`Union`\[`str`, [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.ibm_backend.IBMBackend"), `None`]) – Backend to run the primitive. This can be a backend name or an [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instance. If a name is specified, the default account (e.g. `QiskitRuntimeService()`) is used.
* **mode** (`Union`\[`BackendV1`, `BackendV2`, [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.session.Session"), [`Batch`](qiskit_ibm_runtime.Batch "qiskit_ibm_runtime.batch.Batch"), `str`, `None`]) –

The execution mode used to make the primitive query. It can be:

* A `Backend` if you are using job mode.
* A [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session") if you are using session execution mode.
* A [`Batch`](qiskit_ibm_runtime.Batch "qiskit_ibm_runtime.Batch") if you are using batch execution mode.

Refer to the [Qiskit Runtime documentation](/run). for more information about the `Execution modes`.

* **backend** (`Union`\[`str`, `BackendV1`, `BackendV2`, `None`]) – Backend to run the primitive. This can be a backend name or an [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instance. If a name is specified, the default account (e.g. `QiskitRuntimeService()`) is used.

* **session** (`Optional`\[[`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.session.Session")]) –

Expand All @@ -69,6 +79,20 @@ python_api_name: qiskit_ibm_runtime.EstimatorV2

## Attributes

### mode

<Attribute id="qiskit_ibm_runtime.EstimatorV2.mode" name="mode">
Return the execution mode used by this primitive.

**Return type**

Optional\[[Session](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session") | [Batch](qiskit_ibm_runtime.Batch "qiskit_ibm_runtime.Batch")]

**Returns**

Mode used by this primitive, or `None` if an execution mode is not used.
</Attribute>

### options

<Attribute id="qiskit_ibm_runtime.EstimatorV2.options" name="options">
Expand Down Expand Up @@ -101,7 +125,7 @@ python_api_name: qiskit_ibm_runtime.EstimatorV2

### run

<Function id="qiskit_ibm_runtime.EstimatorV2.run" name="run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L134-L151" signature="run(pubs, *, precision=None)">
<Function id="qiskit_ibm_runtime.EstimatorV2.run" name="run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/estimator.py#L170-L187" signature="run(pubs, *, precision=None)">
Submit a request to the estimator primitive.

**Parameters**
Expand Down
Loading

0 comments on commit eb51244

Please sign in to comment.