Safe Haskell | None |
---|---|
Language | Haskell98 |
This module provides a Quipper interface to the efficient simulation of Clifford group circuits, using the Stabilizer formalism.
This module provides the internal implementation of the library, and can be imported by other libraries. The public interface to simulation is Quipper.Libraries.Simulation.
Synopsis
- stabilizer_transformer :: Transformer (StateT Tableau IO) Qubit Bool
- data ControlInfo
- = None
- | Classical Bool
- | OneQuantum (Signed Qubit) Bool
- | ManyQuantum
- control_info :: Ctrls Qubit Bool -> ControlInfo
- toCliffordCirc :: (QCData qa, QCDataPlus qb) => (qa -> Circ qb) -> BType qa -> CliffordCirc (BType qb)
- eval_unary :: (QCData qa, QCDataPlus qb) => (qa -> Circ qb) -> BType qa -> IO Tableau
- run_clifford_unary :: (QCData qa, QCDataPlus qb) => (qa -> Circ qb) -> BType qa -> IO (BType qb)
- run_clifford_generic :: (QCData qa, QCDataPlus qb, QCurry qfun qa qb, Curry qfun' (BType qa) (IO (BType qb))) => qfun -> qfun'
The stabilizer transformer
stabilizer_transformer :: Transformer (StateT Tableau IO) Qubit Bool Source #
The stabilizer transformer. Used to transform a Quipper circuit,
made up of Clifford group operators, directly into the CliffordCirc
monad (where CliffordCirc
is a type-synonym for StateT Tableau IO).
Note that this transformer only deals with 1 and 2-qubit operators.
data ControlInfo Source #
A datatype to represent controls that we can simulate
control_info :: Ctrls Qubit Bool -> ControlInfo Source #
Construct an element of ControlInfo from a list of Controls.
High-level functions
toCliffordCirc :: (QCData qa, QCDataPlus qb) => (qa -> Circ qb) -> BType qa -> CliffordCirc (BType qb) Source #
Use the stabilizer_transformer
to transform a Quipper circuit
into a CliffordCirc
, ready for simulation.
eval_unary :: (QCData qa, QCDataPlus qb) => (qa -> Circ qb) -> BType qa -> IO Tableau Source #
Return the tableau resulting from simulating the given Quipper circuit.
run_clifford_unary :: (QCData qa, QCDataPlus qb) => (qa -> Circ qb) -> BType qa -> IO (BType qb) Source #
Efficiently simulate a unary Quipper circuit that consists entirely of Clifford group operators, using the stabilizer formalism.
run_clifford_generic :: (QCData qa, QCDataPlus qb, QCurry qfun qa qb, Curry qfun' (BType qa) (IO (BType qb))) => qfun -> qfun' Source #
Efficiently simulate a Quipper circuit that consists entirely of Clifford group operators, using the stabilizer formalism.
Inputs a quantum circuit, and outputs a corresponding probabilistic
boolean function. The inputs to the quantum circuit are initialized
according to the given boolean arguments. The outputs of the
quantum circuit are measured, and the boolean measurement outcomes
are returned. Because the measurement outcomes are probabilistic,
this function takes place in the IO
monad.
The type of this heavily overloaded function is difficult to read. In more readable form, it has all of the following types (for example):
run_clifford_generic :: (QCData qa) => Circ qa -> IO (BType qa) run_clifford_generic :: (QCData qa, QCData qb) => (qa -> Circ qb) -> BType qa -> IO (BType qb) run_clifford_generic :: (QCData qa, QCData qb, QCData qc) => (qa -> qb -> Circ qc) -> BType qa -> BType qb -> IO (BType qc)
and so forth.