pygsti.tools.gatetools

Functions for creating gates

Module Contents

Functions

single_qubit_gate(hx, hy, hz, noise=0)

Construct the single-qubit operation matrix.

two_qubit_gate(ix=0, iy=0, iz=0, xi=0, xx=0, xy=0, xz=0, yi=0, yx=0, yy=0, yz=0, zi=0, zx=0, zy=0, zz=0, ii=0)

Construct the single-qubit operation matrix.

Attributes

sigmaii

sigmaix

sigmaiy

sigmaiz

sigmaxi

sigmaxx

sigmaxy

sigmaxz

sigmayi

sigmayx

sigmayy

sigmayz

sigmazi

sigmazx

sigmazy

sigmazz

pygsti.tools.gatetools.sigmaii
pygsti.tools.gatetools.sigmaix
pygsti.tools.gatetools.sigmaiy
pygsti.tools.gatetools.sigmaiz
pygsti.tools.gatetools.sigmaxi
pygsti.tools.gatetools.sigmaxx
pygsti.tools.gatetools.sigmaxy
pygsti.tools.gatetools.sigmaxz
pygsti.tools.gatetools.sigmayi
pygsti.tools.gatetools.sigmayx
pygsti.tools.gatetools.sigmayy
pygsti.tools.gatetools.sigmayz
pygsti.tools.gatetools.sigmazi
pygsti.tools.gatetools.sigmazx
pygsti.tools.gatetools.sigmazy
pygsti.tools.gatetools.sigmazz
pygsti.tools.gatetools.single_qubit_gate(hx, hy, hz, noise=0)

Construct the single-qubit operation matrix.

Build the operation matrix given by exponentiating -i * (hx*X + hy*Y + hz*Z), where X, Y, and Z are the sigma matrices. Thus, hx, hy, and hz correspond to rotation angles divided by 2. Additionally, a uniform depolarization noise can be applied to the gate.

Parameters
  • hx (float) – Coefficient of sigma-X matrix in exponent.

  • hy (float) – Coefficient of sigma-Y matrix in exponent.

  • hz (float) – Coefficient of sigma-Z matrix in exponent.

  • noise (float, optional) – The amount of uniform depolarizing noise.

Returns

numpy array – 4x4 operation matrix which operates on a 1-qubit density matrix expressed as a vector in the Pauli basis ( {I,X,Y,Z}/sqrt(2) ).

pygsti.tools.gatetools.two_qubit_gate(ix=0, iy=0, iz=0, xi=0, xx=0, xy=0, xz=0, yi=0, yx=0, yy=0, yz=0, zi=0, zx=0, zy=0, zz=0, ii=0)

Construct the single-qubit operation matrix.

Build the operation matrix given by exponentiating -i * (xx*XX + xy*XY + …) where terms in the exponent are tensor products of two Pauli matrices.

Parameters
  • ix (float, optional) – Coefficient of IX matrix in exponent.

  • iy (float, optional) – Coefficient of IY matrix in exponent.

  • iz (float, optional) – Coefficient of IZ matrix in exponent.

  • xi (float, optional) – Coefficient of XI matrix in exponent.

  • xx (float, optional) – Coefficient of XX matrix in exponent.

  • xy (float, optional) – Coefficient of XY matrix in exponent.

  • xz (float, optional) – Coefficient of XZ matrix in exponent.

  • yi (float, optional) – Coefficient of YI matrix in exponent.

  • yx (float, optional) – Coefficient of YX matrix in exponent.

  • yy (float, optional) – Coefficient of YY matrix in exponent.

  • yz (float, optional) – Coefficient of YZ matrix in exponent.

  • zi (float, optional) – Coefficient of ZI matrix in exponent.

  • zx (float, optional) – Coefficient of ZX matrix in exponent.

  • zy (float, optional) – Coefficient of ZY matrix in exponent.

  • zz (float, optional) – Coefficient of ZZ matrix in exponent.

  • ii (float, optional) – Coefficient of II matrix in exponent.

Returns

numpy array – 16x16 operation matrix which operates on a 2-qubit density matrix expressed as a vector in the Pauli-Product basis.