qiskit.opflow.state_fns.StateFn.to_density_matrix¶
- StateFn.to_density_matrix(massive=False)[source]¶
Return matrix representing product of StateFn evaluated on pairs of basis states. Overridden by child classes.
- Parameters
massive (bool) -- Whether to allow large conversions, e.g. creating a matrix representing over 16 qubits.
- Returns
The NumPy array representing the density matrix of the State function.
- Raises
ValueError -- If massive is set to False, and exponentially large computation is needed.
- Return type
ndarray