channel_metrics.diamond_norm

Compute the diamond norm between two quantum channels.

Module Contents

Functions

diamond_norm(choi_1, choi_2)

Return the diamond norm distance between two quantum channels.

channel_metrics.diamond_norm.diamond_norm(choi_1, choi_2)

Return the diamond norm distance between two quantum channels.

The calculation uses the simplified semidefinite program of Watrous in [1].

This function has been adapted from [1]

Note

This calculation becomes very slow for 4 or more qubits.

Examples

Consider the depolarizing and identity channels in a 2-dimensional space. The depolarizing channel parameter is set to 0.2:

>>> import numpy as np
>>> from toqito.channels import depolarizing
>>> from toqito.channel_metrics import diamond_norm
>>> choi_depolarizing = depolarizing(dim=2, param_p=0.2)
>>> choi_identity = np.identity(2**2)
>>> dn = diamond_norm(choi_depolarizing, choi_identity)
>>> print("Diamond norm between depolarizing and identity channels: ", dn)
Diamond norm between depolarizing and identity channels:  -2.1680424534747078e-07

Similarly, we can compute the diamond norm between the dephasing channel (with parameter 0.3) and the identity channel:

>>> import numpy as np
>>> from toqito.channels import dephasing
>>> from toqito.channel_metrics import diamond_norm
>>> choi_dephasing = dephasing(dim=2)
>>> choi_identity = np.identity(2**2)
>>> dn = diamond_norm(choi_dephasing, choi_identity)
>>> print("Diamond norm between dephasing and identity channels: ", dn)
Diamond norm between depolarizing and identity channels:  -3.5989938811978797e-09

References

[1]

John Watrous. Semidefinite programs for completely bounded norms. 2009. arXiv:0901.4709.

[2]

Rigetti. Forest benchmarking. https://github.com/rigetti/forest-benchmarking.

Raises:
  • ValueError – If matrices are not of equal dimension.

  • ValueError – If matrices are not square.

Parameters:
  • choi_1 (numpy.ndarray) – A 4**N by 4**N matrix (where N is the number of qubits).

  • choi_2 (numpy.ndarray) – A 4**N by 4**N matrix (where N is the number of qubits).

Return type:

float