# Is it possible to create a gate in Q# that is dictated by a matrix?

When observing the Hadamard gate it is simply a transformation matrix. I am wondering if there is functionality to hard code an arbitrary transformation matrix and its family members up till $$m \times n$$ size depending on the limitations of the simulation. From here I would like the hard coded gate to transform my register of qubits.

There is currently an Issue (#291) raised on the Microsoft QuantumLibraries GitHub regarding an operation called ApplyUnitaryOperation(unitary: Complex[][], qubits : LittleEndian) which aims to do what you are asking. This functionality doesn't exist right now but it was also discussed on the Q# Community Gitter a while ago. Hopefully it will be added as a feature in the future.