2 Preparing quantum states

 

This chapter covers

  • Using quantum gates to change quantum states
  • Using Q# and Qiskit to write quantum programs
  • Running and testing quantum programs using simulators
  • Watching the state of a quantum program during its execution

Quantum algorithms revolve around manipulating the states of quantum systems. Figure 2.1 shows the flow typical for many quantum algorithms. The algorithm starts with preparing the quantum system in a certain superposition state and then applies a sequence of transformations to it before performing a measurement to extract the results. The goal of the algorithm is to lead the system to a superposition state in which the basis states that are answers to the problem being solved have large amplitudes, and all the other basis states have much smaller amplitudes. This allows the final measurement to yield the answer to the problem with high probability.

2.1 Preparing a single-qubit state

2.1.1 Math

2.1.2 Qiskit

2.1.3 Q#

2.2 What does your solution do?

2.2.1 Qiskit

2.2.2 Q#

2.3 Preparing a two-qubit state

2.3.1 Refresher: Controlled gates in Dirac notation

2.3.2 Math

2.3.3 Qiskit

2.3.4 Q#

2.4 Testing your solution

2.4.1 Qiskit

2.4.2 Q#

2.5 Preparing a multiqubit state