2 Prepare 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.

Figure 2.1 Any quantum algorithm can be broken down into several steps: prepare the initial state, evolve it following the algorithm, and measure the end state to get the result. The goal of many algorithms is to end up in a state in which the result of the final measurement is a correct answer with high probability. (Each block of eight bars represents the eight amplitudes of the basis states in a three-qubit quantum state.)
figure

2.1 Prepare 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 Prepare 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 Test your solution

 
 

2.4.1 Qiskit

 
 

2.4.2 Q#

 
 
 
 

2.5 Prepare a multi-qubit state

 
 
 

2.5.1 Math

 
 

2.5.2 Qiskit

 
 

2.5.3 Q#

 
 

2.6 Further reading

 
 

2.7 Going beyond

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage