| Stability | experimental |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
Lib.Internal.Gates
Contents
Description
Internal matrix operations
Synopsis
- i :: Complex Double
- applyParallel :: Matrix C -> Matrix C -> Matrix C
- applyGate :: Matrix C -> QM ()
- changeAt :: a -> Int -> [a] -> [a]
- runGate :: Matrix C -> QBit -> QM QBit
- parallel :: Int -> [(Matrix C, QBit)] -> Matrix C
- controlMatrix :: Int -> QBit -> QBit -> Matrix C -> Matrix C
- ccontrolMatrix :: Int -> QBit -> QBit -> QBit -> Matrix C -> Matrix C
- qftMatrix :: Int -> Matrix C
- notAdjacent :: [Ix] -> Bool
- proj0 :: Matrix C
- proj1 :: Matrix C
- hmat :: Matrix C
- cmat :: Matrix C
- phasemat :: Double -> Matrix C
- pXmat :: Matrix C
- pYmat :: Matrix C
- pZmat :: Matrix C
- idmat :: Matrix C
Documentation
applyParallel :: Matrix C -> Matrix C -> Matrix C Source #
changeAt :: a -> Int -> [a] -> [a] Source #
Changes an element at an index in a list. index 0 will change the first element.
runGate :: Matrix C -> QBit -> QM QBit Source #
Apply a 2x2 gate, to a specific qubit.
It will update the qstate.
controlMatrix :: Int -> QBit -> QBit -> Matrix C -> Matrix C Source #
Produce matrix running a gate controlled by another bit
ccontrolMatrix :: Int -> QBit -> QBit -> QBit -> Matrix C -> Matrix C Source #
Produce a matrix running a gate controlled by two other bits
notAdjacent :: [Ix] -> Bool Source #