qiskit-documentation/docs/api/qiskit/0.24/qiskit.providers.ibmq.rando...

83 lines
3.6 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: IBMQRandomService
description: API reference for qiskit.providers.ibmq.random.IBMQRandomService
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.providers.ibmq.random.IBMQRandomService
---
<span id="qiskit-providers-ibmq-random-ibmqrandomservice" />
# qiskit.providers.ibmq.random.IBMQRandomService
<Class id="qiskit.providers.ibmq.random.IBMQRandomService" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-ibmq-provider/tree/stable/0.12/qiskit/providers/ibmq/random/ibmqrandomservice.py" signature="IBMQRandomService(provider, access_token)" modifiers="class">
Random number services for an IBM Quantum Experience account provider.
Represent a namespace for random number services available to this provider. An instance of this class is used as an attribute to the [`AccountProvider`](qiskit.providers.ibmq.AccountProvider "qiskit.providers.ibmq.AccountProvider") class. This allows a convenient way to query for all services or to access a specific one:
```python
random_services = provider.random.services()
extractor = provider.random.get_extractor('cqc_extractor')
extractor = provider.random.cqc_extractor # Short hand for above.
```
IBMQRandomService constructor.
**Parameters**
* **provider** (`AccountProvider`) IBM Quantum Experience account provider.
* **access\_token** (`str`) IBM Quantum Experience access token.
### \_\_init\_\_
<Function id="qiskit.providers.ibmq.random.IBMQRandomService.__init__" signature="__init__(provider, access_token)">
IBMQRandomService constructor.
**Parameters**
* **provider** (`AccountProvider`) IBM Quantum Experience account provider.
* **access\_token** (`str`) IBM Quantum Experience access token.
</Function>
## Methods
| | |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [`__init__`](#qiskit.providers.ibmq.random.IBMQRandomService.__init__ "qiskit.providers.ibmq.random.IBMQRandomService.__init__")(provider, access\_token) | IBMQRandomService constructor. |
| [`get_service`](#qiskit.providers.ibmq.random.IBMQRandomService.get_service "qiskit.providers.ibmq.random.IBMQRandomService.get_service")(name) | Return the random number service with the given name. |
| [`services`](#qiskit.providers.ibmq.random.IBMQRandomService.services "qiskit.providers.ibmq.random.IBMQRandomService.services")() | Return all random number services available to this account. |
### get\_service
<Function id="qiskit.providers.ibmq.random.IBMQRandomService.get_service" signature="get_service(name)">
Return the random number service with the given name.
**Parameters**
**name** (`str`) Name of the service.
**Return type**
`BaseRandomService`
**Returns**
Service with the given name.
**Raises**
[**IBMQError**](qiskit.providers.ibmq.IBMQError "qiskit.providers.ibmq.IBMQError") If the service cannot be found.
</Function>
### services
<Function id="qiskit.providers.ibmq.random.IBMQRandomService.services" signature="services()">
Return all random number services available to this account.
**Return type**
`List`\[`BaseRandomService`]
</Function>
</Class>