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

65 lines
2.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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
---
# IBMQRandomService
<Class id="qiskit.providers.ibmq.random.IBMQRandomService" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-ibmq-provider/tree/stable/0.17/qiskit/providers/ibmq/random/ibmqrandomservice.py" signature="IBMQRandomService(provider)" modifiers="class">
Bases: `object`
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.
## Methods
### get\_service
<Function id="qiskit.providers.ibmq.random.IBMQRandomService.get_service" signature="IBMQRandomService.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="IBMQRandomService.services()">
Return all random number services available to this account.
**Return type**
`List`\[`BaseRandomService`]
</Function>
</Class>