Documentation

CslibFrontier.Computability.Complexity.Classes.QMA.NP

NP ⊆ QMA #

Every problem in NP has a quantum verifier with perfect completeness and soundness 0 (Cslib.Complexity.PromiseNP_subset_PromiseQMA), so NP ⊆ QMA (Cslib.Complexity.NP_subset_QMA); Watrous, Section V.2, calls this containment trivial.

The verifier (Cslib.Quantum.UniformVerifierFamily.ofNP) is built from a uniform family F of circuits that computes the NP relation on the words frame x ++ w, the pair encoding of an instance and a certificate (Cslib.Complexity.exists_uniformCircuitFamily). On an input x of length n and a witness of p(n) qubits, classical gates write frame x ++ z on a fresh block of qubits for each basis witness z (Cslib.Quantum.NPVerifier.frameCodes), F runs on that block, and three CNOT gates swap its answer into qubit 0. The circuit is classical outside F, so on a basis witness |z⟩ it accepts exactly as F does on frame x ++ z (Cslib.Quantum.UniformVerifierFamily.acceptProb_ofNP_ket). A yes-instance has a certificate accepted with certainty; on a no-instance every basis witness is rejected with certainty, and then so is every witness state (Cslib.Quantum.UniformVerifierFamily.acceptProb_eq_zero_of_forall_ket).

Main definitions #

Main results #

References #

theorem Cslib.Quantum.measureProb_prep_shift_swap {N w o : ℕ} {pre gs : List GateCode} (hpre : GateCode.IsClassical N pre) (hgs : ∀ g ∈ gs, GateCode.WellFormed w g) (ho : 0 < o) (hw : 0 < w) (h : o + w ≤ N) (X : Fin N → Bool) :

The circuit gs on the block o, …, o + w - 1 after classical codes pre, followed by a swap of the block's first qubit into qubit 0, accepts as gs does on the block's contents after pre.

The verifier of an NP relation #

Classical codes writing frame x ++ z on the block of qubits from o on, for an input x of length n on qubits 0, …, n - 1 and a basis witness z of length p on qubits n, …, n + p - 1: NOT gates set the frame's markers, and CNOT gates copy the bits.

theorem Cslib.Quantum.NPVerifier.mem_frameCodes {n p o : ℕ} {g : GateCode} :
g ∈ frameCodes n p o ↔ (∃ i < n, g = (false, o + 2 * i, []) ∨ g = (false, o + 2 * i + 1, [i])) ∨ ∃ j < p, g = (false, o + 2 * n + 1 + j, [n + j])
theorem Cslib.Quantum.NPVerifier.nodup_frameCodes (n p o : ℕ) :
(List.map (fun (g : GateCode) => g.2.1) (frameCodes n p o)).Nodup
theorem Cslib.Quantum.NPVerifier.isClassical_frameCodes {n p o M : ℕ} (h : o + 2 * n + 1 + p ≤ M) (ho : n + p ≤ o) :
theorem Cslib.Quantum.NPVerifier.readBit_classicalRun_frameCodes {n p o M : ℕ} (h : o + 2 * n + 1 + p ≤ M) (ho : n + p ≤ o) {x : List Bool} (hx : x.length = n) (z : Fin p → Bool) (k : ℕ) :

The classical codes write frame x ++ z on the block from o on.

The register of the verifier for inputs of length n: the input, the witness, one spare qubit, and the register of F for words of length 2 n + 1 + p(n).

The verifier's circuit: write frame x ++ z on the block from n + p(n) + 1 on, run F there, and swap the block's first qubit into qubit 0.

The quantum verifier of an NP relation: for a uniform family F of circuits on the words frame x ++ w (the pair encoding of (x, w)), the verifier reads a witness of p(|x|) qubits, writes frame x ++ z for each basis witness z and runs F.

On a basis witness |z⟩, the verifier of an NP relation accepts as F does on frame x ++ z.

The NP verifier's circuit, run on the word x ++ w for a proof w of the right length, accepts as F does on frame x ++ w.

theorem Cslib.Complexity.PromiseNP_subset_PromiseQMA {α : Type} {enc : α ↪ List Bool} :
PromiseNP enc ⊆ PromiseQMA (fun (x : ℕ) => 1) (fun (x : ℕ) => 0) enc

PromiseNP ⊆ QMA(1, 0): the verifier of an NP relation, run on a witness state, accepts a basis state certificate with certainty, and when no certificate exists it accepts no witness state.

theorem Cslib.Complexity.NP_subset_QMA {α : Type} {enc : α ↪ List Bool} :
NP enc ⊆ QMA enc

NP ⊆ QMA Watrous, Section V.2.