Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Quantum.QProgram
Description
Synopsis
- runQProg :: QProgram -> Machine -> IO Machine
- makeQuantumState :: Int -> State
- data Machine = Machine {}
- data QInstruction = QInstruction {
- gateMatrix :: Gate
- affectedQubits :: [Int]
- data QProgram = QProgram {
- instructions :: [QInstruction]
Documentation
runQProg :: QProgram -> Machine -> IO Machine Source #
- runQProg function executes the program's instruction.
makeQuantumState :: Int -> State Source #
- makeQuantumState function initializes a quantum state of
n
qubits
A Machine
is defined by the quantum state and the measurement register.
It has two fields:
* qstate
of type State
* measurementRegister
of type Int
Constructors
Machine | |
Fields
|
data QInstruction Source #
A QInstruction
is defined by the unitary transformation and by the
qubits' index on which the transformation is applied.
It has two fields:
* gateMatrix
of type Gate
is the unitary matrix that defines the quantum gate.
* affectedQubits
of type `[Int]`
Constructors
QInstruction | |
Fields
|
Instances
Show QInstruction Source # | |
Defined in Quantum.QProgram Methods showsPrec :: Int -> QInstruction -> ShowS # show :: QInstruction -> String # showList :: [QInstruction] -> ShowS # | |
Eq QInstruction Source # | |
Defined in Quantum.QProgram |
A QProgram
is defined by the list quantum instructions:
* instructions
is of type `[QInstruction]`
Constructors
QProgram | |
Fields
|