Skip to main content
1 of 2
3yakuya
  • 934
  • 6
  • 17

Multi-qubit gates matrix representation

Consider the gate used in Simon's Algorithm. It operates on a control register and target register, changing state like: $|\textbf{x}\rangle|\textbf{y}\rangle->|\textbf{x}\rangle|\textbf{y}\oplus f(x)\rangle$.

As I am working on an universal way to simulate operations on qubits, I've been using a matrix representation of gates, which allowed me to transform even pretty complicated states without much concern about transform's correctness. However, I can't really see how would I represent a gate like shown above with a matrix (or how would I build such a matrix knowing x, y and f(x)?)

How can such gates operating on multiple qubits be represented with matrices?

3yakuya
  • 934
  • 6
  • 17