def projector(state, flatten=False):
density_matrix = np.outer(state.conjugate(), state)<EOL>if flatten:<EOL><INDENT>return density_matrix.flatten(order='<STR_LIT:F>')<EOL><DEDENT>return density_matrix<EOL>
maps a pure state to a state matrix

Args:
    state (ndarray): the number of qubits
    flatten (bool): determine if state matrix of column work
Returns:
    ndarray:  state_mat(2**num, 2**num) if flatten is false
    ndarray:  state_mat(4**num) if flatten is true stacked on by the column