haquil

A Haskell implementation of the Quil instruction set for quantum computing. https://bitbucket.org/functionally/haquil

Latest on Hackage:0.2.1.14

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

MIT licensed and maintained by Brian W Bush

quil: An instruction set for quantum computing

This Haskell library implements the Quil language for quantum computing, as specified in “A Practical Quantum Instruction Set Architecture” <https://arxiv.org/abs/1608.03355/>, using the indexing conventions in <https://arxiv.org/abs/1711.02086/>.

Please report issues at <https://bwbush.atlassian.net/projects/HQUIL/issues/>.

Example

This example creates a wavefunction for the Bell state and then performs a measurement on its highest qubit.

> import Control.Monad.Random (evalRandIO)
> import Data.Qubit ((^^*), groundState, measure)
> import Data.Qubit.Gate (h, cnot)

> -- Construct the Bell state.
> let bell = [h 0, cnot 0 1] ^^* groundState 2
> bell
0.7071067811865475|00> + 0.7071067811865475|11> @ [1,0]

> -- Measure the Bell wavefunction.
> bell' <- evalRandIO $ measure [1] bell
> bell'
([(1,0)],1.0|00> @ [1,0])

> -- Measure it again.
> evalRandIO $ measure [1] bell'
([(1,0)],1.0|00> @ [1,0])

> -- Measure another Bell wavefunction.
> evalRandIO $ measure [1] bell
([(1,0)],1.0|00> @ [1,0])

> -- Measure another Bell wavefunction.
> evalRandIO $ measure [1] bell
([(1,1)],1.0|11> @ [1,0])

Changes

Revision history for quil

0.2.1.14 – 2018-03-04

  • execution of Quil programs
  • additional test cases

0.2.0.0 – 2017-12-19

  • added types for Quil

0.1.7.5 – 2017-12-19

  • added example usage

0.1.7.3 – 2017-12-18

  • added measurement

0.1.5.0 – 2017-12-17

  • tested two- and three-qubit gates

0.1.4.0 – 2017-12-16

  • renamed product operators
  • tested one-qubit gates

0.1.3.0 – 2017-12-16

  • added Quil gates

0.1.2.0 – 2017-12-16

  • added qubit types and operations

0.1.0.0 – 2017-12-15

  • skeleton
comments powered byDisqus