QIO-1.2: The Quantum IO Monad is a library for defining quantum computations in Haskell

Safe HaskellSafe-Infered



This module contains the definition of a Type Class that represents a Heap. In the context of QIO, a Heap is the type used to represent a classical basis state. An instance of a Heap is also defined, that makes use of a Map.



class Eq h => Heap h whereSource

The Heap Type Class


initial :: hSource

define an initial (i.e. empty) Heap

update :: h -> Qbit -> Bool -> hSource

update the value of a Qubit within the Heap to the given Boolen value

(?) :: h -> Qbit -> Maybe BoolSource

Lookup the value of the given Qubit in the Heap (if it exists)

forget :: h -> Qbit -> hSource

remove the given Qubit from the Heap

hswap :: h -> Qbit -> Qbit -> hSource

Swap the values associated with two Qubits within the Heap


Heap HeapMap

A HeapMap is an instance of the Heap type class, where the Heap functions can make use of the underlying Map functions.

type HeapMap = Map Qbit BoolSource

HeapMap is simply a type synonym for a Map from Qubits to Boolean values