'Represents the (I)QFT In the Z Basis'

def _represent_ZGate(self, basis, **options):

    nqubits = options.get('nqubits', 0)
    if (nqubits == 0):
        raise QuantumError('The    number    of    qubits    must    be    given    as    nqubits.')
    if (nqubits < self.min_qubits):
        raise QuantumError(('The    number    of    qubits    %r    is    too    small    for    the    gate.' % nqubits))
    size = self.size
    omega = self.omega
    arrayFT = [[((omega ** ((i * j) % size)) / sqrt(size)) for i in range(size)] for j in range(size)]
    matrixFT = Matrix(arrayFT)
    if (self.label[0] != 0):
        matrixFT = matrix_tensor_product(eye((2 ** self.label[0])), matrixFT)
    if (self.min_qubits < nqubits):
        matrixFT = matrix_tensor_product(matrixFT, eye((2 ** (nqubits - self.min_qubits))))
    return matrixFT
