liveBook · Manning

Out-of-place implementation

As explained in Quantum Programming in Depth

An out-of-place implementation computes a result in additional storage while preserving the input values.

An out-of-place implementation computes a result in additional storage while preserving the input values. This is useful when later calculations still need the original inputs or intermediate values. section 6.4.1

For the Boolean NOT function, the reversible out-of-place transformation is:

  • F_NOT(x, y) = (x, y ⊕ NOT x) = (x, y ⊕ x ⊕ 1). section 6.4.1
  • Apply a CNOT from the input qubit to the output qubit, then apply X to the output qubit. section 6.4.1
  • The input remains x while the target becomes y ⊕ x ⊕ 1; X and CNOT may be reversed because they commute here. section 6.4.1

How Quantum Programming in Depth covers it

How deep it goes
Derives the reversible transformation and its two-gate circuit, including equivalent gate ordering.
Examples
Uses the NOT function and the transformation F_NOT(x, y) as its concrete example.
What you can do after
Build a reversible NOT computation that writes its result to an auxiliary qubit without modifying the input.
How it connects
Connects reversible computation with Boolean functions, CNOT gates, X gates, and in-place implementation.

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.