Physlib Documentation

QuantumInfo.Finite.Qubit.Basic

Quantum theory and operations specific to qubits.

@[reducible, inline]
abbrev Qubit :
Equations
Instances For

    Proves goals equating small matrices by expanding out products and simpliying standard Real arithmetic.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The Pauli Z gate on a qubit.

      Equations
      Instances For

        The Pauli X gate on a qubit.

        Equations
        Instances For

          The Pauli Y gate on a qubit.

          Equations
          Instances For
            noncomputable def Qubit.H :

            The H gate, a Hadamard gate, on a qubit.

            Equations
            Instances For

              The S gate, or Rz(π/2) rotation on a qubit.

              Equations
              Instances For
                noncomputable def Qubit.T :

                The T gate, or Rz(π/4) rotation on a qubit.

                Equations
                Instances For
                  @[simp]
                  theorem Qubit.Z_sq :
                  Z * Z = 1
                  @[simp]
                  theorem Qubit.X_sq :
                  X * X = 1
                  @[simp]
                  theorem Qubit.Y_sq :
                  Y * Y = 1
                  @[simp]
                  theorem Qubit.H_sq :
                  H * H = 1
                  @[simp]
                  theorem Qubit.S_sq :
                  S * S = Z
                  @[simp]
                  theorem Qubit.T_sq :
                  T * T = S
                  @[simp]

                  The anticommutator {X,Y} is zero. Marked simp as to put Pauli products in a canonical Y-X-Z order.

                  The anticommutator {Y,Z} is zero.

                  The anticommutator {Z,X} is zero.

                  @[simp]
                  theorem Qubit.S_Z_comm :
                  Z * S = S * Z
                  @[simp]
                  theorem Qubit.T_Z_comm :
                  Z * T = T * Z
                  @[simp]
                  theorem Qubit.S_T_comm :
                  S * T = T * S
                  def Qubit.controllize {k : Type u_1} [Fintype k] [DecidableEq k] (g : 𝐔[k]) :

                  Given a unitary U on some Hilbert space k, we have the controllized version that acts on Fin 2 ⊗ k where U is conditionally applied if the first qubit is 1.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Controlled-NOT gate on two qubits. The first qubit is the control and the second qubit is the target.

                      Equations
                      Instances For

                        The matrix representation of CNOT is the standard 4×4 permutation matrix.

                        @[simp]
                        theorem Qubit.controllize_apply_zero_zero {k : Type u_1} [Fintype k] [DecidableEq k] (g : 𝐔[k]) (j₁ j₂ : k) :
                        (controllize g) (0, j₁) (0, j₂) = 1 j₁ j₂
                        @[simp]
                        theorem Qubit.controllize_apply_zero_one {k : Type u_1} [Fintype k] [DecidableEq k] (g : 𝐔[k]) (j₁ j₂ : k) :
                        (controllize g) (0, j₁) (1, j₂) = 0
                        @[simp]
                        theorem Qubit.controllize_apply_one_zero {k : Type u_1} [Fintype k] [DecidableEq k] (g : 𝐔[k]) (j₁ j₂ : k) :
                        (controllize g) (1, j₁) (0, j₂) = 0
                        @[simp]
                        theorem Qubit.controllize_apply_one_one {k : Type u_1} [Fintype k] [DecidableEq k] (g : 𝐔[k]) (j₁ j₂ : k) :
                        (controllize g) (1, j₁) (1, j₂) = g j₁ j₂
                        @[simp]
                        theorem Qubit.controllize_mul {k : Type u_1} [Fintype k] [DecidableEq k] (g₁ g₂ : 𝐔[k]) :
                        controllize g₁ * controllize g₂ = controllize (g₁ * g₂)
                        @[simp]
                        @[simp]