matrices.standard_basis

Constructs the standard basis.

Functions

standard_basis(dim[, flatten])

Create standard basis of dimension dim.

Module Contents

matrices.standard_basis.standard_basis(dim, flatten=False)

Create standard basis of dimension dim.

Create a list containing the elements of the standard basis for the given dimension:

\[|1> = (1, 0, 0, ..., 0)^T |2> = (0, 1, 0, ..., 0)^T . . . |n> = (0, 0, 0, ..., 1)^T\]

This function was inspired by [1, 2, 3]

Examples

>>> from toqito.matrices import standard_basis
>>> standard_basis(2)
[array([[1.],
       [0.]]), array([[0.],
       [1.]])]

References

[1]

Akshay Seshadri. Minimax fidelity estimation. URL: https://github.com/akshayseshadri/minimax-fidelity-estimation.

[2]

Akshay Seshadri, Martin Ringbauer, Thomas Monz, and Stephen Becker. Theory of versatile fidelity estimation with confidence. 2021. arXiv:2112.07947.

[3]

Akshay Seshadri, Martin Ringbauer, Rainer Blatt, Thomas Monz, and Stephen Becker. Versatile fidelity estimation with confidence. 2021. arXiv:2112.07925.

Parameters:
  • dim (int) – The dimension of the basis.

  • flatten (bool) – If True, the basis is returned as a flattened list.

Returns:

A list of numpy.ndarray of shape (n, 1).

Return type:

list[numpy.ndarray]