Introduction to Transmon Qubits and Qiskit Pulses

Grishma Prasad
34 min readJun 3, 2021

IBM held a Quantum Computing Challenge from May 20th to May 27th. This year was special as it marked the 40th anniversary of the Physics of Computation Conference and also the 5th anniversary of IBM Quantum putting up a Quantum Computer on the cloud. The best thing about participating in IBM challenges is undoubtedly the galore of learning and experience that comes with it. This is my first medium blog and I couldn’t think of anything but Quantum Computing to start with. All the challenge questions can be seen here. I would like to mention that a lot of my understanding is based on Zlatko Minev’s lectures on this topic in 2020 Qiskit Global Summer School. There were many things he covered which I am yet to understand well, but those lectures are absolutely amazing. You could find them here. A lot of images in this blog have been taken from the slides presented in QGSS 2020.

Through this blog, I am attempting to explain, to the extent I have understood, some simple Physics behind Transmon qubits and then, dive into Qiskit Pulses. I would like to urge you to pitch in with comments in case some aspects could be explained better and I am definitely looking forward to feedback on how I could improve this blog. Challenge 4 from IBM Quantum Challenge 2021 was about Qiskit Pulses. Coincidentally, I got very interested in understanding different quantum hardware architectures about a couple of months back when IBM and many other companies published blogs on how they want users to understand and contribute to Quantum hardware. Honestly, I had never imagined I would get this interested in Quantum Physics before.

I would like to mention that specifically to do this challenge, all the details that I am going to write down in this blog, might not necessarily be required. My attempt here is to explain details that might help us get more insights on or at least get a big picture of what Superconducting (Transmon) qubits are and what Qiskit Pulses help us achieve, with codes. The blog will be theory in the beginning and then, we would have some codes. I am expecting it to be a lengthy blog, but I will try my best to make it as interesting for you as it is for me. So, let’s get started:

So far, most of us have seen quantum circuits at a very high level. With Qiskit, we build circuits using pre-defined gates like Pauli gates (X, Y, Z), rotations (rx, ry, rz), Hadamard gate for a single qubit and controlled rotations for 2 or more qubits, for eg: CNOT, CU, Toffoli (which you also saw in Challenge 1). Simply speaking, Qiskit pulses helps us do these operations at the level of this fancy looking device below, through an interface:

I will be covering some minor details about this device, but for now, what I mean is that though some properties are intrinsic to the materials and components being used in this fridge, what essentially a user does with Qiskit Pulses is, to control what happens in the wires in the fridge. You could think of it as you being given access to some control knobs and you decide how to move those knobs based on what signals you want to pass through those wires. So if you want to rotate a qubit by some angle, you would want to pass a signal with certain attributes (frequency, amplitude, duration) so that the qubit actually rotates by that angle. Qubits don’t really exist. We are building a system where we can mimic quantum behavior and a qubit. So at the hardware level, we will soon be seeing what it actually means to rotate a qubit on a Bloch sphere, but for that, we would have to get into some Physics. I am attempting to explain with not much prior knowledge of Physics. Perhaps, some Physics you might have learnt in your high school would help, but it is not required.

Building Intuition for Quantum Systems and Quantum Harmonic Oscillator

Let’s deviate from the device for now. Have you heard about a Simple Harmonic Oscillator or Simple Harmonic Motion? If you studied Physics in high school, you might have come across it. Even if you haven’t, it doesn’t matter and you could still continue reading. Oscillator, as most of us might have understood, is just something that oscillates. The most famous example of a simple harmonic motion can be seen in the gif below, a mass tied to a spring moving back and forth. Why is it called simple harmonic? It is simple because we are not considering any external forces that usually come into picture, for eg: friction of the surface. If friction acted, you might have guessed that the movement of the spring would eventually get restricted and stop after a point. Typically, some external force like you or I would pull the string to an end and release it, after which the oscillations begin.

Simple Harmonic Oscillator (Spring experiment)

You might be wondering why we are talking about Simple Harmonic Oscillator. The idea is to build our intuition for something called Quantum Harmonic Oscillator. Let’s understand the Simple Harmonic Oscillator.

Spring experiment (Potential Energy)

Ep in the image above is called Potential Energy. You can think of Potential Energy as an energy that an object contains due to its position and arrangement. A simple example is a ball held up in the air, the higher its level from the ground, the greater the potential energy (PE). Another important type of energy is Kinetic Energy (KE) that an object possesses due to its motion. In the equation describing PE of the system in the image above, k is a spring constant (we don’t need to dive deeper into that. In Science, there are many constants. Mostly, scientists came up with these constants through experiments). The equation should remind you of a famous curve in Mathematics. If you guessed Parabola, you are right. The relation between PE and displacement x of the object tied to the spring from its natural position (called equilibrium) forms a parabola. You could plot PE for different values of x and you should be getting a curve like below. One point to note in the above image is the direction of the Force (F) and displacement (x). The force acts in the opposite direction to x since the object naturally resists displacement from the equilibrium or natural position, this is a common phenomenon you might have observed in the nature.

Relation between Displacement and P.E

The above image is giving an impression that the energy of the system is changing with displacement. Well, the PE changes, but we also discussed KE above. This brings me to a very important law in Physics called the Conservation of Energy according to which the total energy of an isolated system remains conserved. In reality, there are many types of energies including and apart from PE and KE associated to a system, but in our example of the spring and object system, we can consider PE and KE to be the only ones. So, Total Energy in our system = PE + KE. What this means is that energy of a system can neither be created, nor destroyed. It can only be transformed from one type to the other. So in our experiment, PE is highest at maximum possible displacement from the equilibrium and at such a displacement, the KE is nearly 0, but as the spring rushes to bring back the object to equilibrium, KE increases and KE is maximum at the equilibrium position, whereas PE is close to 0. Again, why am I discussing all this? This is important to understand a very important concept when we discuss about Quantum Systems, called the Hamiltonian operator. The Hamiltonian keeps coming up in Quantum Mechanics and even in Quantum Computing. You will see that it is a very important concept even in Challenge 5. Simply speaking, Hamiltonian is the total energy of the system, but we will discuss more about it later in this blog.

Total Energy is conserved (Classical system, Spring)

Quantum Systems and Quantum Harmonic Oscillator

Now, let’s finally discuss about Quantum systems. One thing to note is that many things are simpler to understand in Quantum Mechanics when we can think of analogies in Classical Physics and that’s the reason, we started with a Simple Harmonic Oscillator.

When we talk about Quantum Systems, we are talking about systems consisting of objects like atoms and subatomic particles (electrons, protons etc.). You might have heard about atoms and subatomic particles in high school if you studied Physics and Chemistry then. Atoms are considered the smallest units of any matter. Subatomic particles, as the name suggests, are constituents of an atom. Electrons are negatively charged and protons are positively charged. Charge is a fundamental physical property of atom and matter. You can think of it as a property because of which nature exists, the way it exists. The design of an atom (its structure, its constituents like electrons, protons) enables it to react with other atoms in the most stable way, forming molecules which form matter and literally everything in the nature.

These atoms and subatomic particles oscillate and their motion is called Quantum Harmonic motion. How is Quantum Harmonic Motion different from Simple Harmonic motion? It turns out that the Potential Energy (PE) of the quantum system relates to something called Magnetic flux (I will be coming to this) in the same way as PE of our spring-object system relates to displacement. That relationship is plotted as a Parabola, but there is one major difference. Energy in Quantum Systems is Quantized! Let me explain this.

When scientists wanted to understand atoms, they decided to conduct an experiment called Atomic emission of light. They filled up a tube with hydrogen atoms and excited them and as is the case with everything in nature, the atoms wanted to return to their lower and stable states. So they started emitting energy in the form of another quantum particle called Photon. Since energy is always conserved, a photon would carry as much energy as the difference between the excited state and lower energy state of the atom (the experiment was carried out in such a way that there were minimal external factors interfering with the setup). Photon is also defined as a quantum of light and so, its energy is a function of its frequency (think of it as frequency of waves). The scientists passed the photons emitted from the tube through lens and prisms, and found that photons of only specific frequencies are getting emitted(as there were distinct colors of light after passing them through the prism). This made them realize that the atoms can only take a few specific discrete states of energies. This is what we mean when we say energy is Quantized.

I had earlier mentioned about the analogy between simple harmonic oscillator and quantum harmonic oscillator in terms of the parabolic plot. Here is what the corresponding relation between P.E and magnetic flux (will come to this soon) looks like:

Quantum Harmonic Oscillator (atoms) energy landscape

There are a couple of interesting points to note here. We see waves at each energy state and each state is written in what we know very well as the braket notation of quantum states. In terms of 0 and 1, |3> would mean |11>. Every quantum state is a wave function.|0> state can be thought of as a discrete wave with only two possible positions (0 and 1) with amplitude of 1 at 0, but no amplitude at 1, which means there is 100% chance of finding the atom at 0. The best way to describe a quantum state is by considering it as a Probability Distribution and waves help us to do it because all we need to do to know probability at a point is by squaring the amplitudes of the wave (so the valid states would only be those for which we get valid probabilities). Actually, the waves at each state in the image above can be explained best by the famous Schrodinger’s Equation. This equation simply tells how the wave function of a state evolves with time and the evolution is dependent on the Hamiltonian operator (H).

Schrodinger’s Equation

Another quick point to note is the ‘classically forbidden region’. What does that even mean? Remember that in the spring experiment, we could have a maximum displacement, which means it was not practically possible to stretch the spring beyond that maximum displacement. Strangely and surprisingly, it is possible to go beyond this classically defined maximum displacement in case of quantum objects. That’s the reason you see the wave functions extending beyond the borders of the parabola.

Another point to note is that the Quantum Harmonic oscillator has its subsequent energy levels or states at equal distances, pictorially like below. The three red arrows are equal in length.

Transmon Qubits

Now, I think we know enough to get into details of the design of Transmon Qubits. When we say qubits, we essentially want quantum analogs of bits which take only 0 and 1 as values. What this means is that we somehow need to ensure that our atom or any quantum particle we are dealing with remains within |0> to |1> energy states. Theoretically, what do you think we need to do to achieve this or what do we change in the above image of the quantum harmonic oscillator to do this? An answer could be that we bring some non-linearity and by non-linearity I mean that the energy states do not look equidistant like how they look in the image above. This non-linearity is called ‘Anharmonicity’. We will get into details around this soon, but before that, I would like to mention some things about the energy states and the Hamiltonian. Schrodinger’s Equation is sometimes also written as:

This should remind you of something in Linear Algebra. Remember, if for a matrix A, we can write A|x> = b|x> where b is some complex number and A and |x> can contain complex numbers, then |x> is considered an eigenstate of A and b is the corresponding eigenvalue. So, in the equation above, Hamiltonian H is a matrix (remember, it is an operator that means total energy of the system),Ψ is an eigenstate of H and E (energy value) is the corresponding eigenvalue of H. So, all the energy states we have been showing in the images above are eigenstates of the Hamiltonian of the quantum system we are dealing with.

A quick note about operators in general: Every operator in quantum mechanics basically relates to something we want to measure about a quantum system and the measurement is with respect to the orthonormal basis comprising of eigenstates of the operator. For example, we can have a position operator, a momentum operator and so on. In case of Hamiltonian, it is the total energy and more importantly, its split into P.E and K.E. What we have been seeing so far in the images above, are plots of P.E with respect to magnetic flux (soon to be covered)in case of Quantum systems. The concept of measurement might seem a little confusing here because so far, when we dealt with quantum circuits at a high level, we have been thinking of measurements in terms of |0> and |1> for every qubit, and you might be wondering that the eigenstates of every operator need not necessarily be |0> and |1>. The fact is that technically, measurements can be done with respect to any orthonormal basis. In Quantum Computing, we usually convert this measurement with respect to Z-basis (|0> and |1>, which are eigenstates of Pauli Z matrix) because practically, we want to see our outputs in terms of 0s and 1s only, but I think it’s worth noting that every operation that we view as some rotation about the Bloch sphere, is also same as measuring something with respect to an operator.

Coming back to ‘Anharmonicity’, we discussed that we would like a setup where the energy states are not equidistant. This is facilitated by something called ‘Josephson Junction’. Adding Josephson junction would result in the same eigenstates or energy states as the Harmonic Quantum oscillator, but with different energy values or eigenvalues as compared to the harmonic counterpart. In terms of the energy diagram, we want something like below:

How would above ensure we stay within |0> and |1>. The lighter red arrow is equal in length to the darker red arrow, but its tip is not at any energy state. Since there are discrete energy states, there is no other option, but for the quantum system to fall back to the state it was being excited in (in this case |1>). The only way to reach any energy state is to have the arrow more or less exactly reach the energy state. Note that even though the lighter red arrow seems to cross |2>, the system would fall back to |1> because that’s where it is excited from in this example.

We will discuss more about this soon, but let’s get back to our fancy looking quantum computer. Now, we will dive a little deeper into its components.

The Quantum chip, chips placed at the bottom.

You see, the quantum chips are actually placed at the bottom of this fridge. One thing to note is that when we discussed about the atomic emission of light, the photons had extremely low frequencies and to deal with such low energy levels, we need to place this chip in an extremely low temperature with as less external forces (noise) possible. The chip also has readout resonators for the purpose of measurements of the quantum circuits. Both, the qubit and readout are constructed in a very similar way, except the qubit has a ‘Josephson Junction’. I will come to the classical electronic circuit design and the corresponding qubit design soon, but let’s also discuss some other things about the fridge that would also be helpful when we work with Qiskit Pulses. Somewhere, in the middle of the fridge, there are many types of wires or channels connected to different parts of the chip. Pulses are passed through some of these channels to perform the operations we want on the qubits. So, with qiskit pulses, we would be deciding what kind of pulses we should be passing to design an operation that we intend to do. Below is how we describe different wires or channels in Qiskit Pulses:

Now, let’s dive deeper into the design of a transmon qubit. Consider a simple circuit like below, you might have seen this in high school. The Physics and circuits going forward might seem a little intimidating, but if you observe, it is not that complicated:

The capacitor is a component that ensures steady flow of current even when the power is turned off. Since it ensures flow of current, capacitor’s energy is analogous to KE in the spring-object setup. The inductor is a component that resists a change in current, much like how the spring resists getting stretched. The way a inductor works is that it resists current initially. While some current still passes through it, a magnetic field (I will briefly mention what magnetic field is, later) develops around it (Fact: With current flowing through a wire, magnetic field is created perpendicular to the flow of current). Eventually, the resistance reduces and the magnetic field keeps getting stronger. When the power is turned off, the inductor resists that as well. As a response, it would convert magnetic field into electric current and pass that to the device we want to light up. Inductor behaves much like the spring at the maximum displacement from equilibrium and so, its energy is analogous to the PE of the spring object setup. On the quantum chip, the above setup looks like below.

The two silver metal plates in the above image form a capacitor. The small yellow link between them is the inductor. In case of a qubit, that inductor is replaced by a ‘Josephson Junction’. You can think of a Josephson junction (J) as an inductor with a special property that its resistance decreases at a much slower rate as compared to a normal inductor, as the current passing through it increases. This causes the non-linearity or Anharmonicity. Q refers to net charge on a plate (+ or -). With the josephson junction, the image of the simple classical circuit we considered, would look like below. Note that the normal inductor is replaced by Josephson junction J. L and E are inductance and energy of J, C is the capacitance. All components are made of superconducting material.

a classical circuit analogous to a single transmon qubit

I had earlier mentioned that the readout resonator is build similar to a qubit, except that it has normal inductor unlike the qubit which has a josephson junction. With respect to classical circuits, this set up would look like below:

Classical circuit representation: Transmon qubit (left circuit in pink) coupled with readout resonator (right circuit in green) with a capacitor

You can think of above in terms of the image of the transmon qubit. The readout resonator would look similar, except the small yellow link would be a normal inductor for it. The readout resonator and qubit are coupled with two metallic pads representing the capacitor. Similarly, qubits are also coupled and the corresponding classical circuit would look like below:

Classical circuit representation: Two transmon qubits coupled with a capacitor

We will now dive deeper into the Hamiltonian of a single transmon qubit. As usual, the classical circuits will help us get an idea and intuition of the qubit Hamiltonian.

Before going further, we have come across something called Magnetic flux and Magnetic field before. I think this is the right time to mention what these mean. Around a magnet, a magnetic field is just the region in which the magnetic force of attraction and repulsion are felt. Typically, the intensity of the magnetic force is expressed in terms of imaginary magnetic field lines. Magnetic flux is just the number of magnetic field lines passing through the magnetic field. In our case, a magnetic field gets generated perpendicular to the inductor when charges move through the Josephson junction, like in the image below:

Magnetic Field around J in transmon qubit

Q(t) is the charge on a plate, v(t) is the voltage (an electric current or a charge passes because of a non-zero voltage), i(t) is the electric current, ϕ(t) is the magnetic flux. The following relationships in the image below will be useful to get the right expression for the energies at the capacitor and at the inductor. If you think about them, it is intuitive why these quantities are related, at least by their definitions.

Note that the dot over a quantity represents its derivative w.r.t time. It turns out that after some simple derivations using some simple laws, the Hamiltonian of the classical circuit with a normal inductor (not Josephson junction) is:

From our high school, we might remember that KE is equal to p²/2m where p is momentum and m is mass of the object. From the spring experiment, we know that PE is 1/2*k*x². This should make you realize that there is some one to one correspondence between variables in the above hamiltonian and the hamiltonian of the string-object setup.

Now it should make sense why we were plotting Potential Energy of the quantum system with respect to magnetic flux. It is exactly analogous to why we plotted PE of spring-object setup w.r.t displacement.

In the classical circuit’s Hamiltonian equation above, C and L are constants and are properties of the given conductor and inductor respectively. This means that Q (charge) and ϕ (flux) vary at a particular energy level and this, should remind you of a Circle. For different levels of energy, the locus of the classical system with varying Q and ϕ would look like below. The concentric circles represent different levels of energy. The bigger the radius, the higher the energy level

The above is as far as the classical circuit system was concerned. In a quantum system, the system also has a wave behavior resulting in a probability distribution of its position. This would result in not very defined paths like above, but something like below:

the yellow circular region showing the possible area of finding the quantum system for the specific energy state.

Now, let’s think about the same Hamiltonian that we described for the classical circuit, a little differently. We had two metal plates as components of our transmon qubit and we had charge moving between the two plates. The moving of charges is a type of operation. So, there are two operations taking place at the same time, an addition of a charge on one plate (creation operator, a†) and removal of a charge from another plate (annihilation operator, a).

The operators a and a† do not commute and it turns out that difference between a*(a†) and (a†)*a is 1 or I. Also, there is something called as a resonance frequency (ω0). In the classical circuit, it is defined as 1/sqrt(LC) where L and C are inductance and capacitance, respectively. In case of the transmon qubit, it is the qubit frequency. Actually, we will see later that there will be an offset between the qubit frequency and drive frequency, but for now, let’s consider that to be qubit frequency. When we discussed about the atomic emission of light experiment, we said that the energy of the photon being emitted is directly proportional to its frequency and that the energy of the photon represents the energy difference between different energy states. Based on all that we said in the last couple of paras, it is intuitive to see that the Hamiltonian of the classical circuit and harmonic quantum oscillator can also be written as:

Also, from the definitions of operators a and a†, it is easily seen that a†*a |n> = n|n>. One can think of the state |n> as a state in which n amount of charge is being moved from one metallic plate to the other on the transmon qubit or the number of photons required to excite n charges so that they (n charges or electrons) move from one plate to the other: we saw in the atomic emission of light experiment that a photon with appropriate frequency could excite an atom to a particular energy level, an excitement to one energy level corresponds to excitement of a single charge or electron(these states form what is known as a fock space). Using this and the fact that a†*a and a*a† do not commute and their difference is 1, we can say that:

The 1/2 in the equation above is the zero point energy, which means that even if no charges are getting transferred from one plate to the other, there is some energy (total energy) in the system.

Let’s discuss a little more about ‘Zero point fluctuations (ZPF)’.

Quantum Harmonic Oscillator

In the image above, the wave at the |0> level looks like a gaussian distribution. The standard deviation of the distribution can be thought of as a combination of fluctuations in charge(Q) and magnetic flux (ϕ) at that state, with mean of both these operators as 0, which is easy to prove.

Above relations for charge(Q) and magnetic flux (ϕ) are good to know. With these relations, it is easy to prove that the mean of Q and mean of ϕ at the |0> level are 0 by showing <0|Q|0> and <0|ϕ|0> are 0.

So far, we have discussed everything for a Quantum Harmonic Oscillator, but the transmon qubit needs to be an anharmonic oscillator as we discussed before in this blog and the anharmonicity is created using a special type of an inductor called the Josephson junction. Here is how things change when we bring in the anharmonicity or non-linearity:

Energy in the Josephson junction is given by:

The PE vs flux plot would now look like:

So, to arrive at the Hamiltonian for this Quantum system, we would just have to adjust the Hamiltonian we got for quantum harmonic oscillator to take into account the non-linearity. We do this by using Taylor series expansion of cos in the energy equation of J and by some approximations. To understand this approximation at a high level, one thing to note is that we can write operator a as

This is because of the circular trajectory of the quantum harmonic oscillator we discussed earlier: On a circle x²+y²=r, every point can be written as x+iy. Since Hamiltonian of quantum harmonic oscillator was a circle in terms of Q(t) and ϕ(t), and we could also express that in terms of a, it is easier to think why a could be written as above at a particular energy level or state. So, in the expansion, we could write operators a and a† in the above form. As a result, some terms would show a rotation (e power something) and some terms won’t. The approximation would then involve removing terms involving rotation and retaining ones that don’t because the rotating terms do not contribute much to the total energy and hence, the Hamiltonian. This is called Rotating Wave Approximation (RWA). Such approximations are very common and the idea is to make the Hamiltonian simpler to deal with. I am omitting some derivations because the main idea is to get the intuition and a bigger picture. With the technique we used for quantum harmonic oscillator, the final Hamiltonian for an anharmonic oscillator would look like:

But for the transmon qubit, we only need to deal with |0> and |1> states. Even if we need to jump to higher states, we only need to hop between two consecutive phases. This means that we need to somehow get a smaller version of operators a and a†. Pauli matrices help here:

Introduction to Pulses: Theory for single qubit

So far, whatever we discussed was building up for just defining the Hamiltonian of a single transmon qubit. In order to perform operations on these qubits, we need to apply some desired external push in the form of signals or waves (photons of appropriate frequencies: a single photon of the right frequency for a single level energy excitement) so that what we apply interacts with the Hamiltonian and the energy setup of the transmon qubit to eventually end up giving us the operation we want. Here’s what this would look like:

This means that as users of a quantum computer, we might not be able to do much at the level of a transmon qubit itself, but we can control Ω(t) and this is what Qiskit pulses help us do through a driver channel. For multi qubit gates, there are control channels, but we won’t be getting into that in this blog. A nice pictorial representation of what I just mentioned is below:

What we pass as a drive signal would be discrete and therefore, the signal in the extreme left looks like how it looks. The centre signal is the qubit’s wave function. The combination of the two gives us a result that we would like to optimize to perform the desired operation. You should be realizing that with Ω(t), my overall Hamiltonian would now get affected. It won’t be just the transmon’s Hamiltonian. Typically in Qiskit, Ω(t) is considered as a simple sine wave defined as

A sine wave is simply defined as below:

This makes it easy because when deciding what we need to pass through the drive channel, we just need to decide the right amplitude, frequency, phase and also t(Duration). We don’t need to bother much about what the shape of the wave should be because it is designed to be a sine wave.

Since we are passing a signal through a drive channel which could be in the form of photons or charge (current), the Hamiltonian of the drive should also include the annihilation and creation operators. It looks like below:

Note that in the above, we have used the equivalents of the annihilation and creation operators in terms of Pauli matrices.

Combining the qubit hamiltonian and drive hamiltonian, we get:

Delta is the offset or difference between qubit frequency and drive frequency:

With all this theory, we are now finally ready to understand Qiskit Pulses practically:

Pulses: Practical usage and Challenge 4

Before getting into the challenge, let’s code something to get an idea of what we will be doing:

In the first cell, I have just imported some modules and packages, in the 2nd cell, I am just defining some style for plotting. The third cell is where we are building pulses or we are passing some type of signals through each of the drive channels. Every drive channel is connected to a qubit on the chip. So, you could think of above as you passing signals or waves to 5 qubits each connected to a drive channel. Let’s see what this gives as an output:

You should realize that what we are passing through a channel is a waveform. Above is just an example. Note that in the above, the signals don’t carry any frequency, they are just samples of 0s and 1s. Though we can call them waveforms in general, they are practically not useful to perform anything on the quantum chip. We would also prefer something similar to sine wave as described in the theory part of pulses. In Qiskit, there are some pre-defined waveforms like Gaussian, SquaredGaussian, Drag etc. These are essentially probability distributions and depending on what we pass as parameters to these, qiskit pulse would simulate and throw some discrete values (samples) which would constitute a waveform. We can create custom waveforms or we could pass the built-in ones I mentioned. One could also combine various built-in ones to get a customized waveform. This has lots of benefits. The backends already have calibrated pulses for various native gates. Someone could play around with these pulses and come up with something that is less susceptible to external noise. This would just make the quantum hardware more capable of handling noise.

If we are building pulses, we need to work with actual hardware. For the challenge, we were given access to this backend called ibm_jakarta. Here’s how an account can be assigned to a ibm backend, provided the account is given access to the backend:

Next, we try finding a little about our backend:

For the challenge, we dealt with the qubit that was connected to drive channel indexed as 0 (d0), so we take the qubit as 0. You will notice, we found something called Sampling time (dt). That is an attribute of the backend. It is basically the time difference between two samples of the simulated waveform. You will soon see that Duration is seen in the units of dt and this means that number of samples in a waveform is actually equal to the duration. In fact, in the first simple example, you can see that already. Next, we find the native gates for which the backend already has some calibrated pulses. The set we see here in ibm_jakarta are usually the ones that are calibrated in all the backends.

Next in the challenge notebook, we found the calibrated pulses for measure gate. The calibrated pulses for measure would appear on the measurement channel when we draw it. Measurement channels are actually connected to the readout resonators on the chip as we discussed in this blog. Here’s the code for it:

Let’s understand this drawing a bit. In general, the pulse schedule diagrams look like below:

d refers to drive channels, m to measurement channels, u to control channels and a to acquire channels. For each type of channel, there is a specific color coding of the pulses being passed through them (in acquire channels, no pulses are passed, they are just set of wires connected to readout resonators for the purpose of storing and digitizing data). You will also notice shades of colors. For example, I see a bright blue and a dark blue pulse on d1. The samples of a waveform are complex numbers, which means that the waveform can have a real and a complex component. The bright shows the real part and the dark shows the imaginary part. In the above case, the pulses on d1 coincidentally only have either a real part or an imaginary part. In reality, there can be overlap of the shades on the same pulse which means it has both the real and imaginary parts.

Let’s see what we can understand from calibrated pulses of Pauli x gate. For this purpose, I used ibmq_armonk backend, which is available for everyone since I no longer have access to ibm_jakarta, though in the challenge, we used ibm_jakarta.

Though the waveform is of the type Drag, it looks similar to a gaussian distribution. If we go by the documentation of Drag pulses, it is actually meant to be similar to a Gaussian pulse with some adjustments. (https://qiskit.org/documentation/stubs/qiskit.pulse.Drag.html). If we want to look at the samples of this waveform, we could create a Drag pulse with the same parameters. Let’s do that.

The number of samples is the same as the duration, as we expected.

Now, just for a while, let’s go and look at the Hamiltonian we got earlier which comprised of the qubit and drive Hamiltonian taken together:

The first term in the hamiltonian is that which corresponds to the qubit, but the frequency is offset by the drive frequency (delta = qubit frequency — drive frequency) and the second term corresponds to the drive hamiltonian. The Hamiltonian can more simply be written as:

This means that if the delta in the first term is 0 (which is only possible if the qubit frequency = drive frequency), then the second term alone would just cause a rotation about x-axis. This condition is referred to as ‘on resonance’: ‘The drive frequency is on resonance with the qubit frequency’. If delta is not 0, the first term would contribute to a rotation about z-axis, which is just a phase shift if you see the 2*2 matrix corresponding to rz operation. This means that the drive frequency plays a key role in deciding the type of rotation. For any rotation, about x axis, we would require the drive frequency to be same as the qubit frequency and finding this frequency to build appropriate pulses would be crucial.

An important point to note here. When we say rotation of a qubit, a rotation is not literally happening on the quantum chip. Recall that when we came up with the Hamiltonian, we used Pauli matrices so that we get smaller versions of the matrices corresponding to annihilation and creation operators. Annihilation and creation operators are just representing transfer from or to one of the two metallic plates in our qubit design. So the pulses we pass are causing some excitations of the charges in order to perform an annihilation or creation. The charge can only be in its discrete energy states, but the pulses could still be such that they cause slight excitation which we denote through superpositions and the superpositions are important because what we are usually interested in is the discrete energy state the charge is in after a sequence of pulses, each causing some excitation. Luckily for us, since these kind of excitations can be expressed as matrices, it becomes easier to think in terms linear algebra and rotations around Bloch sphere. So, one could think of excitations of charge along a certain axis as rotation about x-axis and similar for rotation about z-axis (like how rz causes phase shifts, in terms of transmon qubits, that’s just change of orientation of charge).

Let’s also look at the calibrated pulses for other native gate sets. The proposed gate sets are only x, sx, cx and rz (which you also saw in challenge 1). However, the backends still consider u1,u2,u3 as native gates. u1 is same as rz and u2, u3 can easily be written in terms of rz and sx, which is also given in the challenge notebook.

Both sx and x are calibrated with Drag pulses, with the only difference being in the amplitude. You will notice that the only difference in the pulses between sx and x is the amplitude and the beta (which adjusts the amplitude). This means that amplitude is also an important factor in deciding the type of rotation.

Note that a rotation about Y axis can be achieved by a combination of rotations about x and z axis. So, we won’t need to consider that separately.

rz rotation doesn’t really involve a pulse, it is just a phase shift. A phase shift is created using a technique called frame change which creates virtual rz. I am yet to learn more about that, but on the schedule plot, a phase shift looks like a circular arrow like below:

Note the schedule of the u3 gate. We know how it can be implemented in terms of rz and sx. The pulse for every subsequent gate starts at the end of the duration of the previous gate. For eg: it starts with a rz (phase shift) at 0. Since phase shift is not a pulse and does not involve duration, the following sx gate also starts at 0 and has a duration of 320. The subsequent rz starts at 320 and so on. This means that while building schedules, the start and end point of a pulse in it matters.

Let’s get into the challenge now:

The challenge notebook starts with a solved question on finding the right frequency for |0> to |1> transition for Pauli X gate. Since Pauli X gate is a rotation by angle pi about x axis, all we want is that the drive frequency should be same as the qubit frequency, as we discussed above. This ends up being an optimization problem, where we ‘sweep’ over a set of frequencies. Typically in an optimization problem, it’s important that we also choose appropriate set of values to sweep over, but in our case, it was made simpler by a helper module. All we needed was to provide a center frequency we already got from the backend in one of the code snippets above. See the entire code for this below:

The frequencies obtained from the helper module look like below, they are close to the center frequency specified, as expected:

The schedules are executed as jobs on the backend, after which we need to optimize. But what function do we optimize? Often a Lorentzian function is chosen. If we you have studied Statistics, you might have heard about Cauchy distribution. Lorentzian function is Cauchy distribution. The function for our use case looks like:

The code and the results are below. The helper module helped us again.

Why do we want a cauchy distribution? The idea is that we want to find a frequency for which the probability of transition from |0> to |1> is maximum, given the amplitude. Why are we so sure that this would result in the desired frequency? It is because we will start with an amplitude and a guessed frequency that are almost correct for a X gate. You might be thinking that a lot of things here start with proper guesses and we also adjusted the duration of gaussian pulse based on what we got for the calibrated Drag pulses. So, it might seem like we are not doing much. I think the idea here is that we would be improvising on what is already existing and known, and that makes sense (although here, we are not trying to improve the X pulses, but that’s the motivation for tasks where the goal would be to improvise). This is a simpler task, but there can be more complicated gates like a Swap gate and it’s constantly being researched upon how one can improve gates like these. Even there, I think the initial idea would be to use a combination of existing calibrations of native gates, try improvising on the existing ways in which pulses are scheduled for swap gates and then, later try customized pulses. Below is a check of how correct our new frequency from optimization is.

Once we get the right frequency, we would like to get the the right amplitude. Again, we would sweep over a set of amplitudes around an initial almost correct guess. The function we fit here would be a simple sine wave function. We just want the amplitude for which the period of the sine wave is the angle pi.

The code snippets are below:

The actual challenge was to find the right frequency for a transition from |1> to |2> so that we get a qutrit instead of a qubit. We already have the right frequency and amplitude for Gaussian pulse to transition from |0> to |1>. For transition from |1> to |2>, we would again perform a frequency sweep after we have applied the gaussian pulse to move from |0> to |1>. What helps us here is the fact that we can set a frequency multiple times in a schedule. After a frequency is set, all pulses would have that frequency, till we set another frequency within the schedule. Code snippets below:

We would again be optimizing Lorentzian function:

With this, I end this blog. Hope you liked reading it. I would like to mention, we only covered a simple hamiltonian for a single qubit. There are many other types of hamiltonians that take into account qubit-qubit interactions, qubit-readout resonator interactions etc.

For more details on transmon qubits, you could check out lectures 16 to 21 and labs 6 and 7 from Qiskit Global Summer School 2020 (https://qiskit.org/learn/intro-qc-qh/). You could also check out Qiskit Metal : https://qiskit.org/metal/ and https://youtube.com/playlist?list=PLOFEBzvs-VvqHl5ZqVmhB_FcSqmLufsjb. For more on pulses, you could go through chapter 6 from qiskit textbook: https://qiskit.org/textbook/ch-quantum-hardware/index-pulses.html

--

--

Grishma Prasad

I am deeply passionate about learning and doing everything in complete depth. My interests are Science, Technology and Mathematics.