diff --git a/docs/api/qiskit-ibm-provider/_toc.json b/docs/api/qiskit-ibm-provider/_toc.json
index 8f6d84ea1ff..296b297d0eb 100644
--- a/docs/api/qiskit-ibm-provider/_toc.json
+++ b/docs/api/qiskit-ibm-provider/_toc.json
@@ -6,7 +6,7 @@
"children": [
{
"title": "Overview",
- "url": "/api/qiskit-ibm-provider"
+ "url": "/api/qiskit-ibm-provider/ibm_provider"
},
{
"title": "IBMBackend",
@@ -52,155 +52,155 @@
"title": "least_busy",
"url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.least_busy"
},
- {
- "title": "qiskit_ibm_provider.jupyter",
- "url": "/api/qiskit-ibm-provider/ibm_jupyter"
- },
{
"title": "Session",
"url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.Session"
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_provider.job",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-provider/ibm_job"
},
{
- "title": "qiskit_ibm_provider.job",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-provider/ibm_job"
- },
- {
- "title": "IBMCircuitJob",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMCircuitJob"
- },
- {
- "title": "IBMCompositeJob",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMCompositeJob"
- },
- {
- "title": "IBMJobApiError",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobApiError"
- },
- {
- "title": "IBMJobError",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobError"
- },
- {
- "title": "IBMJobFailureError",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobFailureError"
- },
- {
- "title": "IBMJobInvalidStateError",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobInvalidStateError"
- },
- {
- "title": "IBMJobTimeoutError",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobTimeoutError"
- },
- {
- "title": "job_monitor",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.job_monitor"
- },
- {
- "title": "QueueInfo",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.QueueInfo"
- }
- ]
+ "title": "IBMCircuitJob",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMCircuitJob"
+ },
+ {
+ "title": "IBMCompositeJob",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMCompositeJob"
+ },
+ {
+ "title": "IBMJobApiError",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobApiError"
+ },
+ {
+ "title": "IBMJobError",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobError"
+ },
+ {
+ "title": "IBMJobFailureError",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobFailureError"
+ },
+ {
+ "title": "IBMJobInvalidStateError",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobInvalidStateError"
},
{
- "title": "qiskit_ibm_provider.transpiler",
+ "title": "IBMJobTimeoutError",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.IBMJobTimeoutError"
+ },
+ {
+ "title": "job_monitor",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.job_monitor"
+ },
+ {
+ "title": "QueueInfo",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.job.QueueInfo"
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_provider.jupyter",
+ "url": "/api/qiskit-ibm-provider/ibm_jupyter"
+ },
+ {
+ "title": "qiskit_ibm_provider.transpiler",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-provider/ibm_transpiler"
+ },
+ {
+ "title": "qiskit_ibm_provider.transpiler.passes",
"children": [
{
"title": "Overview",
- "url": "/api/qiskit-ibm-provider/ibm_transpiler"
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes"
+ },
+ {
+ "title": "qiskit_ibm_provider.transpiler.passes.basis",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.basis"
},
{
- "title": "qiskit_ibm_provider.transpiler.passes",
+ "title": "qiskit_ibm_provider.transpiler.passes.scheduling",
"children": [
{
"title": "Overview",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes"
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling"
+ },
+ {
+ "title": "ALAPScheduleAnalysis",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.ALAPScheduleAnalysis"
+ },
+ {
+ "title": "ASAPScheduleAnalysis",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.ASAPScheduleAnalysis"
},
{
- "title": "qiskit_ibm_provider.transpiler.passes.basis",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.basis"
+ "title": "BlockBasePadder",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.BlockBasePadder"
},
{
- "title": "qiskit_ibm_provider.transpiler.passes.scheduling",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling"
- },
- {
- "title": "ALAPScheduleAnalysis",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.ALAPScheduleAnalysis"
- },
- {
- "title": "ASAPScheduleAnalysis",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.ASAPScheduleAnalysis"
- },
- {
- "title": "BlockBasePadder",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.BlockBasePadder"
- },
- {
- "title": "DynamicCircuitInstructionDurations",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.DynamicCircuitInstructionDurations"
- },
- {
- "title": "PadDelay",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.PadDelay"
- },
- {
- "title": "PadDynamicalDecoupling",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.PadDynamicalDecoupling"
- }
- ]
+ "title": "DynamicCircuitInstructionDurations",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.DynamicCircuitInstructionDurations"
+ },
+ {
+ "title": "PadDelay",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.PadDelay"
+ },
+ {
+ "title": "PadDynamicalDecoupling",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.PadDynamicalDecoupling"
}
]
}
]
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_provider.utils",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-provider/ibm_utils"
},
{
- "title": "qiskit_ibm_provider.utils",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-provider/ibm_utils"
- },
- {
- "title": "seconds_to_duration",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.seconds_to_duration"
- },
- {
- "title": "to_python_identifier",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.to_python_identifier"
- },
- {
- "title": "utc_to_local",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.utc_to_local"
- },
- {
- "title": "validate_job_tags",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.validate_job_tags"
- }
- ]
+ "title": "seconds_to_duration",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.seconds_to_duration"
},
{
- "title": "qiskit_ibm_provider.visualization",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-provider/ibm_visualization"
- },
- {
- "title": "iplot_error_map",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_error_map"
- },
- {
- "title": "iplot_gate_map",
- "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_gate_map"
- }
- ]
+ "title": "to_python_identifier",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.to_python_identifier"
+ },
+ {
+ "title": "utc_to_local",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.utc_to_local"
+ },
+ {
+ "title": "validate_job_tags",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.utils.validate_job_tags"
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_provider.visualization",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-provider/ibm_visualization"
+ },
+ {
+ "title": "iplot_error_map",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_error_map"
+ },
+ {
+ "title": "iplot_gate_map",
+ "url": "/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_gate_map"
}
]
},
@@ -208,5 +208,6 @@
"title": "Release notes",
"url": "/api/qiskit-ibm-provider/release-notes"
}
- ]
+ ],
+ "collapsed": true
}
diff --git a/docs/api/qiskit-ibm-provider/ibm-provider.md b/docs/api/qiskit-ibm-provider/ibm-provider.md
deleted file mode 100644
index 82db5a4991a..00000000000
--- a/docs/api/qiskit-ibm-provider/ibm-provider.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# qiskit-ibm-provider API Reference
-
-* [IBM Quantum Provider (`qiskit_ibm_provider`)](ibm_provider)
-* [Job (`qiskit_ibm_provider.job`)](ibm_job)
-* [Visualizations (`qiskit_ibm_provider.visualization`)](ibm_visualization)
-* [Jupyter Tools (`qiskit_ibm_provider.jupyter`)](ibm_jupyter)
-* [Utilities (`qiskit_ibm_provider.utils`)](ibm_utils)
-* [IBM Backend Transpiler Tools (`qiskit_ibm_provider.transpiler`)](ibm_transpiler)
diff --git a/docs/api/qiskit-ibm-provider/ibm_provider.md b/docs/api/qiskit-ibm-provider/ibm_provider.md
new file mode 100644
index 00000000000..821e27fcd37
--- /dev/null
+++ b/docs/api/qiskit-ibm-provider/ibm_provider.md
@@ -0,0 +1,66 @@
+---
+title: qiskit_ibm_provider
+description: API reference for qiskit_ibm_provider
+in_page_toc_min_heading_level: 1
+python_api_type: module
+python_api_name: qiskit_ibm_provider
+---
+
+
+
+
+
+
+
+# IBM Quantum Provider
+
+
+
+`qiskit_ibm_provider`
+
+Modules representing the Qiskit IBM Quantum Provider.
+
+## Logging
+
+The qiskit-ibm-provider uses the `qiskit_ibm_provider` logger.
+
+Two environment variables can be used to control the logging:
+
+> * `QISKIT_IBM_PROVIDER_LOG_LEVEL`: Specifies the log level to use, for the Qiskit IBM provider modules. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
+> * `QISKIT_IBM_PROVIDER_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
+
+For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
+
+```python
+import logging
+logging.getLogger('qiskit_ibm_provider').setLevel(logging.WARNING)
+```
+
+## Functions
+
+| | |
+| ----------------------------------------------------------------------------------------- | ------------------------------------------ |
+| [`least_busy`](qiskit_ibm_provider.least_busy "qiskit_ibm_provider.least_busy")(backends) | Return the least busy backend from a list. |
+
+## Classes
+
+| | |
+| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
+| [`IBMProvider`](qiskit_ibm_provider.IBMProvider "qiskit_ibm_provider.IBMProvider")(\[token, url, name, instance, ...]) | Provides access to the IBM Quantum services available to an account. |
+| [`IBMBackend`](qiskit_ibm_provider.IBMBackend "qiskit_ibm_provider.IBMBackend")(configuration, provider, api\_client) | Backend class interfacing with an IBM Quantum device. |
+| [`IBMBackendService`](qiskit_ibm_provider.IBMBackendService "qiskit_ibm_provider.IBMBackendService")(provider, hgp) | Backend namespace for an IBM Quantum account. |
+| [`Session`](qiskit_ibm_provider.Session "qiskit_ibm_provider.Session")(\[max\_time]) | Class for creating a flexible Qiskit Runtime session. |
+
+## Exceptions
+
+| | |
+| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
+| [`IBMError`](qiskit_ibm_provider.IBMError "qiskit_ibm_provider.IBMError")(\*message) | Base class for errors raised by the provider modules. |
+| [`IBMProviderError`](qiskit_ibm_provider.IBMProviderError "qiskit_ibm_provider.IBMProviderError")(\*message) | Base class for errors raise by IBMProvider. |
+| [`IBMProviderValueError`](qiskit_ibm_provider.IBMProviderValueError "qiskit_ibm_provider.IBMProviderValueError")(\*message) | Value errors raised by IBMProvider. |
+| [`IBMBackendError`](qiskit_ibm_provider.IBMBackendError "qiskit_ibm_provider.IBMBackendError")(\*message) | Base class for errors raised by the backend modules. |
+| [`IBMBackendApiError`](qiskit_ibm_provider.IBMBackendApiError "qiskit_ibm_provider.IBMBackendApiError")(\*message) | Errors that occur unexpectedly when querying the server. |
+| [`IBMBackendApiProtocolError`](qiskit_ibm_provider.IBMBackendApiProtocolError "qiskit_ibm_provider.IBMBackendApiProtocolError")(\*message) | Errors raised when an unexpected value is received from the server. |
+| [`IBMBackendValueError`](qiskit_ibm_provider.IBMBackendValueError "qiskit_ibm_provider.IBMBackendValueError")(\*message) | Value errors raised by the backend modules. |
+| [`IBMProviderError`](qiskit_ibm_provider.IBMProviderError "qiskit_ibm_provider.IBMProviderError")(\*message) | Base class for errors raise by IBMProvider. |
+
diff --git a/docs/api/qiskit-ibm-provider/index.md b/docs/api/qiskit-ibm-provider/index.md
index 821e27fcd37..6f01462d1dd 100644
--- a/docs/api/qiskit-ibm-provider/index.md
+++ b/docs/api/qiskit-ibm-provider/index.md
@@ -1,66 +1,16 @@
---
-title: qiskit_ibm_provider
-description: API reference for qiskit_ibm_provider
-in_page_toc_min_heading_level: 1
-python_api_type: module
-python_api_name: qiskit_ibm_provider
----
-
-
-
-
-
-
-
-# IBM Quantum Provider
-
-
-
-`qiskit_ibm_provider`
-
-Modules representing the Qiskit IBM Quantum Provider.
-
-## Logging
-The qiskit-ibm-provider uses the `qiskit_ibm_provider` logger.
+title: Qiskit IBM Provider API Docs
+description: API documentation for qiskit-ibm-provider
-Two environment variables can be used to control the logging:
-
-> * `QISKIT_IBM_PROVIDER_LOG_LEVEL`: Specifies the log level to use, for the Qiskit IBM provider modules. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
-> * `QISKIT_IBM_PROVIDER_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
-
-For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
-
-```python
-import logging
-logging.getLogger('qiskit_ibm_provider').setLevel(logging.WARNING)
-```
-
-## Functions
-
-| | |
-| ----------------------------------------------------------------------------------------- | ------------------------------------------ |
-| [`least_busy`](qiskit_ibm_provider.least_busy "qiskit_ibm_provider.least_busy")(backends) | Return the least busy backend from a list. |
-
-## Classes
-
-| | |
-| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
-| [`IBMProvider`](qiskit_ibm_provider.IBMProvider "qiskit_ibm_provider.IBMProvider")(\[token, url, name, instance, ...]) | Provides access to the IBM Quantum services available to an account. |
-| [`IBMBackend`](qiskit_ibm_provider.IBMBackend "qiskit_ibm_provider.IBMBackend")(configuration, provider, api\_client) | Backend class interfacing with an IBM Quantum device. |
-| [`IBMBackendService`](qiskit_ibm_provider.IBMBackendService "qiskit_ibm_provider.IBMBackendService")(provider, hgp) | Backend namespace for an IBM Quantum account. |
-| [`Session`](qiskit_ibm_provider.Session "qiskit_ibm_provider.Session")(\[max\_time]) | Class for creating a flexible Qiskit Runtime session. |
+---
-## Exceptions
+# qiskit-ibm-provider API Reference
-| | |
-| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
-| [`IBMError`](qiskit_ibm_provider.IBMError "qiskit_ibm_provider.IBMError")(\*message) | Base class for errors raised by the provider modules. |
-| [`IBMProviderError`](qiskit_ibm_provider.IBMProviderError "qiskit_ibm_provider.IBMProviderError")(\*message) | Base class for errors raise by IBMProvider. |
-| [`IBMProviderValueError`](qiskit_ibm_provider.IBMProviderValueError "qiskit_ibm_provider.IBMProviderValueError")(\*message) | Value errors raised by IBMProvider. |
-| [`IBMBackendError`](qiskit_ibm_provider.IBMBackendError "qiskit_ibm_provider.IBMBackendError")(\*message) | Base class for errors raised by the backend modules. |
-| [`IBMBackendApiError`](qiskit_ibm_provider.IBMBackendApiError "qiskit_ibm_provider.IBMBackendApiError")(\*message) | Errors that occur unexpectedly when querying the server. |
-| [`IBMBackendApiProtocolError`](qiskit_ibm_provider.IBMBackendApiProtocolError "qiskit_ibm_provider.IBMBackendApiProtocolError")(\*message) | Errors raised when an unexpected value is received from the server. |
-| [`IBMBackendValueError`](qiskit_ibm_provider.IBMBackendValueError "qiskit_ibm_provider.IBMBackendValueError")(\*message) | Value errors raised by the backend modules. |
-| [`IBMProviderError`](qiskit_ibm_provider.IBMProviderError "qiskit_ibm_provider.IBMProviderError")(\*message) | Base class for errors raise by IBMProvider. |
+* [IBM Quantum Provider (`qiskit_ibm_provider`)](ibm_provider)
+* [Job (`qiskit_ibm_provider.job`)](ibm_job)
+* [Visualizations (`qiskit_ibm_provider.visualization`)](ibm_visualization)
+* [Jupyter Tools (`qiskit_ibm_provider.jupyter`)](ibm_jupyter)
+* [Utilities (`qiskit_ibm_provider.utils`)](ibm_utils)
+* [IBM Backend Transpiler Tools (`qiskit_ibm_provider.transpiler`)](ibm_transpiler)
diff --git a/docs/api/qiskit-ibm-runtime/0.14/_toc.json b/docs/api/qiskit-ibm-runtime/0.14/_toc.json
index b1aa9499559..d50e2dc019a 100644
--- a/docs/api/qiskit-ibm-runtime/0.14/_toc.json
+++ b/docs/api/qiskit-ibm-runtime/0.14/_toc.json
@@ -6,7 +6,7 @@
"children": [
{
"title": "Overview",
- "url": "/api/qiskit-ibm-runtime/0.14"
+ "url": "/api/qiskit-ibm-runtime/0.14/runtime_service"
},
{
"title": "Estimator",
@@ -51,39 +51,39 @@
{
"title": "Session",
"url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.Session"
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_runtime.options",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-runtime/0.14/options"
+ },
+ {
+ "title": "EnvironmentOptions",
+ "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.EnvironmentOptions"
+ },
+ {
+ "title": "ExecutionOptions",
+ "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.ExecutionOptions"
+ },
+ {
+ "title": "Options",
+ "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.Options"
+ },
+ {
+ "title": "ResilienceOptions",
+ "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.ResilienceOptions"
+ },
+ {
+ "title": "SimulatorOptions",
+ "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.SimulatorOptions"
},
{
- "title": "qiskit_ibm_runtime.options",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-runtime/0.14/options"
- },
- {
- "title": "EnvironmentOptions",
- "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.EnvironmentOptions"
- },
- {
- "title": "ExecutionOptions",
- "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.ExecutionOptions"
- },
- {
- "title": "Options",
- "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.Options"
- },
- {
- "title": "ResilienceOptions",
- "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.ResilienceOptions"
- },
- {
- "title": "SimulatorOptions",
- "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.SimulatorOptions"
- },
- {
- "title": "TranspilationOptions",
- "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.TranspilationOptions"
- }
- ]
+ "title": "TranspilationOptions",
+ "url": "/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.options.TranspilationOptions"
}
]
},
@@ -91,5 +91,6 @@
"title": "Release notes",
"url": "/api/qiskit-ibm-runtime/release-notes"
}
- ]
+ ],
+ "collapsed": true
}
diff --git a/docs/api/qiskit-ibm-runtime/0.14/ibm-runtime.md b/docs/api/qiskit-ibm-runtime/0.14/ibm-runtime.md
deleted file mode 100644
index 9d6faada697..00000000000
--- a/docs/api/qiskit-ibm-runtime/0.14/ibm-runtime.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# qiskit-ibm-runtime API reference
-
-* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
-* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/0.14/index.md b/docs/api/qiskit-ibm-runtime/0.14/index.md
index 23e94954741..3e1649a1f31 100644
--- a/docs/api/qiskit-ibm-runtime/0.14/index.md
+++ b/docs/api/qiskit-ibm-runtime/0.14/index.md
@@ -1,135 +1,12 @@
---
-title: qiskit_ibm_runtime
-description: API reference for qiskit_ibm_runtime
-in_page_toc_min_heading_level: 1
-python_api_type: module
-python_api_name: qiskit_ibm_runtime
----
-
-
-
-
-
-# Qiskit Runtime
-
-
-
-`qiskit_ibm_runtime`
-
-Modules related to Qiskit Runtime IBM Client.
-
-Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
-
-## Primitives and sessions
-
-Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
-
-Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
-
-Below is an example of using primitives within a session:
-
-```python
-from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit.circuit.library import RealAmplitudes
-from qiskit.quantum_info import SparsePauliOp
-
-# Initialize account.
-service = QiskitRuntimeService()
-
-# Set options, which can be overwritten at job level.
-options = Options(optimization_level=3)
-
-# Prepare inputs.
-bell = ReferenceCircuits.bell()
-psi = RealAmplitudes(num_qubits=2, reps=2)
-H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
-theta = [0, 1, 1, 2, 3, 5]
-
-with Session(service=service, backend="ibmq_qasm_simulator") as session:
- # Submit a request to the Sampler primitive within the session.
- sampler = Sampler(session=session, options=options)
- job = sampler.run(circuits=bell)
- print(f"Sampler results: {job.result()}")
-
- # Submit a request to the Estimator primitive within the session.
- estimator = Estimator(session=session, options=options)
- job = estimator.run(
- circuits=[psi], observables=[H1], parameter_values=[theta]
- )
- print(f"Estimator results: {job.result()}")
-```
-
-## Backend data
-
-[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
-## Supplementary Information
+title: Qiskit Runtime IBM Client API Docs
+description: API documentation for qiskit-ibm-runtime
-### Account initialization
-
-You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
-
-Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
-
-### Runtime Jobs
-
-When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
-
-### Logging
-
-`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
-
-Two environment variables can be used to control the logging:
-
-* `QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
-* `QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
-
-For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
-
-```python
-import logging
-logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
-```
-
-### Interim and final results
-
-Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
-
-```python
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
-
-service = QiskitRuntimeService()
-backend = service.backend("ibmq_qasm_simulator")
-
-def result_callback(job_id, result):
- print(result)
-
-# Stream results as soon as the job starts running.
-job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
-print(job.result())
-```
-
-### Uploading a program
-
-Authorized users can upload their custom Qiskit Runtime programs. A Qiskit Runtime program is a piece of Python code and its metadata that takes certain inputs, performs quantum and maybe classical processing, and returns the results.
-
-Files related to writing a runtime program are in the `qiskit_ibm_runtime/program` directory.
+---
-### Classes
+# qiskit-ibm-runtime API reference
-| | |
-| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
-| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
-| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
-| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
-| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
-| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
-| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
-| [`RuntimeProgram`](qiskit_ibm_runtime.RuntimeProgram "qiskit_ibm_runtime.RuntimeProgram")(program\_name, program\_id, ...) | Class representing program metadata. |
-| [`ParameterNamespace`](qiskit_ibm_runtime.ParameterNamespace "qiskit_ibm_runtime.ParameterNamespace")(parameters) | A namespace for program parameters with validation. |
-| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
-| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
-| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
+* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/0.14/runtime_service.md b/docs/api/qiskit-ibm-runtime/0.14/runtime_service.md
new file mode 100644
index 00000000000..23e94954741
--- /dev/null
+++ b/docs/api/qiskit-ibm-runtime/0.14/runtime_service.md
@@ -0,0 +1,135 @@
+---
+title: qiskit_ibm_runtime
+description: API reference for qiskit_ibm_runtime
+in_page_toc_min_heading_level: 1
+python_api_type: module
+python_api_name: qiskit_ibm_runtime
+---
+
+
+
+
+
+# Qiskit Runtime
+
+
+
+`qiskit_ibm_runtime`
+
+Modules related to Qiskit Runtime IBM Client.
+
+Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
+
+## Primitives and sessions
+
+Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
+
+Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
+
+Below is an example of using primitives within a session:
+
+```python
+from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit.circuit.library import RealAmplitudes
+from qiskit.quantum_info import SparsePauliOp
+
+# Initialize account.
+service = QiskitRuntimeService()
+
+# Set options, which can be overwritten at job level.
+options = Options(optimization_level=3)
+
+# Prepare inputs.
+bell = ReferenceCircuits.bell()
+psi = RealAmplitudes(num_qubits=2, reps=2)
+H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
+theta = [0, 1, 1, 2, 3, 5]
+
+with Session(service=service, backend="ibmq_qasm_simulator") as session:
+ # Submit a request to the Sampler primitive within the session.
+ sampler = Sampler(session=session, options=options)
+ job = sampler.run(circuits=bell)
+ print(f"Sampler results: {job.result()}")
+
+ # Submit a request to the Estimator primitive within the session.
+ estimator = Estimator(session=session, options=options)
+ job = estimator.run(
+ circuits=[psi], observables=[H1], parameter_values=[theta]
+ )
+ print(f"Estimator results: {job.result()}")
+```
+
+## Backend data
+
+[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
+
+## Supplementary Information
+
+### Account initialization
+
+You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
+
+Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
+
+### Runtime Jobs
+
+When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
+
+### Logging
+
+`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
+
+Two environment variables can be used to control the logging:
+
+* `QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
+* `QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
+
+For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
+
+```python
+import logging
+logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
+```
+
+### Interim and final results
+
+Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
+
+```python
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
+
+service = QiskitRuntimeService()
+backend = service.backend("ibmq_qasm_simulator")
+
+def result_callback(job_id, result):
+ print(result)
+
+# Stream results as soon as the job starts running.
+job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
+print(job.result())
+```
+
+### Uploading a program
+
+Authorized users can upload their custom Qiskit Runtime programs. A Qiskit Runtime program is a piece of Python code and its metadata that takes certain inputs, performs quantum and maybe classical processing, and returns the results.
+
+Files related to writing a runtime program are in the `qiskit_ibm_runtime/program` directory.
+
+### Classes
+
+| | |
+| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
+| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
+| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
+| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
+| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
+| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
+| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
+| [`RuntimeProgram`](qiskit_ibm_runtime.RuntimeProgram "qiskit_ibm_runtime.RuntimeProgram")(program\_name, program\_id, ...) | Class representing program metadata. |
+| [`ParameterNamespace`](qiskit_ibm_runtime.ParameterNamespace "qiskit_ibm_runtime.ParameterNamespace")(parameters) | A namespace for program parameters with validation. |
+| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
+| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
+| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+
diff --git a/docs/api/qiskit-ibm-runtime/0.15/_toc.json b/docs/api/qiskit-ibm-runtime/0.15/_toc.json
index 2324ac7ecf0..75aaab41e13 100644
--- a/docs/api/qiskit-ibm-runtime/0.15/_toc.json
+++ b/docs/api/qiskit-ibm-runtime/0.15/_toc.json
@@ -6,7 +6,7 @@
"children": [
{
"title": "Overview",
- "url": "/api/qiskit-ibm-runtime/0.15"
+ "url": "/api/qiskit-ibm-runtime/0.15/runtime_service"
},
{
"title": "Estimator",
@@ -51,39 +51,39 @@
{
"title": "Session",
"url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.Session"
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_runtime.options",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-runtime/0.15/options"
+ },
+ {
+ "title": "EnvironmentOptions",
+ "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.EnvironmentOptions"
+ },
+ {
+ "title": "ExecutionOptions",
+ "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.ExecutionOptions"
+ },
+ {
+ "title": "Options",
+ "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.Options"
+ },
+ {
+ "title": "ResilienceOptions",
+ "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.ResilienceOptions"
+ },
+ {
+ "title": "SimulatorOptions",
+ "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.SimulatorOptions"
},
{
- "title": "qiskit_ibm_runtime.options",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-runtime/0.15/options"
- },
- {
- "title": "EnvironmentOptions",
- "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.EnvironmentOptions"
- },
- {
- "title": "ExecutionOptions",
- "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.ExecutionOptions"
- },
- {
- "title": "Options",
- "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.Options"
- },
- {
- "title": "ResilienceOptions",
- "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.ResilienceOptions"
- },
- {
- "title": "SimulatorOptions",
- "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.SimulatorOptions"
- },
- {
- "title": "TranspilationOptions",
- "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.TranspilationOptions"
- }
- ]
+ "title": "TranspilationOptions",
+ "url": "/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.options.TranspilationOptions"
}
]
},
@@ -91,5 +91,6 @@
"title": "Release notes",
"url": "/api/qiskit-ibm-runtime/release-notes"
}
- ]
+ ],
+ "collapsed": true
}
diff --git a/docs/api/qiskit-ibm-runtime/0.15/ibm-runtime.md b/docs/api/qiskit-ibm-runtime/0.15/ibm-runtime.md
deleted file mode 100644
index 9d6faada697..00000000000
--- a/docs/api/qiskit-ibm-runtime/0.15/ibm-runtime.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# qiskit-ibm-runtime API reference
-
-* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
-* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/0.15/index.md b/docs/api/qiskit-ibm-runtime/0.15/index.md
index 23e94954741..3e1649a1f31 100644
--- a/docs/api/qiskit-ibm-runtime/0.15/index.md
+++ b/docs/api/qiskit-ibm-runtime/0.15/index.md
@@ -1,135 +1,12 @@
---
-title: qiskit_ibm_runtime
-description: API reference for qiskit_ibm_runtime
-in_page_toc_min_heading_level: 1
-python_api_type: module
-python_api_name: qiskit_ibm_runtime
----
-
-
-
-
-
-# Qiskit Runtime
-
-
-
-`qiskit_ibm_runtime`
-
-Modules related to Qiskit Runtime IBM Client.
-
-Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
-
-## Primitives and sessions
-
-Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
-
-Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
-
-Below is an example of using primitives within a session:
-
-```python
-from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit.circuit.library import RealAmplitudes
-from qiskit.quantum_info import SparsePauliOp
-
-# Initialize account.
-service = QiskitRuntimeService()
-
-# Set options, which can be overwritten at job level.
-options = Options(optimization_level=3)
-
-# Prepare inputs.
-bell = ReferenceCircuits.bell()
-psi = RealAmplitudes(num_qubits=2, reps=2)
-H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
-theta = [0, 1, 1, 2, 3, 5]
-
-with Session(service=service, backend="ibmq_qasm_simulator") as session:
- # Submit a request to the Sampler primitive within the session.
- sampler = Sampler(session=session, options=options)
- job = sampler.run(circuits=bell)
- print(f"Sampler results: {job.result()}")
-
- # Submit a request to the Estimator primitive within the session.
- estimator = Estimator(session=session, options=options)
- job = estimator.run(
- circuits=[psi], observables=[H1], parameter_values=[theta]
- )
- print(f"Estimator results: {job.result()}")
-```
-
-## Backend data
-
-[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
-## Supplementary Information
+title: Qiskit Runtime IBM Client API Docs
+description: API documentation for qiskit-ibm-runtime
-### Account initialization
-
-You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
-
-Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
-
-### Runtime Jobs
-
-When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
-
-### Logging
-
-`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
-
-Two environment variables can be used to control the logging:
-
-* `QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
-* `QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
-
-For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
-
-```python
-import logging
-logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
-```
-
-### Interim and final results
-
-Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
-
-```python
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
-
-service = QiskitRuntimeService()
-backend = service.backend("ibmq_qasm_simulator")
-
-def result_callback(job_id, result):
- print(result)
-
-# Stream results as soon as the job starts running.
-job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
-print(job.result())
-```
-
-### Uploading a program
-
-Authorized users can upload their custom Qiskit Runtime programs. A Qiskit Runtime program is a piece of Python code and its metadata that takes certain inputs, performs quantum and maybe classical processing, and returns the results.
-
-Files related to writing a runtime program are in the `qiskit_ibm_runtime/program` directory.
+---
-### Classes
+# qiskit-ibm-runtime API reference
-| | |
-| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
-| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
-| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
-| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
-| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
-| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
-| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
-| [`RuntimeProgram`](qiskit_ibm_runtime.RuntimeProgram "qiskit_ibm_runtime.RuntimeProgram")(program\_name, program\_id, ...) | Class representing program metadata. |
-| [`ParameterNamespace`](qiskit_ibm_runtime.ParameterNamespace "qiskit_ibm_runtime.ParameterNamespace")(parameters) | A namespace for program parameters with validation. |
-| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
-| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
-| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
+* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/0.15/runtime_service.md b/docs/api/qiskit-ibm-runtime/0.15/runtime_service.md
new file mode 100644
index 00000000000..23e94954741
--- /dev/null
+++ b/docs/api/qiskit-ibm-runtime/0.15/runtime_service.md
@@ -0,0 +1,135 @@
+---
+title: qiskit_ibm_runtime
+description: API reference for qiskit_ibm_runtime
+in_page_toc_min_heading_level: 1
+python_api_type: module
+python_api_name: qiskit_ibm_runtime
+---
+
+
+
+
+
+# Qiskit Runtime
+
+
+
+`qiskit_ibm_runtime`
+
+Modules related to Qiskit Runtime IBM Client.
+
+Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
+
+## Primitives and sessions
+
+Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
+
+Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
+
+Below is an example of using primitives within a session:
+
+```python
+from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit.circuit.library import RealAmplitudes
+from qiskit.quantum_info import SparsePauliOp
+
+# Initialize account.
+service = QiskitRuntimeService()
+
+# Set options, which can be overwritten at job level.
+options = Options(optimization_level=3)
+
+# Prepare inputs.
+bell = ReferenceCircuits.bell()
+psi = RealAmplitudes(num_qubits=2, reps=2)
+H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
+theta = [0, 1, 1, 2, 3, 5]
+
+with Session(service=service, backend="ibmq_qasm_simulator") as session:
+ # Submit a request to the Sampler primitive within the session.
+ sampler = Sampler(session=session, options=options)
+ job = sampler.run(circuits=bell)
+ print(f"Sampler results: {job.result()}")
+
+ # Submit a request to the Estimator primitive within the session.
+ estimator = Estimator(session=session, options=options)
+ job = estimator.run(
+ circuits=[psi], observables=[H1], parameter_values=[theta]
+ )
+ print(f"Estimator results: {job.result()}")
+```
+
+## Backend data
+
+[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
+
+## Supplementary Information
+
+### Account initialization
+
+You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
+
+Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
+
+### Runtime Jobs
+
+When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
+
+### Logging
+
+`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
+
+Two environment variables can be used to control the logging:
+
+* `QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
+* `QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
+
+For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
+
+```python
+import logging
+logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
+```
+
+### Interim and final results
+
+Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
+
+```python
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
+
+service = QiskitRuntimeService()
+backend = service.backend("ibmq_qasm_simulator")
+
+def result_callback(job_id, result):
+ print(result)
+
+# Stream results as soon as the job starts running.
+job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
+print(job.result())
+```
+
+### Uploading a program
+
+Authorized users can upload their custom Qiskit Runtime programs. A Qiskit Runtime program is a piece of Python code and its metadata that takes certain inputs, performs quantum and maybe classical processing, and returns the results.
+
+Files related to writing a runtime program are in the `qiskit_ibm_runtime/program` directory.
+
+### Classes
+
+| | |
+| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
+| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
+| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
+| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
+| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
+| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
+| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
+| [`RuntimeProgram`](qiskit_ibm_runtime.RuntimeProgram "qiskit_ibm_runtime.RuntimeProgram")(program\_name, program\_id, ...) | Class representing program metadata. |
+| [`ParameterNamespace`](qiskit_ibm_runtime.ParameterNamespace "qiskit_ibm_runtime.ParameterNamespace")(parameters) | A namespace for program parameters with validation. |
+| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
+| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
+| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+
diff --git a/docs/api/qiskit-ibm-runtime/0.16/_toc.json b/docs/api/qiskit-ibm-runtime/0.16/_toc.json
index 670b0ee1e91..74757bf504e 100644
--- a/docs/api/qiskit-ibm-runtime/0.16/_toc.json
+++ b/docs/api/qiskit-ibm-runtime/0.16/_toc.json
@@ -6,7 +6,7 @@
"children": [
{
"title": "Overview",
- "url": "/api/qiskit-ibm-runtime/0.16"
+ "url": "/api/qiskit-ibm-runtime/0.16/runtime_service"
},
{
"title": "Estimator",
@@ -43,39 +43,39 @@
{
"title": "Session",
"url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.Session"
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_runtime.options",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-runtime/0.16/options"
+ },
+ {
+ "title": "EnvironmentOptions",
+ "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.EnvironmentOptions"
+ },
+ {
+ "title": "ExecutionOptions",
+ "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.ExecutionOptions"
+ },
+ {
+ "title": "Options",
+ "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.Options"
+ },
+ {
+ "title": "ResilienceOptions",
+ "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.ResilienceOptions"
+ },
+ {
+ "title": "SimulatorOptions",
+ "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.SimulatorOptions"
},
{
- "title": "qiskit_ibm_runtime.options",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-runtime/0.16/options"
- },
- {
- "title": "EnvironmentOptions",
- "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.EnvironmentOptions"
- },
- {
- "title": "ExecutionOptions",
- "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.ExecutionOptions"
- },
- {
- "title": "Options",
- "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.Options"
- },
- {
- "title": "ResilienceOptions",
- "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.ResilienceOptions"
- },
- {
- "title": "SimulatorOptions",
- "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.SimulatorOptions"
- },
- {
- "title": "TranspilationOptions",
- "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.TranspilationOptions"
- }
- ]
+ "title": "TranspilationOptions",
+ "url": "/api/qiskit-ibm-runtime/0.16/qiskit_ibm_runtime.options.TranspilationOptions"
}
]
},
@@ -83,6 +83,6 @@
"title": "Release notes",
"url": "/api/qiskit-ibm-runtime/release-notes"
}
- ]
+ ],
+ "collapsed": true
}
-
diff --git a/docs/api/qiskit-ibm-runtime/0.16/ibm-runtime.md b/docs/api/qiskit-ibm-runtime/0.16/ibm-runtime.md
deleted file mode 100644
index 9d6faada697..00000000000
--- a/docs/api/qiskit-ibm-runtime/0.16/ibm-runtime.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# qiskit-ibm-runtime API reference
-
-* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
-* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/0.16/index.md b/docs/api/qiskit-ibm-runtime/0.16/index.md
index 0ef6d0f93ca..3e1649a1f31 100644
--- a/docs/api/qiskit-ibm-runtime/0.16/index.md
+++ b/docs/api/qiskit-ibm-runtime/0.16/index.md
@@ -1,127 +1,12 @@
---
-title: qiskit_ibm_runtime
-description: API reference for qiskit_ibm_runtime
-in_page_toc_min_heading_level: 1
-python_api_type: module
-python_api_name: qiskit_ibm_runtime
----
-
-
-
-
-
-# Qiskit Runtime
-
-
-
-`qiskit_ibm_runtime`
-
-Modules related to Qiskit Runtime IBM Client.
-
-Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
-
-## Primitives and sessions
-
-Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
-
-Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
-
-Below is an example of using primitives within a session:
-
-```python
-from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit.circuit.library import RealAmplitudes
-from qiskit.quantum_info import SparsePauliOp
-
-# Initialize account.
-service = QiskitRuntimeService()
-
-# Set options, which can be overwritten at job level.
-options = Options(optimization_level=3)
-
-# Prepare inputs.
-bell = ReferenceCircuits.bell()
-psi = RealAmplitudes(num_qubits=2, reps=2)
-H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
-theta = [0, 1, 1, 2, 3, 5]
-
-with Session(service=service, backend="ibmq_qasm_simulator") as session:
- # Submit a request to the Sampler primitive within the session.
- sampler = Sampler(session=session, options=options)
- job = sampler.run(circuits=bell)
- print(f"Sampler results: {job.result()}")
-
- # Submit a request to the Estimator primitive within the session.
- estimator = Estimator(session=session, options=options)
- job = estimator.run(
- circuits=[psi], observables=[H1], parameter_values=[theta]
- )
- print(f"Estimator results: {job.result()}")
-```
-
-## Backend data
-[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
+title: Qiskit Runtime IBM Client API Docs
+description: API documentation for qiskit-ibm-runtime
-## Supplementary Information
-
-### Account initialization
-
-You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
-
-Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
-
-### Runtime Jobs
-
-When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
-
-### Logging
-
-`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
-
-Two environment variables can be used to control the logging:
-
-* `QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
-* `QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
-
-For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
-
-```python
-import logging
-logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
-```
-
-### Interim and final results
-
-Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
-
-```python
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
-
-service = QiskitRuntimeService()
-backend = service.backend("ibmq_qasm_simulator")
-
-def result_callback(job_id, result):
- print(result)
-
-# Stream results as soon as the job starts running.
-job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
-print(job.result())
-```
+---
-### Classes
+# qiskit-ibm-runtime API reference
-| | |
-| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
-| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
-| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
-| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
-| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
-| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
-| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
-| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
-| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
-| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
+* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/0.16/runtime_service.md b/docs/api/qiskit-ibm-runtime/0.16/runtime_service.md
new file mode 100644
index 00000000000..0ef6d0f93ca
--- /dev/null
+++ b/docs/api/qiskit-ibm-runtime/0.16/runtime_service.md
@@ -0,0 +1,127 @@
+---
+title: qiskit_ibm_runtime
+description: API reference for qiskit_ibm_runtime
+in_page_toc_min_heading_level: 1
+python_api_type: module
+python_api_name: qiskit_ibm_runtime
+---
+
+
+
+
+
+# Qiskit Runtime
+
+
+
+`qiskit_ibm_runtime`
+
+Modules related to Qiskit Runtime IBM Client.
+
+Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
+
+## Primitives and sessions
+
+Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
+
+Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
+
+Below is an example of using primitives within a session:
+
+```python
+from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit.circuit.library import RealAmplitudes
+from qiskit.quantum_info import SparsePauliOp
+
+# Initialize account.
+service = QiskitRuntimeService()
+
+# Set options, which can be overwritten at job level.
+options = Options(optimization_level=3)
+
+# Prepare inputs.
+bell = ReferenceCircuits.bell()
+psi = RealAmplitudes(num_qubits=2, reps=2)
+H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
+theta = [0, 1, 1, 2, 3, 5]
+
+with Session(service=service, backend="ibmq_qasm_simulator") as session:
+ # Submit a request to the Sampler primitive within the session.
+ sampler = Sampler(session=session, options=options)
+ job = sampler.run(circuits=bell)
+ print(f"Sampler results: {job.result()}")
+
+ # Submit a request to the Estimator primitive within the session.
+ estimator = Estimator(session=session, options=options)
+ job = estimator.run(
+ circuits=[psi], observables=[H1], parameter_values=[theta]
+ )
+ print(f"Estimator results: {job.result()}")
+```
+
+## Backend data
+
+[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
+
+## Supplementary Information
+
+### Account initialization
+
+You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
+
+Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
+
+### Runtime Jobs
+
+When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
+
+### Logging
+
+`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
+
+Two environment variables can be used to control the logging:
+
+* `QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use. If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
+* `QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified, messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
+
+For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
+
+```python
+import logging
+logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
+```
+
+### Interim and final results
+
+Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
+
+```python
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
+
+service = QiskitRuntimeService()
+backend = service.backend("ibmq_qasm_simulator")
+
+def result_callback(job_id, result):
+ print(result)
+
+# Stream results as soon as the job starts running.
+job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
+print(job.result())
+```
+
+### Classes
+
+| | |
+| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
+| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
+| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
+| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
+| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
+| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
+| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
+| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
+| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
+| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+
diff --git a/docs/api/qiskit-ibm-runtime/_toc.json b/docs/api/qiskit-ibm-runtime/_toc.json
index 5a3360beddc..f55743f54ec 100644
--- a/docs/api/qiskit-ibm-runtime/_toc.json
+++ b/docs/api/qiskit-ibm-runtime/_toc.json
@@ -6,7 +6,7 @@
"children": [
{
"title": "Overview",
- "url": "/api/qiskit-ibm-runtime"
+ "url": "/api/qiskit-ibm-runtime/runtime_service"
},
{
"title": "Estimator",
@@ -43,39 +43,39 @@
{
"title": "Session",
"url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.Session"
+ }
+ ]
+ },
+ {
+ "title": "qiskit_ibm_runtime.options",
+ "children": [
+ {
+ "title": "Overview",
+ "url": "/api/qiskit-ibm-runtime/options"
+ },
+ {
+ "title": "EnvironmentOptions",
+ "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.EnvironmentOptions"
+ },
+ {
+ "title": "ExecutionOptions",
+ "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.ExecutionOptions"
+ },
+ {
+ "title": "Options",
+ "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.Options"
+ },
+ {
+ "title": "ResilienceOptions",
+ "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.ResilienceOptions"
+ },
+ {
+ "title": "SimulatorOptions",
+ "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.SimulatorOptions"
},
{
- "title": "qiskit_ibm_runtime.options",
- "children": [
- {
- "title": "Overview",
- "url": "/api/qiskit-ibm-runtime/options"
- },
- {
- "title": "EnvironmentOptions",
- "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.EnvironmentOptions"
- },
- {
- "title": "ExecutionOptions",
- "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.ExecutionOptions"
- },
- {
- "title": "Options",
- "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.Options"
- },
- {
- "title": "ResilienceOptions",
- "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.ResilienceOptions"
- },
- {
- "title": "SimulatorOptions",
- "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.SimulatorOptions"
- },
- {
- "title": "TranspilationOptions",
- "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.TranspilationOptions"
- }
- ]
+ "title": "TranspilationOptions",
+ "url": "/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.TranspilationOptions"
}
]
},
@@ -83,5 +83,6 @@
"title": "Release notes",
"url": "/api/qiskit-ibm-runtime/release-notes"
}
- ]
+ ],
+ "collapsed": true
}
diff --git a/docs/api/qiskit-ibm-runtime/ibm-runtime.md b/docs/api/qiskit-ibm-runtime/ibm-runtime.md
deleted file mode 100644
index 9d6faada697..00000000000
--- a/docs/api/qiskit-ibm-runtime/ibm-runtime.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# qiskit-ibm-runtime API reference
-
-* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
-* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/index.md b/docs/api/qiskit-ibm-runtime/index.md
index dd04e957f73..3e1649a1f31 100644
--- a/docs/api/qiskit-ibm-runtime/index.md
+++ b/docs/api/qiskit-ibm-runtime/index.md
@@ -1,132 +1,12 @@
---
-title: qiskit_ibm_runtime
-description: API reference for qiskit_ibm_runtime
-in_page_toc_min_heading_level: 1
-python_api_type: module
-python_api_name: qiskit_ibm_runtime
----
-
-
-
-
-
-# Qiskit Runtime
-
-
-
-`qiskit_ibm_runtime`
-
-Modules related to Qiskit Runtime IBM Client.
-
-Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
-
-## Primitives and sessions
-
-Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
-
-Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
-
-Below is an example of using primitives within a session:
-
-```python
-from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit.circuit.library import RealAmplitudes
-from qiskit.quantum_info import SparsePauliOp
-
-# Initialize account.
-service = QiskitRuntimeService()
-
-# Set options, which can be overwritten at job level.
-options = Options(optimization_level=3)
-
-# Prepare inputs.
-bell = ReferenceCircuits.bell()
-psi = RealAmplitudes(num_qubits=2, reps=2)
-H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
-theta = [0, 1, 1, 2, 3, 5]
-
-with Session(service=service, backend="ibmq_qasm_simulator") as session:
- # Submit a request to the Sampler primitive within the session.
- sampler = Sampler(session=session, options=options)
- job = sampler.run(circuits=bell)
- print(f"Sampler results: {job.result()}")
-
- # Submit a request to the Estimator primitive within the session.
- estimator = Estimator(session=session, options=options)
- job = estimator.run(
- circuits=[psi], observables=[H1], parameter_values=[theta]
- )
- print(f"Estimator results: {job.result()}")
-```
-
-## Backend data
-[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
+title: Qiskit Runtime IBM Client API Docs
+description: API documentation for qiskit-ibm-runtime
-## Supplementary Information
-
-### Account initialization
-
-You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
-
-Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
-
-### Runtime Jobs
-
-When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
-
-### Logging
-
-`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
-
-Two environment variables can be used to control the logging:
-
-> * **`QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use.**
->
-> If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
->
-> * **`QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified,**
->
-> messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
-
-For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
-
-```python
-import logging
-logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
-```
-
-### Interim and final results
-
-Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
-
-```python
-from qiskit.test.reference_circuits import ReferenceCircuits
-from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
-
-service = QiskitRuntimeService()
-backend = service.backend("ibmq_qasm_simulator")
-
-def result_callback(job_id, result):
- print(result)
-
-# Stream results as soon as the job starts running.
-job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
-print(job.result())
-```
+---
-## Classes
+# qiskit-ibm-runtime API reference
-| | |
-| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
-| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
-| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
-| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
-| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
-| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
-| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
-| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
-| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
-| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+* [Qiskit Runtime (`qiskit_ibm_runtime`)](runtime_service)
+* [Primitive options (`qiskit_ibm_runtime.options`)](options)
diff --git a/docs/api/qiskit-ibm-runtime/runtime_service.md b/docs/api/qiskit-ibm-runtime/runtime_service.md
new file mode 100644
index 00000000000..dd04e957f73
--- /dev/null
+++ b/docs/api/qiskit-ibm-runtime/runtime_service.md
@@ -0,0 +1,132 @@
+---
+title: qiskit_ibm_runtime
+description: API reference for qiskit_ibm_runtime
+in_page_toc_min_heading_level: 1
+python_api_type: module
+python_api_name: qiskit_ibm_runtime
+---
+
+
+
+
+
+# Qiskit Runtime
+
+
+
+`qiskit_ibm_runtime`
+
+Modules related to Qiskit Runtime IBM Client.
+
+Qiskit Runtime is a new architecture that streamlines computations requiring many iterations. These experiments will execute significantly faster within its improved hybrid quantum/classical process.
+
+## Primitives and sessions
+
+Qiskit Runtime has two predefined primitives: `Sampler` and `Estimator`. These primitives provide a simplified interface for performing foundational quantum computing tasks while also accounting for the latest developments in quantum hardware and software.
+
+Qiskit Runtime also has the concept of a session. Jobs submitted within a session are prioritized by the scheduler. A session allows you to make iterative calls to the quantum computer more efficiently.
+
+Below is an example of using primitives within a session:
+
+```python
+from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Estimator, Options
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit.circuit.library import RealAmplitudes
+from qiskit.quantum_info import SparsePauliOp
+
+# Initialize account.
+service = QiskitRuntimeService()
+
+# Set options, which can be overwritten at job level.
+options = Options(optimization_level=3)
+
+# Prepare inputs.
+bell = ReferenceCircuits.bell()
+psi = RealAmplitudes(num_qubits=2, reps=2)
+H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
+theta = [0, 1, 1, 2, 3, 5]
+
+with Session(service=service, backend="ibmq_qasm_simulator") as session:
+ # Submit a request to the Sampler primitive within the session.
+ sampler = Sampler(session=session, options=options)
+ job = sampler.run(circuits=bell)
+ print(f"Sampler results: {job.result()}")
+
+ # Submit a request to the Estimator primitive within the session.
+ estimator = Estimator(session=session, options=options)
+ job = estimator.run(
+ circuits=[psi], observables=[H1], parameter_values=[theta]
+ )
+ print(f"Estimator results: {job.result()}")
+```
+
+## Backend data
+
+[`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") also has methods, such as `backend()`, `backends()`, and `least_busy()`, that allow you to query for a target backend to use. These methods return one or more [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend") instances that contains methods and attributes describing the backend.
+
+## Supplementary Information
+
+### Account initialization
+
+You need to initialize your account before you can start using the Qiskit Runtime service. This is done by initializing a [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService") instance with your account credentials. If you don’t want to pass in the credentials each time, you can use the [`QiskitRuntimeService.save_account()`](qiskit_ibm_runtime.QiskitRuntimeService#save_account "qiskit_ibm_runtime.QiskitRuntimeService.save_account") method to save the credentials on disk.
+
+Qiskit Runtime is available on both IBM Cloud and IBM Quantum, and you can specify `channel="ibm_cloud"` for IBM Cloud and `channel="ibm_quantum"` for IBM Quantum. The default is IBM Cloud.
+
+### Runtime Jobs
+
+When you use the `run()` method of the [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler") or [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator") to invoke the primitive, a [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob") instance is returned. This class has all the basic job methods, such as [`RuntimeJob.status()`](qiskit_ibm_runtime.RuntimeJob#status "qiskit_ibm_runtime.RuntimeJob.status"), [`RuntimeJob.result()`](qiskit_ibm_runtime.RuntimeJob#result "qiskit_ibm_runtime.RuntimeJob.result"), and [`RuntimeJob.cancel()`](qiskit_ibm_runtime.RuntimeJob#cancel "qiskit_ibm_runtime.RuntimeJob.cancel").
+
+### Logging
+
+`qiskit-ibm-runtime` uses the `qiskit_ibm_runtime` logger.
+
+Two environment variables can be used to control the logging:
+
+> * **`QISKIT_IBM_RUNTIME_LOG_LEVEL`: Specifies the log level to use.**
+>
+> If an invalid level is set, the log level defaults to `WARNING`. The valid log levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL` (case-insensitive). If the environment variable is not set, then the parent logger’s level is used, which also defaults to `WARNING`.
+>
+> * **`QISKIT_IBM_RUNTIME_LOG_FILE`: Specifies the name of the log file to use. If specified,**
+>
+> messages will be logged to the file only. Otherwise messages will be logged to the standard error (usually the screen).
+
+For more advanced use, you can modify the logger itself. For example, to manually set the level to `WARNING`:
+
+```python
+import logging
+logging.getLogger('qiskit_ibm_runtime').setLevel(logging.WARNING)
+```
+
+### Interim and final results
+
+Some runtime programs provide interim results that inform you about program progress. You can choose to stream the interim results and final result when you run the program by passing in the `callback` parameter, or at a later time using the [`RuntimeJob.stream_results()`](qiskit_ibm_runtime.RuntimeJob#stream_results "qiskit_ibm_runtime.RuntimeJob.stream_results") method. For example:
+
+```python
+from qiskit.test.reference_circuits import ReferenceCircuits
+from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
+
+service = QiskitRuntimeService()
+backend = service.backend("ibmq_qasm_simulator")
+
+def result_callback(job_id, result):
+ print(result)
+
+# Stream results as soon as the job starts running.
+job = Sampler(backend).run(ReferenceCircuits.bell(), callback=result_callback)
+print(job.result())
+```
+
+## Classes
+
+| | |
+| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
+| [`QiskitRuntimeService`](qiskit_ibm_runtime.QiskitRuntimeService "qiskit_ibm_runtime.QiskitRuntimeService")(\[channel, token, url, ...]) | Class for interacting with the Qiskit Runtime service. |
+| [`Estimator`](qiskit_ibm_runtime.Estimator "qiskit_ibm_runtime.Estimator")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Estimator primitive service. |
+| [`Sampler`](qiskit_ibm_runtime.Sampler "qiskit_ibm_runtime.Sampler")(\[backend, session, options]) | Class for interacting with Qiskit Runtime Sampler primitive service. |
+| [`Session`](qiskit_ibm_runtime.Session "qiskit_ibm_runtime.Session")(\[service, backend, max\_time]) | Class for creating a flexible Qiskit Runtime session. |
+| [`IBMBackend`](qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.IBMBackend")(configuration, service, api\_client) | Backend class interfacing with an IBM Quantum backend. |
+| [`RuntimeJob`](qiskit_ibm_runtime.RuntimeJob "qiskit_ibm_runtime.RuntimeJob")(backend, api\_client, ...\[, ...]) | Representation of a runtime program execution. |
+| [`RuntimeOptions`](qiskit_ibm_runtime.RuntimeOptions "qiskit_ibm_runtime.RuntimeOptions")(\[backend, image, log\_level, ...]) | Class for representing generic runtime execution options. |
+| [`RuntimeEncoder`](qiskit_ibm_runtime.RuntimeEncoder "qiskit_ibm_runtime.RuntimeEncoder")(\*\[, skipkeys, ensure\_ascii, ...]) | JSON Encoder used by runtime service. |
+| [`RuntimeDecoder`](qiskit_ibm_runtime.RuntimeDecoder "qiskit_ibm_runtime.RuntimeDecoder")(\*args, \*\*kwargs) | JSON Decoder used by runtime service. |
+
diff --git a/scripts/commands/checkMetadata.ts b/scripts/commands/checkMetadata.ts
index 64e2ccb91b1..51a98381865 100644
--- a/scripts/commands/checkMetadata.ts
+++ b/scripts/commands/checkMetadata.ts
@@ -15,13 +15,7 @@ import fs from "fs/promises";
import { globby } from "globby";
const IGNORED_FILES = new Set([
- "docs/api/qiskit-ibm-provider/ibm-provider.md",
"docs/api/qiskit/transpiler_builtin_plugins.md",
- "docs/api/qiskit-ibm-runtime/ibm-runtime.md",
- "docs/api/qiskit-ibm-runtime/0.14/ibm-runtime.md",
- "docs/start/__migration-guide-algorithms.md",
- "docs/start/__migration-guide-opflow.md",
- "docs/start/__migration-guide-qi.md",
]);
const readMetadata = async (filePath: string): Promise> => {
diff --git a/scripts/commands/updateApiDocs.ts b/scripts/commands/updateApiDocs.ts
index 0d2e1e1508d..b8b4a1888d3 100644
--- a/scripts/commands/updateApiDocs.ts
+++ b/scripts/commands/updateApiDocs.ts
@@ -26,7 +26,7 @@ import { SphinxToMdResult } from "../lib/sphinx/SphinxToMdResult";
import { mergeClassMembers } from "../lib/sphinx/mergeClassMembers";
import { flatFolders } from "../lib/sphinx/flatFolders";
import { updateLinks } from "../lib/sphinx/updateLinks";
-import { renameUrls } from "../lib/sphinx/renameUrls";
+import specialCaseResults from "../lib/sphinx/specialCaseResults";
import { addFrontMatter } from "../lib/sphinx/addFrontMatter";
import { dedupeResultIds } from "../lib/sphinx/dedupeIds";
import { removePrefix, removeSuffix } from "../lib/stringUtils";
@@ -93,12 +93,6 @@ const PACKAGES: PkgInfo[] = [
githubSlug: "qiskit/qiskit",
initialUrl: `/apidoc/index.html`,
hasSeparateReleaseNotes: true,
- tocOptions: {
- collapsed: true,
- nestModule(id: string) {
- return id.split(".").length > 2;
- },
- },
},
];
@@ -308,7 +302,7 @@ async function convertHtmlToMarkdown(
results = await mergeClassMembers(results);
flatFolders(results);
- renameUrls(results);
+ specialCaseResults(results);
await updateLinks(results, pkg.transformLink);
await dedupeResultIds(results);
addFrontMatter(results, pkg);
diff --git a/scripts/lib/links/ignores.ts b/scripts/lib/links/ignores.ts
index 6c8f96e22d4..fd2137085e7 100644
--- a/scripts/lib/links/ignores.ts
+++ b/scripts/lib/links/ignores.ts
@@ -20,8 +20,6 @@ type FilesToIgnores = { [id: string]: string[] };
// These are legit problems that we had to punt on, usually because fixing the
// problem requires fixing the original source documentation for API docs.
const SHOULD_BE_FIXED: FilesToIgnores = {
- "docs/api/qiskit-ibm-provider/ibm-provider.md": ["ibm_provider"],
- "docs/api/qiskit-ibm-runtime/ibm-runtime.md": ["runtime_service"],
"docs/api/qiskit/algorithms.md": ["https://www.qiskit.org/terra"],
"docs/api/qiskit/qiskit.algorithms.Grover.md": [
"https://qiskit.org/textbook/ch-algorithms/grover.html",
diff --git a/scripts/lib/sharedTypes.ts b/scripts/lib/sharedTypes.ts
index e407bc86b03..c5094031662 100644
--- a/scripts/lib/sharedTypes.ts
+++ b/scripts/lib/sharedTypes.ts
@@ -29,10 +29,6 @@ export type PkgInfo = {
title: string;
ignore?(id: string): boolean;
hasSeparateReleaseNotes?: boolean;
- tocOptions?: {
- collapsed?: boolean;
- nestModule?(id: string): boolean;
- };
transformLink?: (link: Link) => Link | undefined;
};
diff --git a/scripts/lib/sphinx/PythonObjectMeta.ts b/scripts/lib/sphinx/PythonObjectMeta.ts
index f3043899fd8..f46066b2f51 100644
--- a/scripts/lib/sphinx/PythonObjectMeta.ts
+++ b/scripts/lib/sphinx/PythonObjectMeta.ts
@@ -20,4 +20,5 @@ export type PythonObjectMeta = {
| "module"
| "function"
| "exception";
+ hardcoded_frontmatter?: string;
};
diff --git a/scripts/lib/sphinx/addFrontMatter.ts b/scripts/lib/sphinx/addFrontMatter.ts
index 2ff659b55af..273b0a0d5f3 100644
--- a/scripts/lib/sphinx/addFrontMatter.ts
+++ b/scripts/lib/sphinx/addFrontMatter.ts
@@ -20,7 +20,14 @@ export function addFrontMatter(
): void {
for (let result of results) {
let markdown = result.markdown;
- if (result.meta.python_api_name) {
+ if (result.meta.hardcoded_frontmatter) {
+ result.markdown = `---
+${result.meta.hardcoded_frontmatter}
+---
+
+${markdown}
+`;
+ } else if (result.meta.python_api_name) {
result.markdown = `---
title: ${getLastPartFromFullIdentifier(result.meta.python_api_name)}
description: API reference for ${result.meta.python_api_name}
diff --git a/scripts/lib/sphinx/generateToc.test.ts b/scripts/lib/sphinx/generateToc.test.ts
index 1db55d51088..583e70e3dcd 100644
--- a/scripts/lib/sphinx/generateToc.test.ts
+++ b/scripts/lib/sphinx/generateToc.test.ts
@@ -13,57 +13,56 @@
import { describe, expect, test } from "@jest/globals";
import { generateToc } from "./generateToc";
-describe("generateTocFromPythonApiFiles", () => {
+describe("generateToc", () => {
test("generate a toc", () => {
const toc = generateToc(pkg, [
- { meta: {}, url: "/docs/runtime" },
{
meta: {
python_api_type: "module",
python_api_name: "qiskit_ibm_runtime",
},
- url: "/docs/runtime/qiskit_ibm_runtime",
+ url: "/docs/runtime",
},
{
meta: {
python_api_type: "module",
python_api_name: "qiskit_ibm_runtime.options",
},
- url: "/docs/runtime/qiskit_ibm_runtime.options",
+ url: "/docs/options",
},
{
meta: { python_api_type: "class", python_api_name: "Sampler" },
- url: "/docs/runtime/qiskit_ibm_runtime.Sampler",
+ url: "/docs/qiskit_ibm_runtime.Sampler",
},
{
meta: { python_api_type: "method", python_api_name: "Sampler.run" },
- url: "/docs/runtime/qiskit_ibm_runtime.Sampler.run",
+ url: "/docs/qiskit_ibm_runtime.Sampler.run",
},
{
meta: { python_api_type: "class", python_api_name: "Estimator" },
- url: "/docs/runtime/qiskit_ibm_runtime.Estimator",
+ url: "/docs/qiskit_ibm_runtime.Estimator",
},
{
meta: { python_api_type: "class" },
- url: "/docs/runtime/qiskit_ibm_runtime.NoName",
+ url: "/docs/qiskit_ibm_runtime.NoName",
},
{
meta: { python_api_type: "class", python_api_name: "Options" },
- url: "qiskit_ibm_runtime.options.Options",
+ url: "docs/qiskit_ibm_runtime.options.Options",
},
{
meta: {
python_api_type: "function",
python_api_name: "runSomething",
},
- url: "qiskit_ibm_runtime.runSomething",
+ url: "docs/qiskit_ibm_runtime.runSomething",
},
{
meta: {
python_api_type: "module",
python_api_name: "qiskit_ibm_runtime.single",
},
- url: "/docs/runtime/qiskit_ibm_runtime/single",
+ url: "/docs/single",
},
]);
@@ -71,235 +70,29 @@ describe("generateTocFromPythonApiFiles", () => {
{
"children": [
{
- "children": [
- {
- "title": "Overview",
- "url": "/docs/runtime/qiskit_ibm_runtime",
- },
- {
- "title": "qiskit_ibm_runtime.options",
- "url": "/docs/runtime/qiskit_ibm_runtime.options",
- },
- {
- "title": "qiskit_ibm_runtime.single",
- "url": "/docs/runtime/qiskit_ibm_runtime/single",
- },
- ],
"title": "qiskit_ibm_runtime",
+ "url": "/docs/runtime",
},
{
- "title": "Release notes",
- "url": "/api/qiskit_ibm_runtime/release-notes",
- },
- ],
- "title": "Qiskit Runtime IBM Client",
- }
- `);
- });
-
- test("nest modules", () => {
- const toc = generateToc(pkg, [
- {
- meta: {
- python_api_type: "module",
- python_api_name: "qiskit_ibm_runtime",
- },
- url: "/docs/runtime/qiskit_ibm_runtime",
- },
- {
- meta: {
- python_api_type: "module",
- python_api_name: "qiskit_ibm_runtime.options",
- },
- url: "/docs/runtime/qiskit_ibm_runtime.options",
- },
- {
- meta: {
- python_api_type: "class",
- python_api_name: "qiskit_ibm_runtime.Estimator",
- },
- url: "/docs/runtime/qiskit_ibm_runtime.Estimator",
- },
- {
- meta: {
- python_api_type: "class",
- python_api_name: "qiskit_ibm_runtime.options.Options",
- },
- url: "qiskit_ibm_runtime.options.Options",
- },
- {
- meta: {
- python_api_type: "class",
- python_api_name: "qiskit_ibm_runtime.options.Options2",
- },
- url: "qiskit_ibm_runtime.options.Options2",
- },
- ]);
-
- expect(toc).toMatchInlineSnapshot(`
- {
- "children": [
- {
- "children": [
- {
- "title": "Overview",
- "url": "/docs/runtime/qiskit_ibm_runtime",
- },
- {
- "title": "Estimator",
- "url": "/docs/runtime/qiskit_ibm_runtime.Estimator",
- },
- {
- "children": [
- {
- "title": "Overview",
- "url": "/docs/runtime/qiskit_ibm_runtime.options",
- },
- {
- "title": "Options",
- "url": "qiskit_ibm_runtime.options.Options",
- },
- {
- "title": "Options2",
- "url": "qiskit_ibm_runtime.options.Options2",
- },
- ],
- "title": "qiskit_ibm_runtime.options",
- },
- ],
- "title": "qiskit_ibm_runtime",
- },
- {
- "title": "Release notes",
- "url": "/api/qiskit_ibm_runtime/release-notes",
- },
- ],
- "title": "Qiskit Runtime IBM Client",
- }
- `);
- });
-
- test("skip nest modules using a fn", () => {
- const toc = generateToc(
- {
- ...pkg,
- tocOptions: {
- nestModule(id: string) {
- if (id === "qiskit_ibm_runtime.options") return false;
- return true;
- },
- },
- },
- [
- {
- meta: {
- python_api_type: "module",
- python_api_name: "qiskit_ibm_runtime",
- },
- url: "/docs/runtime/qiskit_ibm_runtime",
- },
- {
- meta: {
- python_api_type: "module",
- python_api_name: "qiskit_ibm_runtime.options",
- },
- url: "/docs/runtime/qiskit_ibm_runtime.options",
- },
- {
- meta: {
- python_api_type: "class",
- python_api_name: "qiskit_ibm_runtime.Estimator",
- },
- url: "/docs/runtime/qiskit_ibm_runtime.Estimator",
- },
- {
- meta: {
- python_api_type: "class",
- python_api_name: "qiskit_ibm_runtime.options.Options",
- },
- url: "qiskit_ibm_runtime.options.Options",
- },
- {
- meta: {
- python_api_type: "class",
- python_api_name: "qiskit_ibm_runtime.options.Options2",
- },
- url: "qiskit_ibm_runtime.options.Options2",
- },
- {
- meta: {
- python_api_type: "module",
- python_api_name: "qiskit_ibm_runtime.provider",
- },
- url: "qiskit_ibm_runtime.provider",
- },
- {
- meta: {
- python_api_type: "class",
- python_api_name: "qiskit_ibm_runtime.provider.Provider",
- },
- url: "qiskit_ibm_runtime.provider.Provider",
- },
- ],
- );
-
- expect(toc).toMatchInlineSnapshot(`
- {
- "children": [
- {
- "children": [
- {
- "title": "Overview",
- "url": "/docs/runtime/qiskit_ibm_runtime",
- },
- {
- "title": "Estimator",
- "url": "/docs/runtime/qiskit_ibm_runtime.Estimator",
- },
- {
- "children": [
- {
- "title": "Overview",
- "url": "qiskit_ibm_runtime.provider",
- },
- {
- "title": "Provider",
- "url": "qiskit_ibm_runtime.provider.Provider",
- },
- ],
- "title": "qiskit_ibm_runtime.provider",
- },
- ],
- "title": "qiskit_ibm_runtime",
+ "title": "qiskit_ibm_runtime.options",
+ "url": "/docs/options",
},
{
- "children": [
- {
- "title": "Overview",
- "url": "/docs/runtime/qiskit_ibm_runtime.options",
- },
- {
- "title": "Options",
- "url": "qiskit_ibm_runtime.options.Options",
- },
- {
- "title": "Options2",
- "url": "qiskit_ibm_runtime.options.Options2",
- },
- ],
- "title": "qiskit_ibm_runtime.options",
+ "title": "qiskit_ibm_runtime.single",
+ "url": "/docs/single",
},
{
"title": "Release notes",
"url": "/api/qiskit_ibm_runtime/release-notes",
},
],
+ "collapsed": true,
"title": "Qiskit Runtime IBM Client",
}
`);
});
- test("TOC with nested release notes", () => {
+ test("TOC with distinct release note files", () => {
const toc = generateToc(
{
...pkg,
@@ -340,6 +133,7 @@ describe("generateTocFromPythonApiFiles", () => {
"title": "Release notes",
},
],
+ "collapsed": true,
"title": "Qiskit Runtime IBM Client",
}
`);
diff --git a/scripts/lib/sphinx/generateToc.ts b/scripts/lib/sphinx/generateToc.ts
index a69c7d6c75e..2379f8bdc41 100644
--- a/scripts/lib/sphinx/generateToc.ts
+++ b/scripts/lib/sphinx/generateToc.ts
@@ -25,15 +25,20 @@ type Toc = {
title: string;
subtitle?: string;
children: TocEntry[];
- collapsed?: boolean;
+ collapsed: boolean;
};
+function nestModule(id: string): boolean {
+ // For example, nest `qiskit.algorithms.submodule`, but
+ // not `qiskit.algorithms` which should be top-level.
+ return id.split(".").length > 2;
+}
+
export function generateToc(
pkg: Pkg,
results: Array<{ meta: PythonObjectMeta; url: string }>,
-) {
+): Toc {
const releaseNotesUrl = `/api/${pkg.name}/release-notes`;
- const nestModule = pkg.tocOptions?.nestModule ?? (() => true);
const resultsWithName = results.filter(
(result) => !isEmpty(result.meta.python_api_name),
);
@@ -128,17 +133,17 @@ export function generateToc(
}
tocChildren.push(releaseNotesEntry);
- const toc: Toc = {
+ return {
title: pkg.title,
children: tocChildren,
+ collapsed: true,
};
- if (pkg.tocOptions?.collapsed) {
- toc.collapsed = true;
- }
- return toc;
}
-function findClosestParentModules(id: string, possibleParents: string[]) {
+function findClosestParentModules(
+ id: string,
+ possibleParents: string[],
+): string | undefined {
const idParts = id.split(".");
for (let i = idParts.length - 1; i > 0; i--) {
const testId = idParts.slice(0, i).join(".");
@@ -148,11 +153,11 @@ function findClosestParentModules(id: string, possibleParents: string[]) {
}
}
-function orderEntriesByTitle(items: TocEntry[]) {
+function orderEntriesByTitle(items: TocEntry[]): TocEntry[] {
return orderBy(items, [(item) => item.title.toLowerCase()]);
}
-function orderEntriesByChildrenAndTitle(items: TocEntry[]) {
+function orderEntriesByChildrenAndTitle(items: TocEntry[]): TocEntry[] {
return orderBy(items, [
(item) => (isEmpty(item.children) ? 0 : 1),
(item) => item.title.toLowerCase(),
diff --git a/scripts/lib/sphinx/renameUrls.ts b/scripts/lib/sphinx/renameUrls.ts
deleted file mode 100644
index a86b03132da..00000000000
--- a/scripts/lib/sphinx/renameUrls.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// This code is a Qiskit project.
-//
-// (C) Copyright IBM 2023.
-//
-// This code is licensed under the Apache License, Version 2.0. You may
-// obtain a copy of this license in the LICENSE file in the root directory
-// of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
-//
-// Any modifications or derivative works of this code must retain this
-// copyright notice, and modified files need to carry a notice indicating
-// that they have been altered from the originals.
-
-import { SphinxToMdResultWithUrl } from "./SphinxToMdResult";
-
-export function renameUrls(results: SphinxToMdResultWithUrl[]): void {
- for (let result of results) {
- result.url = result.url
- .replace("release_notes", "release-notes")
- // The original API docs don't call their API index pages `/index`.
- // We can't fix their setup until qiskit.org is removed, so
- // instead we fix it here.
- .replace(/\/ibm_provider$/g, "/index")
- .replace(/\/runtime_service$/g, "/index")
- .replace(/\/terra$/g, "/index");
- }
-}
diff --git a/scripts/lib/sphinx/specialCaseResults.ts b/scripts/lib/sphinx/specialCaseResults.ts
new file mode 100644
index 00000000000..fe74b1b6c85
--- /dev/null
+++ b/scripts/lib/sphinx/specialCaseResults.ts
@@ -0,0 +1,49 @@
+// This code is a Qiskit project.
+//
+// (C) Copyright IBM 2023.
+//
+// This code is licensed under the Apache License, Version 2.0. You may
+// obtain a copy of this license in the LICENSE file in the root directory
+// of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
+//
+// Any modifications or derivative works of this code must retain this
+// copyright notice, and modified files need to carry a notice indicating
+// that they have been altered from the originals.
+
+import { SphinxToMdResultWithUrl } from "./SphinxToMdResult";
+
+function specialCaseResults(results: SphinxToMdResultWithUrl[]): void {
+ for (let result of results) {
+ // We use `-` rather than `_` as our delimiter.
+ if (result.url.endsWith("release_notes")) {
+ result.url = result.url.replace(/\/release_notes$/g, "/release-notes");
+ }
+
+ // Before Qiskit 0.44, the API index page was called terra.html.
+ if (result.url.endsWith("/terra")) {
+ result.url = result.url.replace(/\/terra$/g, "/index");
+ }
+
+ if (result.url.endsWith("/ibm-provider")) {
+ result.url = result.url.replace(/\/ibm-provider$/g, "/index");
+ result.meta = {
+ hardcoded_frontmatter: `
+title: Qiskit IBM Provider API Docs
+description: API documentation for qiskit-ibm-provider
+`,
+ };
+ }
+
+ if (result.url.endsWith("/ibm-runtime")) {
+ result.url = result.url.replace(/\/ibm-runtime$/g, "/index");
+ result.meta = {
+ hardcoded_frontmatter: `
+title: Qiskit Runtime IBM Client API Docs
+description: API documentation for qiskit-ibm-runtime
+`,
+ };
+ }
+ }
+}
+
+export default specialCaseResults;