qchas-1.1.0.0: A library for implementing Quantum Algorithms

Safe HaskellNone
LanguageHaskell2010

Quantum.Qubits

Description

  • Module : Qubits
  • Description : Definitions of |0>, |1>, |+> and |->
  • Copyright : (c) Mihai Sebastian Ardelean, 2018
  • License : BSD3
  • Maintainer : ardeleanasm@gmail.com
  • Portability : POSIX

Synopsis

Documentation

newtype Qubit Source #

Constructors

Qubit 

Fields

Instances

Eq Qubit Source # 

Methods

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

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

Show Qubit Source # 

Methods

showsPrec :: Int -> Qubit -> ShowS #

show :: Qubit -> String #

showList :: [Qubit] -> ShowS #

QubitOperations Qubit Source #

QubitOperations instance for Qubit

MeasurementPerformer Qubit Source #

MeasurementPerformer instance for Qubit

Methods

measure :: Qubit -> Qubit Source #

qZero :: Qubit Source #

  • qZero function is used to represent a 0 qubit |0>
>>> qZero
(2><1)
[ 1.0 :+ 0.0
, 0.0 :+ 0.0 ]

qOne :: Qubit Source #

  • qOne function is used to represent a 1 qubit |1>
>>> qOne
(2><1)
[ 0.0 :+ 0.0
, 1.0 :+ 0.0 ]

qPlus :: Qubit Source #

  • qPlus function is used to represent a + qubit |+>
  • |+> can be also obtained by applying Hadamard Gate on |0>. See apply for more information
>>> qPlus
(2><1)
[ 0.7071067811865475 :+ 0.0
, 0.7071067811865475 :+ 0.0 ]

qMinus :: Qubit Source #

  • qMinus function is used to represent a - qubit |->
  • Same as |+>, qubit |-> can be obtained by applying Hadamard Gate on |1>. See apply for more information
>>> qMinus
(2><1)
[       0.7071067811865475 :+ 0.0
, (-0.7071067811865475) :+ (-0.0) ]