Print a state vector

def print_state(state: State, file: TextIO = None) -> None:
    """Print a state vector"""
    state = state.vec.asarray()
    for index, amplitude in np.ndenumerate(state):
        ket = "".join([str(n) for n in index])
        print(ket, ":", amplitude, file=file)