Skip to content

Commit

Permalink
Fix documentation of qiskit.circuit.classicalfunction (#9337) (#10921)
Browse files Browse the repository at this point in the history
* Fix documentation of qiskit.circuit.classicalfunction

* right order

(cherry picked from commit f0c2ade)

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
  • Loading branch information
mergify[bot] and 1ucian0 authored Oct 2, 2023
1 parent 21ab6b4 commit 5026735
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions qiskit/circuit/classicalfunction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
========
The classical function compiler provides the necessary tools to map a classical
irreversible functions into quantum circuits. Below is a simple example of
potentially irreversible functions into quantum circuits. Below is a simple example of
how to synthesize a simple boolean function defined using Python into a
QuantumCircuit:
Expand All @@ -34,10 +34,22 @@
def grover_oracle(a: Int1, b: Int1, c: Int1, d: Int1) -> Int1:
return (not a and b and not c and d)
quantum_circuit = grover_oracle.synth()
Following Qiskit's little-endian bit ordering convention, the left-most bit (`a`) is the most
significant bit and the right-most bit (`d`) is the least significant bit. The resulting
quantum_circuit = grover_oracle.synth(registerless=False)
quantum_circuit.draw('text')
a: ──o──
b: ──■──
c: ──o──
d: ──■──
┌─┴─┐
return: ┤ X ├
└───┘
Following Qiskit's little-endian bit ordering convention, the left-most bit (``a``) is the most
significant bit and the right-most bit (``d``) is the least significant bit.
Supplementary Information
=========================
Expand Down

0 comments on commit 5026735

Please sign in to comment.