liveBook · Manning

Logical NOT

As explained in Quantum Programming in Depth

Negation is the logical operation that changes a true value to false and a false value to true.

Logical NOT, or negation, reverses a Boolean value: true becomes false, and false becomes true. In reversible quantum computation, it is a primitive Boolean operation used to construct larger functions and to handle negated input literals. section 6.4 section 6.5

Implement negated literals in a Boolean-expression circuit by following this pattern:

  • Apply an X gate to the input qubit corresponding to the variable being negated. section 6.5.1
  • Use the transformed input while evaluating the surrounding clause, such as an OR operation. section 6.5.1
  • Apply the X gate again afterward to uncompute the temporary change and restore the input. section 6.5.1

Negated literal in conjunctive normal form

In (x₀ OR NOT x₁) AND (NOT x₀ OR x₁), temporarily invert x₁ before evaluating the first clause and x₀ before evaluating the second, then undo each inversion. section 6.5 section 6.5.1

Table 6.2 The truth tables of the main Boolean operations
\(x_0\) \(x_1\) NOT \(x_0\) \(x_0\) AND \(x_1\) \(x_0\) OR \(x_1\) \(x_0\) XOR \(x_1\) \(x_0\) EQUAL \(x_1\)
\(0\) \(0\) \(1\) \(0\) \(0\) \(0\) \(1\)
\(0\) \(1\) \(0\) \(1\) \(1\) \(0\)
\(1\) \(0\) \(0\) \(0\) \(1\) \(1\) \(0\)
\(1\) \(1\) \(1\) \(1\) \(0\) \(1\)

Use the truth table to check that NOT maps 0 to 1 and 1 to 0 before composing it with AND, OR, XOR, or equality. section 6.4

Figure 6.7 To convert a classical function into its quantum implementation, we start by representing it as a sequence of Boolean logic gates. Then, we replace each gate with its classical reversible equivalent. Finally, each classical reversible logic gate is replaced with a quantum gate that implements it.
figure

Place NOT within the reversible-logic synthesis pipeline: decompose the function, replace Boolean operations with reversible equivalents, and map the result to quantum gates. section 6.4

How Quantum Programming in Depth covers it

How deep it goes
Defines the truth-table behavior and gives a gate-level inversion and uncomputation procedure, without developing NOT beyond circuit synthesis.
Examples
Uses truth tables, negated CNF literals, clause evaluation, and temporary X-gate inversions as concrete demonstrations.
What it assumes
Assumes Boolean variables and basic AND and OR operations while reinforcing literals, clauses, and reversible computation structure.
What you can do after
Build it from scratch by translating a negated Boolean literal into an X gate and uncomputing the temporary inversion.
How it connects
Connects Boolean algebra, Boolean expressions, literals, reversible computation, quantum circuits, AND, and OR.

Also explained in

Compare how 2 books explain logical NOT →

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.