haquil: A Haskell implementation of the Quil instruction set for quantum computing.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

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

Versions0.1.7.5, 0.1.7.5, 0.2.1.5, 0.2.1.14
Change logChangeLog.md
Dependenciesbase (==4.9.*), hTensor, MonadRandom, vector [details]
LicenseMIT
Copyright(c) 2017-18 Brian W Bush
AuthorBrian W Bush <code@functionally.io>
MaintainerBrian W Bush <code@functionally.io>
CategoryLanguage
Home pagehttps://bitbucket.org/functionally/haquil
Bug trackerhttps://bwbush.atlassian.net/projects/HQUIL/issues/
Source repositoryhead: git clone https://bitbucket.org/functionally/haquil
UploadedTue Dec 19 17:03:14 UTC 2017 by BrianBush

Modules

Downloads

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