qfunc-0.1.0.0
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Lib.Internal.Gates

Description

Internal matrix operations

Synopsis

Documentation

i :: Complex Double Source #

The imaginary unit

applyParallel :: Matrix C -> Matrix C -> Matrix C Source #

applyGate :: Matrix C -> QM () Source #

Apply gate to the current quantum state

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.

parallel :: Int -> [(Matrix C, QBit)] -> Matrix C Source #

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

qftMatrix :: Int -> Matrix C Source #

Quantum fourier transform matrix

proj0 :: Matrix C Source #

Projection of the zero basis vector

proj1 :: Matrix C Source #

Projection of the one basis vector

hmat :: Matrix C Source #

Hadamard matrix

cmat :: Matrix C Source #

CNOT matrix

phasemat :: Double -> Matrix C Source #

Generic phase matrix, takes in phase change as radians

pXmat :: Matrix C Source #

PauliX matrix

pYmat :: Matrix C Source #

PauliY matrix

pZmat :: Matrix C Source #

PauliZ matrix

idmat :: Matrix C Source #

Identity matrix

Orphan instances

Show (Matrix C) Source # 
Instance details

Methods

showsPrec :: Int -> Matrix C -> ShowS #

show :: Matrix C -> String #

showList :: [Matrix C] -> ShowS #