Safe Haskell | None |
---|---|

Language | Haskell2010 |

This module defines the functions that can be used run the classical subset of QIO. That is, QIO computations that only use classical unitary operations.

- newtype UnitaryC = U {}
- uRotC :: Qbit -> Rotation -> UnitaryC
- uSwapC :: Qbit -> Qbit -> UnitaryC
- uCondC :: Qbit -> (Bool -> UnitaryC) -> UnitaryC
- uLetC :: Bool -> (Qbit -> UnitaryC) -> UnitaryC
- runUC :: U -> UnitaryC
- data StateC = StateC {}
- initialStateC :: StateC
- runQStateC :: QIO a -> State StateC a
- runC :: QIO a -> a

# Documentation

A classical unitary operation is defined as a function that will update the current classical state.

uRotC :: Qbit -> Rotation -> UnitaryC Source #

A single qubit rotation can be converted into the classical unitary type, if it is indeed classical (otherwise an error is thrown).

uSwapC :: Qbit -> Qbit -> UnitaryC Source #

A swap operation can be defined in the classical unitary type.

uCondC :: Qbit -> (Bool -> UnitaryC) -> UnitaryC Source #

A conditional operation can be defined in the classical unitary type.

uLetC :: Bool -> (Qbit -> UnitaryC) -> UnitaryC Source #

A let operation can be defined in the classical unitary type.

runUC :: U -> UnitaryC Source #

A unitary can be run by converting it into the classical unitary type.

A classical state consists of the next free qubit reference, along with a Heap that represents the overall state of the current qubits in scope.

initialStateC :: StateC Source #

An initial state is defined as an empty heap, with 0 set as the next free qubit referece