| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Quantum.Gates
Description
- Module : Gates
- Description : Basic Quantum Gates
- Copyright : (c) Mihai Sebastian Ardelean, 2018
- 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 ]