Safe Haskell | Safe-Infered |
---|

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 -> UnitaryCSource

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 -> UnitaryCSource

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

uCondC :: Qbit -> (Bool -> UnitaryC) -> UnitaryCSource

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

uLetC :: Bool -> (Qbit -> UnitaryC) -> UnitaryCSource

A let operation can be defined in 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.

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