|View source on GitHub|
Returns the density matrix of the state vector.
cirq.qis.density_matrix_from_state_vector( state_vector: np.ndarray, indices: Optional[Iterable[int]] = None, qid_shape: Optional[Tuple[int, ...]] = None ) -> np.ndarray
Calculate the density matrix for the system on the given qubit indices,
with the qubits not in indices that are present in state vector traced out.
If indices is None the full density matrix for
state_vector is returned.
state_vector follows the standard Kronecker convention of
state_vector = np.array([1/np.sqrt(2), 1/np.sqrt(2)], dtype=np.complex64) indices = None gives us
||A sequence representing a state vector in which the ordering mapping to qubits follows the standard Kronecker convention of numpy.kron (big-endian).|
||list containing indices for qubits that you would like to include in the density matrix (i.e.) qubits that WON'T be traced out. follows the standard Kronecker convention of numpy.kron.|
specifies the dimensions of the qudits for the input
|A numpy array representing the density matrix.|
if the size of
if the indices are out of range for the number of qubits