haquil-0.2.1.5: A Haskell implementation of the Quil instruction set for quantum computing.

Safe HaskellNone
LanguageHaskell2010

Language.Quil.Execute

Contents

Description

Executing Quil programs.

Synopsis

Execution

runProgram Source #

Arguments

:: RandomGen g 
=> Int

The number of qubits.

-> [BitData]

The classical bits.

-> [Instruction]

The instructions

-> Rand g Machine

Action for the resulting state of the machine.

Run a program, starting from the ground state and using the global random number generator.

runProgramWithStdGen Source #

Arguments

:: StdGen

The random number generator.

-> Int

The number of qubits.

-> [BitData]

The classical bits.

-> [Instruction]

The instructions

-> Machine

The resulting state of the machine.

Create an action to run a program, starting from the ground state.

runProgramWithStdRandom Source #

Arguments

:: Int

The number of qubits.

-> [BitData]

The classical bits.

-> [Instruction]

The instructions

-> IO Machine

Action for the resulting state of the machine.

Run a program, starting from the ground state and using a particular random-number generator.

executeInstructions Source #

Arguments

:: RandomGen g 
=> [Instruction]

The instructions

-> Machine

The state of the machine.

-> Rand g Machine

Action for the resulting state of the machine.

Execute a series of instructions.

executeInstruction Source #

Arguments

:: RandomGen g 
=> Instruction

The instruction.

-> Machine

The state of the machine.

-> Rand g Machine

Action for the resulting state of the machine.

Execute an instruction.

Compilation

compileGate Source #

Arguments

:: Parameters

The formal parameters.

-> [Expression]

The expressions for the matrix elements.

-> [QBit]

Which qubits to operate on.

-> Arguments

The argument.

-> Operator

The resulting operator.

Compile a gate.

compileExpression Source #

Arguments

:: Parameters

The formal parameters.

-> Expression

The expression.

-> Arguments

The argument.

-> Number

The result.

Compile an expression.