'Flip the bit(s) given.'

def flip(self, *bits):

    newargs = list(self.qubit_values)
    for i in bits:
        bit = int(((self.dimension - i) - 1))
        if (newargs[bit] == 1):
            newargs[bit] = 0
        else:
            newargs[bit] = 1
    return self.__class__(*tuple(newargs))
