liveBook · Manning

Boolean clause

As explained in Quantum Programming in Depth

A Boolean clause is a component of a Boolean formula formed by a disjunction of literals.

A Boolean clause is an OR of several literals, where each literal is a Boolean variable or its negation. A single literal also forms a clause. section 6.5

Clauses provide the components of a conjunctive normal form (CNF): evaluate each clause with OR, then combine the clause results with AND. section 6.5 section 6.5.1

CNF with two clauses

(x₀ OR x₁) AND (NOT x₀ OR NOT x₁) contains the clauses (x₀ OR x₁) and (NOT x₀ OR NOT x₁). The expression is equivalent to x₀ XOR x₁, although CNF offers a universal representation for Boolean expressions. section 6.5

Use clauses as reversible-computation components by:

  • Allocating one auxiliary qubit per clause to hold its OR result. section 6.5.1
  • Computing the AND of the auxiliary results into the output qubit. section 6.5.1
  • Cleaning up the auxiliary qubits before releasing them, because superposition can entangle them with the inputs and output. section 6.5.1
Table 6.3 The steps of the Bennett’s trick
Step Input Auxiliary qubits Auxiliary output Final output
Initialize \(\ket{x}\) \(\ket{0}\) \(\ket{0}\) \(\ket{y}\)
\(\ket{x}\) \(\ket{\text{aux}}\) \(\ket{f(x)}\) \(\ket{y}\)
\(\ket{x}\) \(\ket{\text{aux}}\) \(\ket{f(x)}\) \(\ket{y \oplus f(x)}\)
\(\ket{x}\) \(\ket{0}\) \(\ket{0}\) \(\ket{y \oplus f(x)}\)

Use the Bennett-trick table to follow auxiliary-qubit initialization, computation, output formation, and uncomputation. section 6.5.1

How Quantum Programming in Depth covers it

How deep it goes
Defines clauses formally and traces their reversible evaluation through auxiliary qubits, but stops short of specifying individual gates.
Examples
Uses single-literal clauses, two-literal OR clauses, and a two-clause CNF equivalent to XOR.
What it assumes
Defines literals, clauses, and CNF from zero while assuming familiarity with Boolean variables and quantum computation.
What you can do after
Build and evaluate CNF expressions reversibly while managing temporary auxiliary qubits.
How it connects
Connects literals, Boolean formulas, conjunctive normal form, OR, AND, reversible computation, auxiliary qubits, and superposition.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quantum Programming in Depth. The section links point to the parts of the book it draws on.