When quantum states in a Hilbert space
Here, the state
PennyLane can handle density matrices quite well on its own. But for the sake of learning, let us build some density matrices by hand. Using np.outer
or otherwise, complete the function below that returns the density matrix when the qubit state_1
is prepared with probability p_1,
and the qubit state_2
with probability p_2
. You may assume that the qubits are normalized.
To interact with codercises, please switch to a larger screen size.
Learning Objectives: