FourierMatrix
Revision as of 05:38, 1 December 2012 by Nathaniel (talk | contribs) (Created page with "{{Function |name=FourierMatrix |desc=Generates the unitary matrix that implements the quantum Fourier transform |upd=November 30, 2012 |v=1.00}} <tt>'''FourierMatrix''...")
| FourierMatrix | |
| Generates the unitary matrix that implements the quantum Fourier transform | |
| Other toolboxes required | none |
|---|---|
FourierMatrix is a function that returns the unitary matrix that implements the quantum Fourier transform.
Syntax
- F = FourierMatrix(DIM)
Argument descriptions
- DIM: The dimension of the system. In other words, F will be a DIM-by-DIM matrix.
Examples
The qubit Fourier matrix
The qubit Fourier matrix is simply the usual Hadamard gate:
>> FourierMatrix(2) ans = 0.7071 0.7071 0.7071 -0.7071 + 0.0000i
The three-qubit Fourier matrix
The following line of code generates the three-qubit (i.e., DIM = 8) Fourier matrix, which can be seen here. The multiplication by sqrt(8) is just there to make the output easier to read.
>> FourierMatrix(8)*sqrt(8) ans = 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.7071 + 0.7071i 0.0000 + 1.0000i -0.7071 + 0.7071i -1.0000 + 0.0000i -0.7071 - 0.7071i -0.0000 - 1.0000i 0.7071 - 0.7071i 1.0000 0.0000 + 1.0000i -1.0000 + 0.0000i -0.0000 - 1.0000i 1.0000 - 0.0000i 0.0000 + 1.0000i -1.0000 + 0.0000i -0.0000 - 1.0000i 1.0000 -0.7071 + 0.7071i -0.0000 - 1.0000i 0.7071 + 0.7071i -1.0000 + 0.0000i 0.7071 - 0.7071i 0.0000 + 1.0000i -0.7071 - 0.7071i 1.0000 -1.0000 + 0.0000i 1.0000 - 0.0000i -1.0000 + 0.0000i 1.0000 - 0.0000i -1.0000 + 0.0000i 1.0000 - 0.0000i -1.0000 + 0.0000i 1.0000 -0.7071 - 0.7071i 0.0000 + 1.0000i 0.7071 - 0.7071i -1.0000 + 0.0000i 0.7071 + 0.7071i -0.0000 - 1.0000i -0.7071 + 0.7071i 1.0000 -0.0000 - 1.0000i -1.0000 + 0.0000i 0.0000 + 1.0000i 1.0000 - 0.0000i -0.0000 - 1.0000i -1.0000 + 0.0000i 0.0000 + 1.0000i 1.0000 0.7071 - 0.7071i -0.0000 - 1.0000i -0.7071 - 0.7071i -1.0000 + 0.0000i -0.7071 + 0.7071i 0.0000 + 1.0000i 0.7071 + 0.7071i