Book Image

Quantum Computing Algorithms

By : Barry Burd
5 (1)
Book Image

Quantum Computing Algorithms

5 (1)
By: Barry Burd

Overview of this book

Navigate the quantum computing spectrum with this book, bridging the gap between abstract, math-heavy texts and math-avoidant beginner guides. Unlike intermediate-level books that often leave gaps in comprehension, this all-encompassing guide offers the missing links you need to truly understand the subject. Balancing intuition and rigor, this book empowers you to become a master of quantum algorithms. No longer confined to canned examples, you'll acquire the skills necessary to craft your own quantum code. Quantum Computing Algorithms is organized into four sections to build your expertise progressively. The first section lays the foundation with essential quantum concepts, ensuring that you grasp qubits, their representation, and their transformations. Moving to quantum algorithms, the second section focuses on pivotal algorithms — specifically, quantum key distribution and teleportation. The third section demonstrates the transformative power of algorithms that outpace classical computation and makes way for the fourth section, helping you to expand your horizons by exploring alternative quantum computing models. By the end of this book, quantum algorithms will cease to be mystifying as you make this knowledge your asset and enter a new era of computation, where you have the power to shape the code of reality.
Table of Contents (19 chapters)
Free Chapter
2
Part 1 Nuts and Bolts
7
Part 2 Making Qubits Work for You
10
Part 3 Quantum Computing Algorithms
14
Part 4 Beyond Gate-Based Quantum Computing

Rotating the Bloch sphere around an axis

Rotations of the Bloch sphere can move a qubit from any point on the sphere’s surface to any other point on the surface. This section will show you some of Qiskit’s most useful rotation commands.

Experimenting with rotations

Qiskit provides many functions that rotate the Bloch sphere and change a qubit’s state. For hands-on practice with some of these rotations, open a new Qiskit notebook and follow these steps:

  1. Run the following code:
    from qiskit import QuantumRegister, QuantumCircuit
    from math import pi
    reg = QuantumRegister(1)
    circuit = QuantumCircuit(reg)
    circuit.ry(pi/2, reg[0])
    display(circuit.draw('latex'))

Figure 3.18 shows you the circuit diagram that this code generates:

Figure 3.18 – Rotating by  radians about the Y-axis

Figure 3.18 – Rotating by {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><mfrac><mi mathvariant=\"normal\">&#x3C0;</mi><mn>2</mn></mfrac></mstyle></math>"} radians about the Y-axis

The circuit’s one and only qubit begins its life in the |0 state. Then, the circuit.ry(pi/2, reg[0]) statement...