| Stability | experimental |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
Lib.QM
Description
Definition of the quantum monad (QM) and helper functions
Synopsis
- data QM a
- run :: QM a -> IO a
- runDebug :: QM a -> IO a
- eval :: QM a -> IO (a, QState)
- put :: QState -> QM ()
- get :: QM QState
- modify :: (QState -> QState) -> QM ()
- io :: IO a -> QM a
- newtype QState = QState {
- state :: Vector C
- type Ix = Int
- newtype QBit = Ptr {}
- checkState :: QM ()
- getState :: QM (QState, Int)
- stateSize :: QState -> Ix
The Quantum Monad
The Quantum Monad Keeps a state of the complex vector representation while allowing pseudo-random number generation
runDebug :: QM a -> IO a Source #
Run quantum program, prints the final quantum state and returns the result
Quantum State representation
The program state, a complex vector representation of the qubits in the system
QBit
Pointer to a qubit in QState. Represents the linking function in QLambda
Helpers
checkState :: QM () Source #
Print the quantum state during operation