Quantum Computing Explained: Qubits, Grover’s & Shor’s Algorithms
Quantum computers process certain kinds of information far faster than conventional computers by using qubits, which hold many combinations of values simultaneously instead of one value at a time. Grover’s algorithm demonstrates this by locating a target among 16 basis states in four steps, and Shor’s algorithm factors large numbers fast enough to threaten standard encryption, though a computer large enough to do so does not yet exist.
Table of Contents
Key Takeaways
- A conventional coin, once initialized, measures HEADS with probability 1|HEADS> and TAILS with probability 0|TAILS>, while a spinning coin measures each outcome with probability 1/2.
- Three coins in combination have eight possible measurement outcomes, and 100 coins have 2^100 possible outcomes, approximately 1,000,000,000,000,000,000,000,000,000,000.
- Grover’s algorithm, demonstrated here on a 16-state search using four qubits, drives the probability of one basis state (|duuu>) to 1 after four generations of updates, guaranteeing that basis state is measured.
- Shor’s algorithm, created by Peter Shor in 1994, factors large numbers much faster on a quantum computer than on a conventional one.
- RSA and Diffie-Hellman encryption rely on the difficulty of factoring a six-hundred-digit number (2048 bits), a task that would take classical supercomputers trillions of years.
- A quantum computer with 6,000 error-corrected qubits would be able to factor a six-hundred-digit number in under an hour, according to the discussion presented here.
What Is Quantum Computing?
Quantum computing is a technology that processes certain types of information much faster than conventional computers. Major companies including Google, Microsoft, IBM, and Intel are investing heavily in its development because of its potential to solve problems that are currently infeasible for classical machines, such as designing efficient carbon capture methods to address climate change.
Quantum computing draws on the principles of quantum mechanics to manipulate large amounts of information rapidly, with potential applications in cryptography, optimization, and environmental science. Practical, large-scale quantum computers are still in development, and research continues to expand what is possible with the technology.
Conventional Computers vs. Quantum Computers
Conventional computers, from desktop machines to supercomputers, all process information using the same underlying approach; a supercomputer is simply much faster and more expensive than smaller machines. Quantum computers, built by companies such as IBM, Google, and Microsoft, process information differently, using quantum binary digits, or qubits, rather than conventional bits.


Why Is Quantum Computing Needed?
Conventional machines cannot complete certain computational tasks within any practical amount of time. Creating an efficient way to remove carbon from the atmosphere is one potential Earth-changing application for quantum computers.

How Do Coins Illustrate Quantum Information?
Single Coin
A coin can be “measured” by stopping it from spinning and observing it, or simply by looking at it while it is not spinning. If the coin is first placed into an initialized state that always results in HEADS when measured, there is a 100% probability of measuring HEADS and a 0% probability of measuring TAILS. These probabilities are written alongside the resulting coin states as follows:
- 100/100|HEADS> or 1|HEADS>
- 0/100|TAILS> or 0|TAILS>
Spinning Coin
When the coin is spun instead, measuring it results in either HEADS or TAILS with equal probability. The two pieces of information associated with the spinning coin are 50/100|HEADS> (or 1/2|HEADS>) and 50/100|TAILS> (or 1/2|TAILS>). Repeated spins and measurements converge toward a 50% HEADS, 50% TAILS split as more trials are tabulated.
Three Coins
Three coins considered in combination have eight possible measurement outcomes, not six, because each outcome reflects a specific arrangement of all three coins together. These eight states are:
- |HEADS HEADS HEADS>
- |HEADS HEADS TAILS>
- |HEADS TAILS HEADS>
- |HEADS TAILS TAILS>
- |TAILS HEADS HEADS>
- |TAILS HEADS TAILS>
- |TAILS TAILS HEADS>
- |TAILS TAILS TAILS>
Initialized Three-Coin State
When three coins are placed into their initialized state, all three will measure HEADS. The eight probabilities for this initialized state are:
- 1|HEADS HEADS HEADS> (all three coins always measure HEADS)
- 0|HEADS HEADS TAILS>
- 0|HEADS TAILS HEADS>
- 0|HEADS TAILS TAILS>
- 0|TAILS HEADS HEADS>
- 0|TAILS HEADS TAILS>
- 0|TAILS TAILS HEADS>
- 0|TAILS TAILS TAILS>
Equal-Probability State
When the three coins are set spinning, all eight possible states have equal probability of one-out-of-eight:
- 1/8|HEADS HEADS HEADS>
- 1/8|HEADS HEADS TAILS>
- 1/8|HEADS TAILS HEADS>
- 1/8|HEADS TAILS TAILS>
- 1/8|TAILS HEADS HEADS>
- 1/8|TAILS HEADS TAILS>
- 1/8|TAILS TAILS HEADS>
- 1/8|TAILS TAILS TAILS>
Scaling to 100 Coins
The number of pieces of information for any given number of coins equals 2 raised to the power of the number of coins, meaning the number 2 is multiplied by itself once for each coin. For 100 coins, the number of pieces of information is 2^100, which equals approximately 1,000,000,000,000,000,000,000,000,000,000, or one-million-trillion-trillion pieces of information.
What Are Quantum Binary Digits (Qubits)?
Quantum computers use quantum binary digits, or qubits, as their basic units of information.
Qubit Control and Measurement
Qubits are “zapped” by the user to modify their states and are then measured, with each measurement revealing one of two possible values. Zapping and measuring certain types of qubits involves exposing them to precise amounts of microwave electromagnetic radiation. The images below show a quantum computer being programmed and an oscilloscope display showing the microwave waveforms used to zap the qubits.

How Do Qubits Encode Information?
Basis States and Probabilities
Like a coin, a qubit yields one of two values when measured, and combinations of qubits carry probabilities for each possible combination of measured values, with each possible combination called a basis state. Unlike coins, the probabilities associated with each basis state in a quantum computer are progressively modified by the user until measurement reveals a meaningful answer.
Zapping a single qubit, or even multiple qubits, takes approximately one microsecond. For small quantum computers this is currently faster than modifying comparable information on a conventional supercomputer, though as larger numbers of qubits become available, multiplexing and demultiplexing of the zapping waveforms will likely be needed. By contrast, a conventional supercomputer can take a long time to modify a comparable amount of probability information, as the following table illustrates.
![]() |
What Is Grover’s Algorithm?
Example: Searching 16 States
Grover’s algorithm is a quantum search algorithm. In this example, it searches through 16 envelopes, treated as basis states, where fifteen envelopes each contain a worthless small green piece of paper and one envelope contains a one-thousand-dollar bill.
The algorithm works by successively zapping four qubits so that the probability associated with one of the sixteen possible basis states becomes much larger than the other fifteen, with the highest-probability basis state corresponding to the envelope containing the prize. The two possible measured states for each qubit are written as |u> and |d>, so the sixteen basis states range from |uuuu> through |dddd>.
The table referenced below shows how the sixteen basis states of the four qubits change from the initialized state, through the equal-probability state, and then through four generations of basis state probability updates. By Generation 4, the probability for one basis state reaches 1, meaning every pass through the algorithm followed by measurement of the four qubits will yield the |duuu> basis state, identifying the envelope containing the money.

What Is Shor’s Algorithm?
Cryptography Implications
Shor’s algorithm, created by physicist Peter Shor in 1994, factors large numbers much faster on a quantum computer than on a conventional computer. Since its creation, it has raised awareness of the potential of quantum computing to disrupt cryptography.
The one-digit number 6 is easy to factor into its two prime factors, and the two-digit number 15 is also simple to factor. The three-digit number 143 might take a fourth-grade student a couple of minutes to factor into 11 and 13, but a number with six hundred digits is effectively impossible for classical supercomputers to factor, since it would take them trillions of years to find the two factors.
The RSA and Diffie-Hellman encryption schemes that secure internet transactions rely on the difficulty of factoring a six-hundred-digit number (2048 bits). A quantum computer with 6,000 error-corrected qubits would be able to factor such a number in less than an hour, though we remain many years away from having a quantum computer large enough to threaten online data security, and quantum encryption schemes under development are intended to keep data safe ahead of that threat.
Frequently Asked Questions
What is a qubit?
A qubit, or quantum binary digit, is the basic unit of information in a quantum computer. Unlike a conventional bit, a qubit can be zapped by the user to modify its state, and measuring it reveals one of two possible values, similar to how measuring a spinning coin reveals either heads or tails.
Why do companies invest in quantum computing?
Companies including Google, Microsoft, IBM, and Intel invest heavily in quantum computing because it has the potential to solve problems that are currently infeasible for classical computers, such as designing efficient methods for carbon capture to help address climate change.
How much information can qubits represent compared to coins?
The number of pieces of information scales as 2 raised to the number of coins or qubits. For 100 coins, this equals 2^100, approximately 1,000,000,000,000,000,000,000,000,000,000 pieces of information, illustrating how quickly the amount of representable information grows.
What does Grover’s algorithm demonstrate?
In the example given, Grover’s algorithm searches 16 basis states (envelopes) by successively zapping four qubits until the probability of one basis state, |duuu>, reaches 1 after four generations of updates, guaranteeing that state is measured as the answer.
Could Shor’s algorithm break current encryption?
Shor’s algorithm, created by Peter Shor in 1994, can factor large numbers quickly on a quantum computer, threatening RSA and Diffie-Hellman encryption, which rely on factoring six-hundred-digit (2048-bit) numbers. A computer with 6,000 error-corrected qubits could do this in under an hour, but such a computer does not yet exist, and we remain many years away from this threat.
Glossary
- Qubit: a quantum binary digit, the basic unit of information in a quantum computer, which can be zapped to modify its state and measured to reveal one of two values.
- Basis state: a possible combination of measured values for a set of qubits, each carrying its own probability.
- Grover’s algorithm: a quantum search algorithm that increases the probability of one target basis state among many through successive rounds of qubit manipulation.
- Shor’s algorithm: a quantum algorithm created by Peter Shor in 1994 that factors large numbers much faster than classical methods, with implications for RSA and Diffie-Hellman encryption.
- Exaflop: a unit of computing speed equal to 10^18 floating point operations per second.
Other Resources
A video discussing carbon capture (at 3 minutes 50 seconds) is available here: Carbon capture discussion video.
The specific implementation of Grover’s algorithm used for the table values is shown in Figure 1d of the following paper: Nature Communications article on Grover’s algorithm implementation.
- The Sounds of IBM (IBM)
- Inside the Google Quantum AI Campus (Google)
- The Map of Quantum Computing (Domain of Science)
- Educational Background: Undergrad
- Degree in: Electrical and Electronic Engineering











”
”
I have updated the PDF (now rev 4) with a few clarifications and corrections. Also, a table of contents has been added.
“Quantum computation and quantum Information” by Nielsen e Chuang.
Ssnow
I love the challenge to learn offered by this thread. Thank you [USER=89234]@Bob Walance[/USER] .
I’m working my way carefully through Quantum Algorithm Implementations for Beginners linked in #2. I
I’m stuck on the notation in equation 11, page 18:5. I presume that the summation is for all possible values of X2 and X3, but I don’t see how the notation says that.
[ATTACH type=”full”]304332[/ATTACH]
Here’s the direct publisher’s link to the book mentioned in #1. It’s open access!
[URL]https://rd.springer.com/book/10.1007/978-3-030-61601-4[/URL]
The Insight is live at [URL]https://www.physicsforums.com/insights/quantum-computing-for-beginners/[/URL]