The haquil package

[ Tags: language, library, mit ] [ Propose Tags ]

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/>.


[Skip to Readme]

Properties

Versions 0.1.7.5
Change log ChangeLog.md
Dependencies base (==4.9.*), hTensor, MonadRandom, vector [details]
License MIT
Copyright (c) 2017-18 Brian W Bush
Author Brian W Bush <code@functionally.io>
Maintainer Brian W Bush <code@functionally.io>
Category Language
Home page https://bitbucket.org/functionally/haquil
Bug tracker https://bwbush.atlassian.net/projects/HQUIL/issues/
Source repository head: git clone https://bitbucket.org/functionally/haquil
Uploaded Tue Dec 19 17:04:39 UTC 2017 by BrianBush
Distributions NixOS:0.1.7.5
Downloads 111 total (81 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2017-12-22 [all 6 reports]
Hackage Matrix CI

Modules

  • Data
    • Data.Qubit
      • Data.Qubit.Gate

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for haquil-0.1.7.5

[back to package description]

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