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.

devectorize

devectorize(vectorized_mat, method='col')

GitHub

Devectorize a vectorized square matrix.

Parameters

  • vectorized_mat (ndarray) – a vectorized density matrix.

  • method (str) –

    the method of devectorization. Allowed values are

    • ’col’ (default): flattens to column-major vector.
    • ’row’: flattens to row-major vector.
    • ’pauli’: flattens in the n-qubit Pauli basis.
    • ’pauli-weights’: flattens in the n-qubit Pauli basis ordered by weight.

Returns

the resulting matrix.

Return type

ndarray

Raises

Exception – if input state is not a n-qubit state

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