I'll try to give here a crash course on how simulating quantum systems on a quantum computer works - not for the actual computer type in the article (D-Wave's quantum annealer) but on a traditional gate-based quantum computer.
So, we have this thing called the Schrodinger equation. For our purposes, all you need to know is that it's an equation which can perfectly describe the behavior of a quantum system as it evolves in time. Examples of quantum systems include a single electron sitting in a magnetic field, photons going through closely-placed slits, or entire biomolecules doing biomolecule things.
Simulating things on computers is great because of how darn easy & cheap it is compared to running the same scenario in the real world. We want to simulate quantum systems on computers. We simulate quantum systems by trying to mimic the action of the Schrodinger equation on the quantum system. However, (as Feynman famously pointed out in Simulating Physics with Computers[0]), classical computers are very bad at this. They take exponential resources to simulate a quantum system. Now, if you have a computer that obeys the same physical laws as the quantum system it's simulating - a quantum computer - we might be able to simulate the system with only linear resources.
Let's take a very simple quantum system. Consider a single electron, sitting in a magnetic field. Electrons have a property called spin which is affected by magnetic fields. Electrons can have their spin be up, down, or some superposition thereof. We want to know how the spin of the electron changes over time as it sits inside the field.
There are three steps involved in simulating this quantum system:
1. Encode the system's start state in a form understood by a quantum computer - a qbit, which is a 2-vector [a, b] of complex numbers where |a|^2 + |b|^2 = 1. We'll say the qbit [1, 0] represents spin up, and [0, 1] represents spin down. Other states [a, b] where both a and b are nonzero mean the electron spin is in superposition of up & down. Here, let's say we start in spin up - so [1, 0].
2. Compile the Schrodinger equation into a series of quantum logic gates for execution on a quantum computer. This is the real meat of the problem, more on that later.
3. Decode the end state back into the physical world. After the start state has been put through all the logic gates, we want to decode the result to the same spin state we would've had if we'd set up a real electron in a real magnetic field and let it actually evolve over time (within some acceptable error).
Pretty simple so far, right? All the magic happens in step 2 - how do we compile the Schrodinger equation into logic gates? It revolves around something called the Hamiltonian. The Hamiltonian is a component of the Schrodinger equation, and is a matrix which represents the energy of the system. That brings up a lot of questions around how exactly a matrix corresponds to the energy of a system, but it's a (fascinating!) rabbit hole we'll sadly have to avoid. Let's just look at an example.
Consider again our plucky electron in a magnetic field. Suppose the magnetic field points upward along the Z axis. This means the Schrodinger equation for our system is e^(-i H t), where e is Euler's constant, i is the square root of -1, t is a scalar variable representing time, and H is the Hamiltonian matrix - here, the 2x2 Pauli-Z matrix in column form Z = [[1, 0],[0,-1]]. How can we compile this equation into a quantum logic gate?
Turns out you can do it through basic algebraic manipulation. There are some tricky intermediate steps involving expanding e^x into the Taylor series[1] and back into trig functions[2] but at the end of the day you have:
e^(-i Z t) = cos(t) 1 - i sin(t) Z
where 1 is the 2x2 identity matrix and Z is the 2x2 Pauli-Z matrix from above. This just so happens to be a common primitive gate on a quantum computer, called the Rz(t) operator[3] which performs a rotatio...
2 comments
[ 3.2 ms ] story [ 17.9 ms ] threadSo, we have this thing called the Schrodinger equation. For our purposes, all you need to know is that it's an equation which can perfectly describe the behavior of a quantum system as it evolves in time. Examples of quantum systems include a single electron sitting in a magnetic field, photons going through closely-placed slits, or entire biomolecules doing biomolecule things.
Simulating things on computers is great because of how darn easy & cheap it is compared to running the same scenario in the real world. We want to simulate quantum systems on computers. We simulate quantum systems by trying to mimic the action of the Schrodinger equation on the quantum system. However, (as Feynman famously pointed out in Simulating Physics with Computers[0]), classical computers are very bad at this. They take exponential resources to simulate a quantum system. Now, if you have a computer that obeys the same physical laws as the quantum system it's simulating - a quantum computer - we might be able to simulate the system with only linear resources.
Let's take a very simple quantum system. Consider a single electron, sitting in a magnetic field. Electrons have a property called spin which is affected by magnetic fields. Electrons can have their spin be up, down, or some superposition thereof. We want to know how the spin of the electron changes over time as it sits inside the field.
There are three steps involved in simulating this quantum system:
1. Encode the system's start state in a form understood by a quantum computer - a qbit, which is a 2-vector [a, b] of complex numbers where |a|^2 + |b|^2 = 1. We'll say the qbit [1, 0] represents spin up, and [0, 1] represents spin down. Other states [a, b] where both a and b are nonzero mean the electron spin is in superposition of up & down. Here, let's say we start in spin up - so [1, 0].
2. Compile the Schrodinger equation into a series of quantum logic gates for execution on a quantum computer. This is the real meat of the problem, more on that later.
3. Decode the end state back into the physical world. After the start state has been put through all the logic gates, we want to decode the result to the same spin state we would've had if we'd set up a real electron in a real magnetic field and let it actually evolve over time (within some acceptable error).
Pretty simple so far, right? All the magic happens in step 2 - how do we compile the Schrodinger equation into logic gates? It revolves around something called the Hamiltonian. The Hamiltonian is a component of the Schrodinger equation, and is a matrix which represents the energy of the system. That brings up a lot of questions around how exactly a matrix corresponds to the energy of a system, but it's a (fascinating!) rabbit hole we'll sadly have to avoid. Let's just look at an example.
Consider again our plucky electron in a magnetic field. Suppose the magnetic field points upward along the Z axis. This means the Schrodinger equation for our system is e^(-i H t), where e is Euler's constant, i is the square root of -1, t is a scalar variable representing time, and H is the Hamiltonian matrix - here, the 2x2 Pauli-Z matrix in column form Z = [[1, 0],[0,-1]]. How can we compile this equation into a quantum logic gate?
Turns out you can do it through basic algebraic manipulation. There are some tricky intermediate steps involving expanding e^x into the Taylor series[1] and back into trig functions[2] but at the end of the day you have:
e^(-i Z t) = cos(t) 1 - i sin(t) Z
where 1 is the 2x2 identity matrix and Z is the 2x2 Pauli-Z matrix from above. This just so happens to be a common primitive gate on a quantum computer, called the Rz(t) operator[3] which performs a rotatio...