qchas-1.1.0.1: A library for implementing Quantum Algorithms

Safe HaskellNone
LanguageHaskell2010

Quantum.Gates

Description

  • Module : Gates
  • Description : Basic Quantum Gates
  • Copyright : (c) Mihai Sebastian Ardelean, 2018
  • License : BSD3
  • Maintainer : ardeleanasm@gmail.com
  • Portability : POSIX
Synopsis

Documentation

xGate :: Gate Source #

  • 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 :: Gate Source #

  • 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 :: Gate Source #

  • 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 :: Gate Source #

  • 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 :: Gate Source #

  • 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 :: Gate Source #

  • 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 :: Gate Source #

  • 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 ]

newtype Gate Source #

Constructors

Gate 

Fields

Instances
Eq Gate Source # 
Instance details

Defined in Quantum.Gates

Methods

(==) :: Gate -> Gate -> Bool #

(/=) :: Gate -> Gate -> Bool #

Show Gate Source # 
Instance details

Defined in Quantum.Gates

Methods

showsPrec :: Int -> Gate -> ShowS #

show :: Gate -> String #

showList :: [Gate] -> ShowS #

GateOperations Gate Source #

GateOperations instance for Gate

Instance details

Defined in Operations.QuantumOperations

Methods

(<*>) :: Gate -> Gate -> Gate Source #