# Randomness amplification (8 devices)

Randomness amplification is a protocol for Quantum Random Number Generator which takes a string from a weak source of randomness - one which contains correlations and may be at least somewhat predictable by an adversary - and converts it to a (potentially shorter) string which is (close to) uniformly random and private from any adversaries. The protocol of Brandao et al allows for eight untrusted devices to be used in a noise-tolerant setting to amplify an arbitrarily weak Santha-Vazirani (SV) source.

Classically, it is only possible to extract uniform, private randomness by combining multiple weak sources together. This protocol enables the extraction of such randomness from only a single weak source - useful in any situation where only some randomness has been provided but absolute security is required.

## Assumptions

• No-signalling theorem is correct
• The measurement devices do not interact during measurements
• The measurement devices are not correlated with the input string

## Outline

In this protocol, Alice has an initial string that has been produced by an SV source and therefore is not uniformly random. She has been provided with eight identical measurement devices by Eve, each of which has two settings and can produce two outputs. Classical randomness extractors exist which are capable of combining three independent sources of weak randomness into a single (close to) uniform, private source. Alice's overarching goal is, therefore, to use her provided apparatus to simulate three independent sources using only her single initial string.

First, Alice divides up the measurement devices into two groups of four. Then, she divides her input string into four portions, the required sizes of which will depend on her choice of randomness extractor and the confidence with which she would like the protocol to succeed (i.e. produce a string which is uniformly random and private). She also decides on a threshold for noise which she deems acceptable.

Using the first portion of the string and the first group of four measurement devices, Alice performs a four-party analogue of a CHSH game: taking four bits at a time from the string, she uses their values to choose measurement settings on the devices (i.e. if the bits taken are ${\displaystyle 0,1,0,1}$ then she sets device one to ${\displaystyle 0}$, two to ${\displaystyle 1}$, three to ${\displaystyle 0}$ and four to ${\displaystyle 1}$). Then, she prepares a four-partite entangled state across the devices and measures with each, storing the results she gets as a string of bits. Once the portion of string she started with has been exhausted, she looks at the correlation of her chosen inputs and results - if this value is within an accepted threshold (defined by her choice of noise) she continues, otherwise, the protocol is aborted.

Taking two more portions of the string and the remaining four devices, and dividing one of these portions into a number of equally sized blocks, Alice repeats the measurement process as described above, using each block in turn. She stops before the correlation check and records her results each time. Using the other selected portion of the string as an index to her list of stored results, Alice chooses one of the blocks of inputs and recorded results, and passes this to the same correlation check.

If this check does not abort, Alice passes the first string of measurement results, the randomly selected string of results and the remaining portion of the original string to a classical randomness extractor. The output of this is then returned as (close to) uniformly random, private (i.e. randomness amplified) string.

• ${\displaystyle n}$: number of measurement iterations (per block)
• ${\displaystyle N}$: number of blocks to repeat second set of measurements for
• ${\displaystyle x_{i,j}}$: measurement setting for device ${\displaystyle j}$ on iteration ${\displaystyle i}$
• ${\displaystyle a_{i,j}}$: measurement result for device ${\displaystyle j}$ on iteration ${\displaystyle i}$
• ${\displaystyle {\textrm {bases}}}$: tuple of measurement bases for each device; \textrm{bases} = ${\displaystyle \{X,Z\}}$
• ${\displaystyle s}$: string of measurement basis groups; ${\displaystyle s=(x_{1,1},x_{1,2},x_{1,3},x_{1,4};\ldots ;x_{n,1},x_{n,2},x_{n,3},x_{n,4})}$
• ${\displaystyle r}$: string of measurement result groups; ${\displaystyle r=(a_{1,1},a_{1,2},a_{1,3},a_{1,4};\ldots ;a_{n,1},a_{n,2},a_{n,3},a_{n,4})}$
• ${\displaystyle S}$: list of strings of measurement basis groups for blocks 1 to ${\displaystyle N}$; ${\displaystyle S=(s_{1}\ldots s_{N})}$
• ${\displaystyle R}$: list of strings of measurement result groups for blocks 1 to ${\displaystyle N}$; ${\displaystyle R=(r_{1}\ldots r_{N})}$
• ${\displaystyle t}$: initial weak random seed
• ${\displaystyle u}$: final randomness amplified string
• ${\displaystyle |\phi _{-}\rangle ,|\psi _{+}\rangle }$: maximally entangled two qubit Bell states
• ${\displaystyle |{\tilde {\phi }}_{+}\rangle }$: two qubit entangled state; ${\displaystyle |{\tilde {\phi }}_{+}\rangle ={\frac {1}{\sqrt {2}}}{\big (}|0\rangle |+\rangle +|1\rangle |-\rangle {\big )}}$
• ${\displaystyle |{\tilde {\psi }}_{-}\rangle }$: two qubit entangled state; ${\displaystyle |{\tilde {\psi }}_{-}\rangle ={\frac {1}{\sqrt {2}}}{\big (}|0\rangle |-\rangle -|1\rangle |+\rangle {\big )}}$
• ${\displaystyle |\Psi \rangle }$: entangled state shared by measurement systems; ${\displaystyle |\Psi \rangle ={\frac {1}{\sqrt {2}}}{\big (}|\phi ^{-}\rangle |{\tilde {\phi \rangle ^{+}}}+|\psi ^{+}\rangle |{\tilde {\psi }}^{-}\rangle {\big )}}$
• ${\displaystyle \delta }$: chosen tolerated noise
• ${\displaystyle {\hat {B}}}$: estimate of the bell inequality defined in Brandao et. al.
• ${\displaystyle \mathbb {I_{\textrm {cond}}} }$: indicator function taking value 1 if \textrm{cond} evaluates true and 0 otherwise
• ${\displaystyle D^{(1)}}$: group of measurement devices containing devices 1 to 4
• ${\displaystyle D^{(2)}}$: group of measurement devices containing devices 5 to 8
• ${\displaystyle {\textrm {Ext}}}$: three-source randomness extractor

## Requirements

• Network stage: Entanglement Distribution
• Weak (SV) random number generator
• Authenticated quantum channel
• Authenticated classical channel
• Hardware:
• Mutli qubit non-seperable state preparation
• Single qubit measurement
• Single qubit gate

## Properties

• Requires eight measurement devices
• Devices can be untrusted
• Noise tolerance is dependent on weakness of the source
• Arbitrarily weak SV sources can be amplified in the absence of noise
• Length of the amplified string depends on the choice of a randomness extractor

## Pseudocode

Input: ${\displaystyle t}$, ${\displaystyle \delta }$, ${\displaystyle N}$, ${\displaystyle {\textrm {Ext}}}$

Output: ${\displaystyle u}$

• split ${\displaystyle t}$ into ${\displaystyle t=(t^{(1)},t^{(2)},t^{(3)},t^{(4)})}$ where ${\displaystyle |t^{(3)}|=\log {N},|t^{(2)}|=N|t^{(1)}|}$ and ${\displaystyle |t^{(1)}|,|t^{(4)}|}$ are determined by ${\displaystyle {\textrm {Ext}}}$
• ${\displaystyle n\leftarrow {\big \lfloor }{\frac {|t^{(1)}|}{2}}{\big \rfloor }}$
• initialise arrays ${\displaystyle r}$, ${\displaystyle s}$ of length ${\displaystyle n}$
• initialise (2D) arrays ${\displaystyle R}$, ${\displaystyle S}$ of length ${\displaystyle N}$ (with elements of length ${\displaystyle n}$)
• ${\displaystyle {\textrm {measurementBlock}}}$(${\displaystyle D^{(1)},t^{(1)},n,s,r}$)
• ${\displaystyle {\hat {B}}\leftarrow }$${\displaystyle {\textrm {estimateBellViolation}}}$${\displaystyle (n,s,r)}$
• If ${\displaystyle {\hat {B}}>\delta }$:
• ${\displaystyle {\textbf {abort}}}$
• For ${\displaystyle k\leftarrow 1}$ to ${\displaystyle N}$:
• ${\displaystyle {\textrm {measurementBlock}}}$(${\displaystyle D^{(2)},t_{nk:n(k+1)}^{(2)},n,S[k],R[k]}$)
• ${\displaystyle t^{(3)}\leftarrow }$ cast ${\displaystyle t^{(3)}}$ as an integer
• ${\displaystyle {\hat {B}}\leftarrow {\textrm {estimateBellViolation}}(n,S[t^{(3)}],R[t^{(3)}])}$
• If ${\displaystyle {\hat {B}}>\delta }$:
• ${\displaystyle {\textbf {abort}}}$
• ${\displaystyle u\leftarrow {\textrm {Ext}}(r,R[t^{(3)}],t^{(4)}}$)

With the following subroutines defined:

${\displaystyle {\textrm {measurementBlock}}}$

Input: ${\displaystyle D,t,n,s,r}$

• For ${\displaystyle i\leftarrow 1}$ to ${\displaystyle n}$:
• prepare state ${\displaystyle |\Psi \rangle ={\frac {1}{\sqrt {2}}}{\big (}|\phi _{-}\rangle |{\tilde {\phi }}_{+}\rangle +|\psi _{+}\rangle |{\tilde {\psi }}_{-}\rangle {\big )}}$ and share across ${\displaystyle D}$
• ${\displaystyle j\leftarrow 1}$ to 4:
• ${\displaystyle x_{i,j}\leftarrow t_{4i+j}}$
• ${\displaystyle a_{i,j}\leftarrow }$ measurement from device ${\displaystyle j}$ in basis \textrm{bases}[${\displaystyle x_{i,j}}$]
• ${\displaystyle s[i]\leftarrow (x_{i,1},x_{i,2},x_{i,3},x_{i,4})}$
• ${\displaystyle r[i]\leftarrow (a_{i,1},a_{i,2},a_{i,3},a_{i,4})}$

${\displaystyle {\textrm {estimateBellViolation}}}$

Input: ${\displaystyle n,s,r}$

Output: ${\displaystyle {\hat {B}}}$

• ${\displaystyle {\hat {B}}\leftarrow 0}$
• For ${\displaystyle i\leftarrow 1}$ to ${\displaystyle n}$:
• ${\displaystyle x_{1},x_{2},x_{3},x_{4}\leftarrow s[i]}$
• ${\displaystyle a_{1},a_{2},a_{3},a_{4}\leftarrow r[i]}$
• ${\displaystyle {\hat {B}}\leftarrow {\hat {B}}+{\frac {1}{n}}{\big (}\mathbb {I} _{\bigoplus _{j=1}^{4}x_{j}=0}\mathbb {I} _{\bigoplus _{a=1}^{4}u_{j}=1}+\mathbb {I} _{\bigoplus _{j=1}^{4}x_{j}=1}\mathbb {I} _{\bigoplus _{a=1}^{4}u_{j}=0}{\big )}}$

## Further Information

Brandão et. al. also provide a protocol that achieves randomness amplification using only four devices, however, the randomness extractor required to produce multiple bits is only defined implicitly (i.e. we can prove that it exists but have not yet been able to construct it). A randomness extractor does exist that is able to produce a single private bit.

## References

contributed by Neil Mcblane