Bengali
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.quantum_info.DensityMatrix.from_label

classmethod DensityMatrix.from_label(label)[source]

Return a tensor product of Pauli X,Y,Z eigenstates.

Table 13 Single-qubit state labels

Label

Statevector

"0"

\(\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}\)

"1"

\(\begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}\)

"+"

\(\frac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}\)

"-"

\(\frac{1}{2}\begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}\)

"r"

\(\frac{1}{2}\begin{pmatrix} 1 & -i \\ i & 1 \end{pmatrix}\)

"l"

\(\frac{1}{2}\begin{pmatrix} 1 & i \\ -i & 1 \end{pmatrix}\)

প্যারামিটার

label (string) -- a eigenstate string ket label (see table for allowed values).

রিটার্নস

The N-qubit basis state density matrix.

রিটার্ন টাইপ

Statevector

রেইজেস

QiskitError -- if the label contains invalid characters, or the length of the label is larger than an explicitly specified num_qubits.