GeneratorResult
Representation of random number sampling result.
GeneratorResult constructor.
Bell values are calculated based on the input parameters. The values include:
mermin_correlator: Mermin correlator value. The statistical value calculated from the probability distributions. This verifies quantum correlations when >2, as 2 is the maximal value possible in a classical setup. winning_probability: Probability of “winning” each round in the Mermin quantum game. It is used to verify quantum correlations (the maximum probability in a classical implementation is 87.5%). losing_probability: 1-winning_probability.
mermin_correlator: Mermin correlator value. The statistical value calculated from the probability distributions. This verifies quantum correlations when >2, as 2 is the maximal value possible in a classical setup.
winning_probability: Probability of “winning” each round in the Mermin quantum game. It is used to verify quantum correlations (the maximum probability in a classical implementation is 87.5%).
losing_probability: 1-winning_probability.
wsr – WSR used to generate the circuits.
raw_bits_list – A list of formatted bits from job results.
backend – Backend used to generate the bits.
__init__
Methods
__init__(wsr, raw_bits_list, backend)
bell_values()
bell_values
Return a tuple of the bell values.
extract([rate_sv, expected_correlator, …])
extract
Invoke CQC extractor synchronously.
get_cqc_extractor_params([rate_sv, …])
get_cqc_extractor_params
Return parameters for the CQC extractors.
The losing probability, winning probability, and Mermin correlator.
Note
This method uses the CQC extractor service on IBM Quantum Experience and will raise an RNGNotAuthorizedError if you don’t have access to the service.
RNGNotAuthorizedError
rate_sv – Assumed randomness rate of the initial WSR as a Santha-Vazirani source.
expected_correlator – The expected correlator value. qiskit_rng.constants.EXPECTED_CORRELATOR contains known values for certain backends. If None, the observed value from the sampling output is used.
qiskit_rng.constants.EXPECTED_CORRELATOR
None
epsilon_sec – The distance to uniformity of the final bit string. When performing privacy amplification as well, this is the distance to a perfectly uniform and private string.
quantum_proof – Set to True for quantum-proof extraction in the Markov model (most secure), False for classical-proof extraction in the standard model. Note that setting this to True reduces the generation rates considerably.
True
False
trusted_backend – True if the raw bits were generated by a trusted backend and communicated securely.
privacy – True if privacy amplification is to be performed.
wsr_generator – Function used to generate WSR. It must take the number of bits as the input and a list of random bits (0s and 1s) as the output.
The extracted random bits.
RNGNotAuthorizedError – If you are not authorized to use the CQC extractor.
Dodis is the first 2-source extractor that takes the Bell value and the WSR, in order to generate high-quality random bits.
Hayashi is the second extractor. It takes the output of the first extractor and another WSR string to increase the size of the final output string. The second extractor is only used if trusted_backend is True and privacy is False.
A CQCExtractorParams instance that contains all the parameters needed for the extractors.
CQCExtractorParams
ValueError – If an input argument is invalid.