# pyquil.simulation.matrices module¶

Standard gate set, as detailed in Quil whitepaper (arXiV:1608:03355v2)

Currently includes:

I - identity $$\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$$

X - Pauli-X $$\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$

Y - Pauli-Y $$\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}$$

Z - Pauli-Z $$\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$

H - Hadamard $$\frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$$

S - PHASE(pi/2) $$\begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}$$

T - PHASE(pi/4) $$\begin{pmatrix} 1 & 0 \\ 0 & e^{i \pi / 4} \end{pmatrix}$$

PHASE($$\phi$$) - PHASE $$\begin{pmatrix} 1 & 0 \\ 0 & e^{i \phi} \end{pmatrix}$$

RX($$\phi$$) - RX $$\begin{pmatrix} \cos(\phi / 2) & -i \sin(\phi/2) \\ -i \sin(\phi/2) & \cos(\phi/2) \end{pmatrix}$$

RY($$\phi$$) - RY $$\begin{pmatrix} \cos(\phi / 2) & -\sin(\phi / 2) \\ \sin(\phi/2) & \cos(\phi/2) \end{pmatrix}$$

RZ($$\phi$$) - RZ $$\begin{pmatrix} \cos(\phi/2) - i \sin(\phi/2) & 0 \\ 0 & \cos(\phi/2) + i \sin(\phi/2) \end{pmatrix}$$

CZ - controlled-Z $$P_0 \otimes I + P_1 \otimes Z = \begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&1&0 \\ 0&0&0&-1 \end{pmatrix}$$

CNOT - controlled-X / controlled-NOT $$P_0 \otimes I + P_1 \otimes X = \begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&0&1 \\ 0&0&1&0 \end{pmatrix}$$

CCNOT - double-controlled-X $$P_0 \otimes P_0 \otimes I + P_0 \otimes P_1 \otimes I + P_1 \otimes P_0 \otimes I + P_1 \otimes P_1 \otimes X$$

CPHASE00($$\phi$$) - controlled-phase-on-|00> $$\text{diag}(e^{i \phi}, 1, 1, 1,)$$

CPHASE01($$\phi$$) - controlled-phase-on-|01> $$\text{diag}(1, e^{i \phi}, 1, 1,)$$

CPHASE10($$\phi$$) - controlled-phase-on-|10> $$\text{diag}(1, 1, e^{i \phi}, 1)$$

CPHASE($$\phi$$) - controlled-phase-on-|11> $$\text{diag}(1, 1, 1, e^{i \phi})$$

SWAP - swap $$\begin{pmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0 \\ 0&0&0&1 \end{pmatrix}$$

CSWAP - controlled-swap $$P_0 \otimes I_2 + P_1 \otimes \text{SWAP}$$

ISWAP - i-phase-swap $$\begin{pmatrix} 1&0&0&0 \\ 0&0&i&0 \\ 0&i&0&0 \\ 0&0&0&1 \end{pmatrix}$$

PSWAP($$\phi$$) - phi-phase-swap $$\begin{pmatrix} 1&0&0&0 \\ 0&0&e^{i\phi}&0 \\ 0&e^{i\phi}&0&0 \\ 0&0&0&1 \end{pmatrix}$$

XY($$\phi$$) - XY-interaction $$\begin{pmatrix} 1&0&0&0 \\ 0&\cos(\phi/2)&i\sin(\phi/2)&0 \\ 0&i\sin(\phi/2)&\cos(\phi/2)&0 \\ 0&0&0&1 \end{pmatrix}$$

Specialized gates / internal utility gates:

BARENCO($$\alpha, \phi, \theta$$) - Barenco gate $$\begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&e^{i\phi} \cos\theta & -i e^{i(\alpha-\phi)} \sin\theta \\ 0&0&-i e^{i(\alpha+\phi)} \sin\theta & e^{i\alpha} \cos\theta \end{pmatrix}$$

P0 - project-onto-zero $$\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$$

P1 - project-onto-one $$\begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}$$

pyquil.simulation.matrices.BARENCO(alpha: float, phi: float, theta: float) numpy.ndarray[source]
pyquil.simulation.matrices.CPHASE(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.CPHASE00(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.CPHASE01(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.CPHASE10(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.PHASE(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.PSWAP(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.RX(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.RY(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.RZ(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.SIC3 = array([ 0.57735027+0.j        , -0.40824829+0.70710678j])

The symmetric informationally complete POVMs for a qubit.

These can reduce the number of experiments to perform quantum process tomography. For more information, please see http://info.phys.unm.edu/~caves/reports/infopovm.pdf

pyquil.simulation.matrices.XY(phi: float) numpy.ndarray[source]
pyquil.simulation.matrices.bit_flip_operators(p: float) Tuple[numpy.ndarray, numpy.ndarray][source]

Return the phase flip kraus operators

pyquil.simulation.matrices.bitphase_flip_operators(p: float) Tuple[numpy.ndarray, numpy.ndarray][source]

Return the bitphase flip kraus operators

pyquil.simulation.matrices.dephasing_operators(p: float) Tuple[numpy.ndarray, numpy.ndarray][source]

Return the phase damping Kraus operators

pyquil.simulation.matrices.depolarizing_operators(p: float) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray][source]

Return the phase damping Kraus operators

pyquil.simulation.matrices.phase_flip_operators(p: float) Tuple[numpy.ndarray, numpy.ndarray][source]

Return the phase flip kraus operators

pyquil.simulation.matrices.relaxation_operators(p: float) Tuple[numpy.ndarray, numpy.ndarray][source]

Return the amplitude damping Kraus operators