Documentation

LeanPool.LeanQuantumAlg.Core.Components.Oracle

Boolean (XOR) oracles #

Standard quantum-circuit access to a Boolean function f : Fin (2 ^ n) → Bool: the XOR (bit-flip) oracle on n + 1 qubits,

U_f |x⟩|b⟩ = |x⟩|b ⊕ f(x)⟩,

the unitary query form O_x : |i, b⟩ ↦ |i, b ⊕ xᵢ⟩ of [dW19, qcnotes.tex:1151].

Conventions #

Main definitions #

Pinned Mathlib API: Equiv.permCongr (permCongr_apply), Fin.rev (Fin.rev_rev), Equiv.apply_eq_iff_eq, Equiv.apply_eq_iff_eq_symm_apply, Equiv.symm_apply_eq.

def QuantumAlg.Gate.xorPerm {n : } (f : Fin (2 ^ n)Bool) :
Equiv.Perm (Fin (2 ^ n) × Fin (2 ^ 1))

The basis involution underlying the XOR oracle: (x, b) ↦ (x, b ⊕ f x), with the bit flip written as Fin.rev.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    @[simp]
    theorem QuantumAlg.Gate.xorPerm_apply {n : } (f : Fin (2 ^ n)Bool) (p : Fin (2 ^ n) × Fin (2 ^ 1)) :
    (xorPerm f) p = (p.1, if f p.1 = true then p.2.rev else p.2)
    @[simp]
    theorem QuantumAlg.Gate.xorPerm_symm {n : } (f : Fin (2 ^ n)Bool) :

    The XOR oracle is an involution.

    def QuantumAlg.Gate.xorOracle {n : } (f : Fin (2 ^ n)Bool) :
    Gate (n + 1)

    The XOR (bit-flip) oracle of f, as a permutation gate on n + 1 qubits: U_f |x⟩|b⟩ = |x⟩|b ⊕ f(x)⟩ (input register first/most significant, target qubit last/least significant).

    Equations
    Instances For
      theorem QuantumAlg.Gate.xorOracle_apply {n : } (f : Fin (2 ^ n)Bool) (ψ : PureState (n + 1)) (i : Fin (2 ^ (n + 1))) :
      theorem QuantumAlg.Gate.xorOracle_apply_ket {n : } (f : Fin (2 ^ n)Bool) (x : Fin (2 ^ n)) (b : Fin (2 ^ 1)) :

      Action on basis kets: U_f |x⟩|b⟩ = |x⟩|b ⊕ f(x)⟩.