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

Safe HaskellNone
LanguageHaskell2010

Data.Qubit.Gate

Contents

Description

Gates for qubit wavefunctions, mostly as in Quil <https://arxiv.org/abs/1608.03355/> and using the conventions of <https://arxiv.org/abs/1711.02086/>.

Synopsis

One-Cubit Gates

i Source #

Arguments

:: QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The identity gate. This corresponds to I in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

x Source #

Arguments

:: QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The Pauli-x gate. This corresponds to X in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

y Source #

Arguments

:: QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The Pauli-y gate. This corresponds to Y in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

z Source #

Arguments

:: QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The Pauli-z gate. This corresponds to Z in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

h Source #

Arguments

:: QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The Hadamard gate. This corresponds to H in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

s Source #

Arguments

:: QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The one-qubit 90-degree phase-shift gate. This corresponds to S in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

t Source #

Arguments

:: QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The one-qubit 45-degree phase-shift gate. This corresponds to T in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

Parameterized One-Cubit Gates

phase Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The phase-shift gate. This corresponds to PHASE in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

rx Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The x-rotation gate. This corresponds to RX in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

ry Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The y-rotation gate. This corresponds to RY in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

rz Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the qubit in the wavefunction.

-> Operator

The operator.

The z-rotation gate. This corresponds to RZ in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

Two-Cubit Gates

cnot Source #

Arguments

:: QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

The controlled-not gate for two qubits. This corresponds to CNOT in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

swap Source #

Arguments

:: QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

The swap gate with 0-degree phase. This corresponds to SWAP in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

iswap Source #

Arguments

:: QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

The swap gate with 90-degree phase. This corresponds to ISWAP in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

Parameterized Two-Cubit Gates

cphase00 Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

A controlled phase gate on |00>. This corresponds to CPHASE00 in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

cphase01 Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

A controlled phase gate on |01>. This corresponds to CPHASE01 in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

cphase10 Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

A conrolled pahse gate on |10>. This corresponds to CPHASE10 in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

cphase Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

A controlled phase gate on |11>. This corresponds to CPHASE in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

pswap Source #

Arguments

:: Double

The phase angle [radians].

-> QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

The phase-swap gate. This corresponds to PSWAP in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

cz Source #

Arguments

:: QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

The controlled-z gate, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

Three-Cubit Gates

ccnot Source #

Arguments

:: QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the middle qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

The controlled-not gate by three qubits. This corresponds to CCNOT in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.

cswap Source #

Arguments

:: QIndex

The index of the higher qubit in the wavefunction.

-> QIndex

The index of the middle qubit in the wavefunction.

-> QIndex

The index of the lower qubit in the wavefunction.

-> Operator

The operator.

The three-qubit controlled-swap gate. This corresponds to CSWAP in Quil <https://arxiv.org/abs/1608.03355/>, with the indexing convention of <https://arxiv.org/pdf/1711.02086/>.