Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

outer

outer(vector1, vector2=None)

GitHub

Construct the outer product of two vectors.

The second vector argument is optional, if absent the projector of the first vector will be returned.

Parameters

  • vector1 (ndarray) – the first vector.
  • vector2 (ndarray) – the (optional) second vector.

Returns

The matrix v1v2|v1\rangle\langle{v2}|.

Return type

np.array

Was this page helpful?
Report a bug or request content on GitHub.