Documentation

LeanPool.LeanQuantumAlg.Core.Components.Gates

Named gates #

The standard named gates as Components (concrete instances built on the Core gate framework LeanPool.LeanQuantumAlg.Gate). Raw matrices are first stated as HilbertOperators, then bundled into Gates with their unitarity proofs.

Pauli, Hadamard, and CNOT #

Raw Hadamard operator H = (1/sqrt 2) [[1, 1], [1, -1]].

Equations
Instances For

    The Pauli-X (NOT) gate, as the basis permutation |0> ↔ |1>.

    Equations
    Instances For

      Raw Pauli-Y operator [[0, -i], [i, 0]].

      Equations
      Instances For

        Raw Pauli-Z operator [[1, 0], [0, -1]].

        Equations
        Instances For

          The controlled-NOT gate on two qubits, control = qubit 0.

          Equations
          Instances For

            CNOT permutes the basis by swapping |10> ↔ |11> (indices 2 ↔ 3).

            H * H = 1: the Hadamard gate is an involution.

            CNOT on the tensor basis #

            Rotation gates (QSP / QNN conventions) #

            noncomputable def QuantumAlg.rotZOp (phi : ) :

            Raw processing rotation e^{i phi Z}.

            Equations
            Instances For
              noncomputable def QuantumAlg.rotZ (phi : ) :

              The processing rotation e^{i phi Z}.

              Equations
              Instances For
                theorem QuantumAlg.rotZ_mul_rotZ (a b : ) :
                rotZ a * rotZ b = rotZ (a + b)
                @[simp]
                theorem QuantumAlg.rotZ_comm (a b : ) :
                rotZ a * rotZ b = rotZ b * rotZ a
                theorem QuantumAlg.rotZ_neg_mul_rotZ (phi : ) :
                rotZ (-phi) * rotZ phi = 1
                theorem QuantumAlg.rotZ_mul_rotZ_neg (phi : ) :
                rotZ phi * rotZ (-phi) = 1
                noncomputable def QuantumAlg.rotYOp (theta : ) :

                Raw standard R_Y(theta).

                Equations
                Instances For
                  noncomputable def QuantumAlg.rotY (theta : ) :

                  The standard R_Y(theta) gate.

                  Equations
                  Instances For
                    noncomputable def QuantumAlg.rotZStd (phi : ) :

                    The standard R_Z(phi) = e^{-i phi Z/2}.

                    Equations
                    Instances For