Korean
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.quantum_info.Statevector.from_label

classmethod Statevector.from_label(label)[소스]

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

Table 12 Single-qubit state labels

Label

Statevector

"0"

\([1, 0]\)

"1"

\([0, 1]\)

"+"

\([1 / \sqrt{2}, 1 / \sqrt{2}]\)

"-"

\([1 / \sqrt{2}, -1 / \sqrt{2}]\)

"r"

\([1 / \sqrt{2}, i / \sqrt{2}]\)

"l"

\([1 / \sqrt{2}, -i / \sqrt{2}]\)

매개변수

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.