def find_inverse_clifford_gates(num_qubits, gatelist):
    """
    Find the inverse of a Clifford gate.

    Args:
        num_qubits: the dimension of the Clifford.
        gatelist: a Clifford gate.

    Returns:
        An inverse Clifford gate.
    """

    if num_qubits in (1, 2):
        inv_gatelist = gatelist.copy()
        inv_gatelist.reverse()
        # replace v by w and w by v
        for i, _ in enumerate(inv_gatelist):
            split = inv_gatelist[i].split()
            if split[0] == 'v':
                inv_gatelist[i] = 'w ' + split[1]
            elif split[0] == 'w':
                inv_gatelist[i] = 'v ' + split[1]
        return inv_gatelist
    raise ValueError("The number of qubits should be only 1 or 2")