qiskit.quantum_info.DensityMatrix.from_instruction¶
- classmethod DensityMatrix.from_instruction(instruction)[ソース]¶
Return the output density matrix of an instruction.
The statevector is initialized in the state \(|{0,\ldots,0}\rangle\) of the same number of qubits as the input instruction or circuit, evolved by the input instruction, and the output statevector returned.
- パラメータ
instruction (qiskit.circuit.Instruction or QuantumCircuit) – instruction or circuit
- 戻り値
the final density matrix.
- 戻り値の型
- 例外
QiskitError – if the instruction contains invalid instructions for density matrix simulation.