def to_density_matrix(state):
    """
    Convert a Hilbert space vector to a density matrix.

    :param qt.basis state: The state to convert into a density matrix.
    :return: The density operator corresponding to state.
    :rtype: qutip.qobj.Qobj
    """
    return state * state.dag()