Documentation

LeanPool.LeanQuantumAlg.Algorithms.Simon

Simon's problem #

Simon's problem gives oracle access to a function on bit strings with an unknown nonzero mask s: two inputs have the same oracle value exactly when they are equal or differ by s [dW19, qcnotes.tex:1407, 1409-1410].

This module formalizes the problem at the standard post-sampling abstraction boundary. A run of Simon's quantum circuit yields a vector y satisfying the linear equation y ยท s = 0 over ๐”ฝโ‚‚ [dW19, qcnotes.tex:1459-1460]. Once the collected equations cut the solution set down to {0, s}, any nonzero candidate satisfying all of them is the hidden mask [dW19, qcnotes.tex:1460].

Main results #

@[reducible, inline]

The two-element field used for Simon bit strings.

Equations
Instances For
    @[reducible, inline]

    An n-bit vector, represented as a vector space over ๐”ฝโ‚‚.

    Equations
    Instances For
      @[reducible, inline]
      abbrev QuantumAlg.Simon.Oracle (n : โ„•) (ฮฑ : Type u) :

      A Simon oracle maps bit vectors to arbitrary classical values. The promise, not the codomain representation, carries the algorithmic content.

      Equations
      Instances For

        Dot product over ๐”ฝโ‚‚.

        Equations
        Instances For

          Two bit vectors are orthogonal when their ๐”ฝโ‚‚ dot product vanishes.

          Equations
          Instances For

            The two-element fiber relation induced by a Simon mask: x and y are equal modulo the hidden period s.

            Equations
            Instances For
              structure QuantumAlg.Simon.Promise {n : โ„•} {ฮฑ : Type u} (f : Oracle n ฮฑ) (s : BitVec n) :

              The explicit Simon promise: s is nonzero, and oracle fibers are exactly pairs of equal inputs or inputs separated by s.

              Instances For

                A sampled Simon equation says that the sampled vector is orthogonal to a candidate mask.

                Equations
                Instances For

                  A candidate mask satisfies every collected linear equation.

                  Equations
                  Instances For

                    The collected equations are complete when their common solution set is exactly {0, s}. This is the linear-algebraic post-processing condition implemented by Gaussian elimination over ๐”ฝโ‚‚.

                    Equations
                    Instances For
                      def QuantumAlg.Simon.Candidate {n : โ„•} (samples : Finset (BitVec n)) (t : BitVec n) :

                      A nonzero candidate returned by the classical post-processing step.

                      Equations
                      Instances For

                        Trusted representative resource profile for the public Simon statement: expected linear oracle samples, quadratic Hadamard gates, and cubic classical linear algebra over ZMod 2.

                        Equations
                        Instances For
                          @[simp]
                          theorem QuantumAlg.Simon.dot_zero_left {n : โ„•} (x : BitVec n) :
                          dot 0 x = 0
                          @[simp]
                          theorem QuantumAlg.Simon.dot_zero_right {n : โ„•} (x : BitVec n) :
                          dot x 0 = 0
                          theorem QuantumAlg.Simon.dot_comm {n : โ„•} (x y : BitVec n) :
                          dot x y = dot y x

                          The ๐”ฝโ‚‚ dot product is symmetric.

                          theorem QuantumAlg.Simon.dot_add_right {n : โ„•} (x y z : BitVec n) :
                          dot x (y + z) = dot x y + dot x z

                          Right additivity of the ๐”ฝโ‚‚ dot product.

                          theorem QuantumAlg.Simon.dot_add_left {n : โ„•} (x y z : BitVec n) :
                          dot (x + y) z = dot x z + dot y z

                          Left additivity of the ๐”ฝโ‚‚ dot product.

                          The zero vector satisfies every collected Simon equation.

                          theorem QuantumAlg.Simon.satisfiesEquations_add {n : โ„•} {samples : Finset (BitVec n)} {a b : BitVec n} (ha : SatisfiesEquations samples a) (hb : SatisfiesEquations samples b) :
                          SatisfiesEquations samples (a + b)

                          Sums of solutions to the collected equations are again solutions; the solution set is a linear subspace over ๐”ฝโ‚‚.

                          theorem QuantumAlg.Simon.hiddenMask_satisfiesEquations {n : โ„•} {samples : Finset (BitVec n)} {s : BitVec n} (hcomplete : CompleteEquations samples s) :

                          If the equations are complete, the unknown nonzero string itself satisfies all of them.

                          theorem QuantumAlg.Simon.recover_from_complete_equations {n : โ„•} {samples : Finset (BitVec n)} {s t : BitVec n} (hcomplete : CompleteEquations samples s) (hcandidate : Candidate samples t) :
                          t = s

                          Complete Simon equations identify the unknown nonzero string among nonzero candidates.

                          theorem QuantumAlg.Simon.promise_mask_unique {n : โ„•} {ฮฑ : Type u} {f : Oracle n ฮฑ} {s t : BitVec n} (hs : Promise f s) (ht : Promise f t) :
                          s = t

                          The Simon promise determines a unique nonzero mask for an oracle.

                          theorem QuantumAlg.SimonsProblem.main {n : โ„•} {ฮฑ : Type u} {f : Simon.Oracle n ฮฑ} {s t : Simon.BitVec n} {samples : Finset (Simon.BitVec n)} (hpromise : Simon.Promise f s) (hcomplete : Simon.CompleteEquations samples s) (hcandidate : Simon.Candidate samples t) :

                          Simon correctness: assume an oracle satisfies Simon's promise with hidden nonzero mask s. If the sampled ๐”ฝโ‚‚-linear equations are complete and classical post-processing returns a nonzero candidate satisfying all of those equations, then that candidate is exactly the hidden nonzero mask.

                          theorem QuantumAlg.SimonsProblem.main_with_resources {n : โ„•} {ฮฑ : Type u} {f : Simon.Oracle n ฮฑ} {s t : Simon.BitVec n} {samples : Finset (Simon.BitVec n)} (hpromise : Simon.Promise f s) (hcomplete : Simon.CompleteEquations samples s) (hcandidate : Simon.Candidate samples t) :

                          Simon supporting theorem for the public statement at the current post-sampling boundary: complete sampled equations recover the unknown nonzero string, and the trusted public resource profile records the accepted expected costs.