In this section you will meet the qubit. You will also see a bit of mathematical notation, including some concepts from linear algebra. A qubit is a quantum system consisting of two levels, labeled and (here we are using Dirac’s bra-ket notation). It is represented by a two-dimensional vector space over the complex numbers . This means that a qubit takes two complex numbers to fully describe it. The computational (or standard) basis corresponds to the two levels and , which correspond to the following vectors:
The qubit does not always have to be in either or ; it can be in an arbitrary quantum state, denoted , which can be any superposition of the basis vectors. The superposition quantities and are complex numbers; together they obey .
Interesting things happen when quantum systems are measured, or observed. Quantum measurement is described by the Born rule. In particular, if a qubit in some state is measured in the standard basis, the result 0 is obtained with probability , and the result 1 is obtained with the complementary probability . Interestingly, a quantum measurement takes any superposition state of the qubit, and projects it to either the state or the state , with a probability determined from the parameters of the superposition.
What we have described here is the abstract notion of a qubit. The prototype quantum computer you interact with in IBM Quantum Experience uses a physical type of qubit called a superconducting transmon qubit, which is made from superconducting materials such as niobium and aluminum, patterned on a silicon substrate. Physically, for this superconducting qubit to behave as the abstract notion of the qubit, the device must be at drastically low temperatures. In the IBM Quantum Lab, we keep the temperature so cold (15 milliKelvin in a dilution refrigerator) that there is no ambient noise or heat to excite the superconducting qubit. Once our system has gotten cold enough, which takes several days, the superconducting qubit reaches equilibrium at the ground state .
To get a sense for what “ground state” means, try running the first score file below in simulation mode (or look at some cached runs on the real device). Here, the qubit is initially prepared in the ground state , then is followed by the standard measurement. From your execution results, you should find in the simulation mode (and with very high probability for runs using the real device) that the qubit is still in the ground state. Any errors in the real device are due to imperfect measurements and/or residual heating of the qubit.
//Single Q Measurement OPENQASM 2.0; include "qelib1.inc"; // Register declarations qreg q; creg c; // Quantum Circuit measure q -> c;
# single_q_measurement.py from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer # Define the Quantum and Classical Registers q = QuantumRegister(1) c = ClassicalRegister(1) # Build the circuit single_q_measurement = QuantumCircuit(q, c) single_q_measurement.measure(q, c) # Execute the circuit job = execute(single_q_measurement, backend = Aer.get_backend('qasm_simulator'), shots=1024) result = job.result() # Print the result print(result.get_counts(single_q_measurement))
As you may have guessed, we need to be able to put the qubit in other states. To do this, we require the concept of a quantum gate. A single-qubit quantum gate is a unitary matrix (since quantum gates must be reversible and preserve probability amplitudes, the matrices must be unitary). The quantum state after the action of the gate is found by multiplying the original quantum state by the gate . Here represents the gate.
The simplest quantum gate is the bit-flip gate, which we denote by . It takes ; in other words, it flips the zero to a one, or vice versa. This is similar to a classical NOT gate and has a matrix representation of
In the Composer it is given by a green gate with a X in the middle (see the example score file below). Try running it. Did you find that, unlike in the example above, the qubit ended up in the excited state (with high probability if you used the real device)?
//Excited State OPENQASM 2.0; include "qelib1.inc"; // Register declarations qreg q; creg c; // Quantum Circuit x q; measure q -> c;
# excited_state.py from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer # Define the Quantum and Classical Registers q = QuantumRegister(1) c = ClassicalRegister(1) # Build the circuit excited_state = QuantumCircuit(q, c) excited_state.x(q) excited_state.measure(q, c) # Execute the circuit job = execute(excited_state, backend = Aer.get_backend('qasm_simulator'), shots=1024) result = job.result() # Print the result print(result.get_counts(excited_state))