Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Quantum Computing with Python and IBM Quantum Experience

You're reading from   Learn Quantum Computing with Python and IBM Quantum Experience A hands-on introduction to quantum computing and writing your own quantum programs with Python

Arrow left icon
Product type Paperback
Published in Sep 2020
Publisher Packt
ISBN-13 9781838981006
Length 510 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Robert Loredo Robert Loredo
Author Profile Icon Robert Loredo
Robert Loredo
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Section 1: Tour of the IBM Quantum Experience (QX)
2. Chapter 1: Exploring the IBM Quantum Experience FREE CHAPTER 3. Chapter 2: Circuit Composer – Creating a Quantum Circuit 4. Chapter 3: Creating Quantum Circuits using Quantum Lab Notebooks 5. Section 2: Basics of Quantum Computing
6. Chapter 4: Understanding Basic Quantum Computing Principles 7. Chapter 5: Understanding the Quantum Bit (Qubit) 8. Chapter 6: Understanding Quantum Logic Gates 9. Section 3: Algorithms, Noise, and Other Strange Things in Quantum World
10. Chapter 7: Introducing Qiskit and its Elements 11. Chapter 8: Programming with Qiskit Terra 12. Chapter 9: Monitoring and Optimizing Quantum Circuits 13. Chapter 10: Executing Circuits Using Qiskit Aer 14. Chapter 11: Mitigating Quantum Errors Using Ignis 15. Chapter 12: Learning about Qiskit Aqua 16. Chapter 13: Understanding Quantum Algorithms 17. Chapter 14: Applying Quantum Algorithms 18. Assessments 19. Other Books You May Enjoy Appendix A: Resources

Executing quantum circuits with custom noise models

We'll create our standard circuit out of a Hadamard and CNOT circuit, which, as we know from earlier, will result in equal probabilities of 00 and 11. Let's now run it with our noise model and see what results we get and compare them:

# Create a simple 2 qubit circuit
qc_error = QuantumCircuit(2,2)
# Place in superposition and entangle
qc_error.h(0)
qc_error.cx(0,1)
# Measure the qubits to the classical bits.
qc_error.measure(range(2), range(2))

Now that we have our circuit created, we'll add our custom noise model.

Adding custom noise models to our circuits

We'll begin by obtaining the Qasm simulator, calling the execute method and including the usual arguments, namely, circuit, backend, and the number of shots. We'll also include the noise model information. Similar to how we included a thermal relaxation noise model earlier, we will provide the noise model basis_gates, and noise_model. This...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image