CQCExtractor¶
-
class
CQCExtractor
(name, provider, client, methods)[source]¶ Bases:
qiskit.providers.ibmq.random.baserandomservice.BaseRandomService
Class for interfacing with a CQC remote extractor.
There are two extractor methods - Dodis (extractor 1) and Hayashi (extractor 2). These methods can be invoked synchronously or asynchronously. To invoke them synchronously:
random_bits = extractor.run(*cqc_parameters)
To invoke them asynchronously:
import numpy as np extractor1_out = extractor.run_async_ext1(*ext1_parameters).block_until_ready() extractor2_out = extractor.run_async_ext2( ext2_seed=extractor1_out, *ext2_parameters).block_until_ready() random_bits = np.append(extractor1_out, extractor2_out)
Running them asynchronously takes more steps because extractor 2 uses the output of extractor 1 as its seed, so it must wait for extractor 1 to finish first.
BaseRandomService constructor.
- Parameters
name (
str
) – Name of the extractor.provider (
AccountProvider
) – IBM Quantum Experience account provider.client (
RandomClient
) – Client used to communicate with the server.methods (
List
) – Service methods.
Methods
Retrieve a previously submitted job.
Process input data synchronously.
Run the first extractor asynchronously.
Run the second extractor asynchronously.