| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Utils
Description
- Module : Utils
- Description : Definitions of basic mathematical operations on qubits and gates
- Copyright : (c) Mihai Sebastian Ardelean, 2017
- License : BSD3
- Maintainer : ardeleanasm@gmail.com
- Portability : POSIX
Documentation
- 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 ]
- apply function is used to apply a gate on a qubit
>>>apply hGate qZero(2><1) [ 0.7071067811865475 :+ 0.0 , 0.7071067811865475 :+ 0.0 ]
- |> function have the same effect like
apply.
>>>qZero |> hGate(2><1) [ 0.7071067811865475 :+ 0.0 , 0.7071067811865475 :+ 0.0 ]