Safe Haskell | None |
---|---|
Language | Haskell2010 |
- Module : Operations.QuantumOperations
- Description : Quantum Operations
- Copyright : (c) Mihai Sebastian Ardelean, 2018
- License : BSD3
- Maintainer : ardeleanasm@gmail.com
- Portability : POSIX
- class QubitOperations a where
- class GateOperations a where
Documentation
class QubitOperations a where Source #
Class QubitOperations used to define common operations that can be made with Qubit
entangle :: a -> a -> a Source #
- entangle function is used to perform the Kronecker product between two qubits.
>>>
entangle qZero qOne
(4><1) [ 0.0 :+ 0.0 , 1.0 :+ 0.0 , 0.0 :+ 0.0 , 0.0 :+ 0.0 ]
(|>) :: a -> Gate -> a Source #
- |> function is used to apply a gate on a qubit
>>>
qZero |> hGate
(2><1) [ 0.7071067811865475 :+ 0.0 , 0.7071067811865475 :+ 0.0 ]
(|><|) :: a -> a -> Gate Source #
- |><| function represents the outer product.
>>>
qZero |><| qZero
(2><2) [ 1.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0 ]
(*) :: a -> Complex Double -> a Source #
- mul function is used to multiply the states with a constant.
>>>
qZero * 5
(2><1) [ 5.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0 ]
QubitOperations Qubit Source # | QubitOperations instance for |
class GateOperations a where Source #
Class GateOperations used to define common operations that can be made with Gate
- Kronecker product operator is used to create gates that can be used on multiple qubits
>>>
hGate <*> hGate
(4><4) [ 0.4999999999999999 :+ 0.0, 0.4999999999999999 :+ 0.0, 0.4999999999999999 :+ 0.0, 0.4999999999999999 :+ 0.0 , 0.4999999999999999 :+ 0.0, (-0.4999999999999999) :+ 0.0, 0.4999999999999999 :+ 0.0, (-0.4999999999999999) :+ 0.0 , 0.4999999999999999 :+ 0.0, 0.4999999999999999 :+ 0.0, (-0.4999999999999999) :+ 0.0, (-0.4999999999999999) :+ 0.0 , 0.4999999999999999 :+ 0.0, (-0.4999999999999999) :+ 0.0, (-0.4999999999999999) :+ 0.0, 0.4999999999999999 :+ 0.0 ]}
GateOperations Gate Source # | GateOperations instance for |