Safe Haskell | None |
---|---|
Language | Haskell2010 |
- Module : Gates
- Description : Basic Quantum Gates
- Copyright : (c) Mihai Sebastian Ardelean, 2017
- License : BSD3
- Maintainer : ardeleanasm@gmail.com
- Portability : POSIX
Documentation
- xGate function represent a Pauli X-Gate
>>>
xGate
(2><2) [ 0.0 :+ 0.0, 1.0 :+ 0.0 , 1.0 :+ 0.0, 0.0 :+ 0.0 ]
- yGate function represent a Pauli Y-Gate
>>>
yGate
(2><2) [ 0.0 :+ 0.0, 0.0 :+ (-1.0) , 0.0 :+ 1.0, 0.0 :+ 0.0 ]
- zGate function represent a Pauli Z-Gate
>>>
zGate
(2><2) [ 1.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, (-1.0) :+ (-0.0) ]
- hGate function represent a Hadamard Gate
>>>
hGate
(2><2) [ 0.7071067811865475 :+ 0.0, 0.7071067811865475 :+ 0.0 , 0.7071067811865475 :+ 0.0, (-0.7071067811865475) :+ 0.0 ]
- iGate function represent an Identity Matrix
>>>
iGate
(2><2) [ 1.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 1.0 :+ 0.0 ]
cPhaseShifGate :: Gate Source #
- cPhaseShifGate function represent a Controlled Phase-Shift Gate
>>>
cPhaseShifGate
(4><4) [ 1.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 1.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 1.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, (-1.0) :+ (-0.0) ]
- cNotGate function represent a Controlled-Not Gate
>>>
cNotGate
(4><4) [ 1.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 1.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 1.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 1.0 :+ 0.0, 0.0 :+ 0.0 ]
- swapGate function represent a Swap Gate
>>>
swapGate
(4><4) [ 1.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 1.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 1.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 1.0 :+ 0.0 ]
- Kronecker product operator is used to create gates that can be used on multiple qubits
- Gate addition, a wrapper function over matrix addition
- Gate subtraction, a wrapper function over matrix subtraction