n-Local Star Inequality#

The \(n\)-local star network consists of \(n\) entanglement sources (static preparation nodes) and \(n+1\) measurement nodes where one central node holds one qubit from each source and the remaining \(n\) nodes are connected to the central node through a single source. The network forms an \(n\) point star. Polynomial Bell inequalities can be derivied that tightly bound the set of classical correlations [Tavakoli2014]. These \(n\)-local star Bell inequalities witness quantum violations to the classical \(n\)-local set and can be used to optimize non-\(n\)-locality in star configurations.

qnetvo.nlocal_star_22_cost_fn(network_ansatz, parallel=False, nthreads=4, **qnode_kwargs)[source]#

A network-specific constructor for the \(n\)-local star Bell inequality for scenarios when all measurement devices in the star network have 2 inputs and 2 outputs.

The \(n\)-local star network Bell inequality is expressed as

\[|I_{22,n}|^{1/n} + |J_{22,n}|^{1/n} \leq 1\]

where the quantities \(I_{22,n}\) and \(J_{22,n}\) are evaluated using functions constructed by the qnetvo.star_I22_fn() and qnetvo.star_J22_fn() methods respectively. The classical bound is found to be 1, but quantum systems can score as high as \(\sqrt{2}\).

Parameters:
  • network_ansatz (qnet.NetworkAnsatz) – The \(n\)-local star network ansatz.

  • parallel (optional Bool) – If True qnodes will be evaluated in separate threads. This is valuable for execution on remote simulator and hardware devices. Default value: False.

  • nthreads (Int) – Specifies the number of threads used when parallel=True.

  • qnode_kwargs (optional dictionary) – keyword args passed through to the QNode constructor.

Returns:

A function callable as nlocal_star_22_cost(*network_settings) that evaluates the cost as \(-|I_{22,n}|^{1/n} - |J_{22,n}|^{1/n}\).

Return type:

function

qnetvo.star_I22_fn(network_ansatz, parallel=False, nthreads=4, **qnode_kwargs)[source]#

Constructs a network-specific I22(network_settings) function that evaluates the \(I_{22,n}\) quantity for the \(n\)-local star network.

The \(I_{22,n}\) quantity is formally expressed as

\[I_{22,n} = \frac{1}{2^n}\sum_{x_1,\dots,x_n}\langle A_{x_1}\dots A_{x_n}B_0\rangle,\]

where \(x_i\in\{0,1\}\) and \(A_{x_i}\) and \(B_{x_{n+1}}\) are dichotomic observables.

Parameters:
  • network_ansatz (qnet.NetworkAnsatz) – The \(n\)-local star network ansatz.

  • parallel (optional Bool) – If True qnodes will be evaluated in separate threads. This is valuable for execution on remote simulator and hardware devices. Default value: False.

  • nthreads (Int) – Specifies the number of threads used when parallel=True.

  • qnode_kwargs (optional dictionary) – keyword args passed through to the QNode constructor.

Returns:

A function callable as I22(*network_settings) that evaluates the \(I_{22,n}\) quantity.

Return type:

function

qnetvo.star_J22_fn(network_ansatz, parallel=False, nthreads=4, **qnode_kwargs)[source]#

Constructs a network-specific J22(network_settings) function that evaluates the \(J_{22,n}\) quantity for the \(n\)-local star network.

The \(J_{22,n}\) quantity is formally expressed as

\[J_{22,n} = \frac{1}{2^n}\sum_{x_1,\dots,x_n}(-1)^{\sum_i x_i}\langle A_{x_1}\dots A _{x_n}B_1\rangle,\]

where \(x_i\in\{0,1\}\) and \(A_{x_i}\) and \(B_{x_{n+1}}\) are dichotomic observables.

Parameters:
  • network_ansatz (qnet.NetworkAnsatz) – The \(n\)-local star network ansatz.

  • parallel (optional Bool) – If True qnodes will be evaluated in separate threads. This is valuable for execution on remote simulator and hardware devices. Default value: False.

  • nthreads (Int) – Specifies the number of threads used when parallel=True.

  • qnode_kwargs (optional dictionary) – keyword args passed through to the QNode constructor.

Returns:

A function callable as J22(*network_settings) that evaluates the \(J_{22,n}\) quantity for the given network_settings.

Return type:

function

qnetvo.parallel_nlocal_star_grad_fn(network_ansatz, nthreads=4, natural_grad=False, **qnode_kwargs)[source]#

Constructs a parallelizeable gradient function grad_fn for the \(n\)-local star cost function.

The gradient of the nlocal_star_22_cost_fn() is expressed as,

\[-\nabla_{\vec{\theta}}|I_{22,n}|^{1/n} - \nabla_{\vec{\theta}}|J_{22,n}|^{1/n},\]

where the gradient differentiates with respect to the network settings \(\vec{\theta}\).

The parallelization is achieved through multithreading and intended to improve the efficiency of remote qnode execution.

Parameters:
  • network_ansatz (NetworkAnsatz) – The ansatz describing the \(n\)-local chain network.

  • nthreads (Int) – Specifies the number of threads used when parallel=True.

  • natural_grad (optional Bool) – If True, the natural gradient is evaluated by scaling the gradient by the inverse of the metric tensor.

  • qnode_kwargs (optional dict) – A keyword argument passthrough to qnode construction.

Returns:

A parallelized (multithreaded) gradient function nlocal_star_grad(network_settings).

Return type:

Function

Warning

Parallel gradient computation is flaky on PennyLane v0.28+. Intermittent failures may occur.

References#

[Tavakoli2014]

Tavakoli, Armin, et al. “Nonlocal correlations in the star-network configuration.” Physical Review A 90.6 (2014): 062109.