Lesson 09: Hardware
Masao Tokunari and Tamiya Onodera (June 14, 2024)
1. Introduction
This lesson explores modern quantum computing hardware. It is based on a live course delivered at the University of Tokyo. The pdf of the original lecture has been split into two parts. Click here to download the first part; click here to download the second.
A Jupyter notebook containing this lesson can be downloaded here.
We will start by verifying some versions and importing some relevant packages.
Output:
'1.3.2'
No output produced
2. Backend and Target
Qiskit provides an API to obtain the information, both static and dynamic, about a quantum device. We use a Backend instance to interface with a device, which includes a Target instance, an abstract machine model that summarizes the pertinent features such as its instruction set architecture (ISA) and any properties or constraints associated with it. Let us use these backend instances to get some of the information you see on device cards at IBM Quantum Platform. To begin with, we create a Backend instance for a device of interest. In the following, we pick "ibm_kyoto" or "ibm_kawasaki". Your access to systems may differ; please update the backend name accordingly.
No output produced
We start with some basic (static) information about the device.
Output:
ibm_kyoto, 127 qubits
processor type = {'family': 'Eagle', 'revision': 3}
basis gates = ['ecr', 'id', 'rz', 'sx', 'x']
2.1 Exercise
Please try to get the basic information about a Heron device, "ibm_torino". Try this on your own, but code has been added below for you to check yourself.
Output:
ibm_kyoto, 133 qubits
processor type = {'family': 'Heron', 'revision': '1'}
basis gates = ['cz', 'id', 'rz', 'sx', 'x']
2.2 Coupling map
We now draw the coupling map of the device. As you can see, nodes are qubits which are numbered. Edges indicate pairs to which you can directly apply the 2-qubit entangling gate. The topology is called a "heavy-hex lattice".
Output:
3. Qubit properties
The Eagle device has 127 qubits. Let us obtain the properties of some of them.
Output:
0: IBMQubitProperties(t1=0.00017895216464852194, t2=2.7872333647872527e-05, frequency=4908273696.752002, anharmonicity=-308028796.19250304)
1: IBMQubitProperties(t1=0.00017056933100462052, t2=6.395628180989257e-05, frequency=4855741912.991901, anharmonicity=0)
2: IBMQubitProperties(t1=0.0002521541563211714, t2=4.655407621146296e-05, frequency=4733159478.631846, anharmonicity=-310921510.038521)
3: IBMQubitProperties(t1=0.00021597254001486834, t2=3.3023722692492295e-05, frequency=4819802515.847228, anharmonicity=-310554007.4950158)
4: IBMQubitProperties(t1=0.0003792838769526923, t2=6.170366099801151e-05, frequency=4854350003.879539, anharmonicity=-310425142.8610955)
Let us calculate the median of T1 times of the qubits. Please compare the result to the one shown for the device at the IBM Quantum Platfrom.
Output:
'Median T1: 219.63 μs'
3.1 Exercise
Pease calculate the median of T2 times of the qubits. Try this on your own, but code has been added below for you to check yourself.
Output:
'Median T2: 106.80 μs'
3.2 Gate and readout errors
We now turn to gate errors. To begin with, we study the data structure of the target instance. It is a dictionary whose keys are operation names.
Output:
dict_keys(['id', 'rz', 'sx', 'x', 'ecr', 'reset', 'measure', 'if_else', 'for_loop', 'switch_case', 'delay'])
Its values are also dictionaries. Let us look at some of the items of the value (dictionary) for the 'sx' operation.
Output:
0 (0,) InstructionProperties(duration=6e-08, error=0.0007878795220377349, calibration=Schedule sx)
1 (1,) InstructionProperties(duration=6e-08, error=0.0002937598876229645, calibration=Schedule sx)
2 (2,) InstructionProperties(duration=6e-08, error=0.0004759036904098471, calibration=Schedule sx)
3 (3,) InstructionProperties(duration=6e-08, error=0.0005533548651630933, calibration=Schedule sx)
4 (4,) InstructionProperties(duration=6e-08, error=0.0002496155310477089, calibration=Schedule sx)
Let us do the same for the 'ecr' and 'measure' operations.
Output:
0 (49, 55) InstructionProperties(duration=6.6e-07, error=0.014964527571023872, calibration=Schedule ecr)
1 (73, 66) InstructionProperties(duration=6.6e-07, error=0.006687167435070918, calibration=Schedule ecr)
2 (83, 92) InstructionProperties(duration=6.6e-07, error=0.01741524391808172, calibration=Schedule ecr)
3 (99, 100) InstructionProperties(duration=6.6e-07, error=0.012069632695007937, calibration=Schedule ecr)
4 (122, 111) InstructionProperties(duration=6.6e-07, error=0.04685445030918056, calibration=Schedule ecr)
Output:
0 (0,) InstructionProperties(duration=1.4e-06, error=0.20520000000000005, calibration=Schedule measure)
1 (1,) InstructionProperties(duration=1.4e-06, error=0.12070000000000003, calibration=Schedule measure)
2 (2,) InstructionProperties(duration=1.4e-06, error=0.006699999999999928, calibration=Schedule measure)
3 (3,) InstructionProperties(duration=1.4e-06, error=0.14979999999999993, calibration=Schedule measure)
4 (4,) InstructionProperties(duration=1.4e-06, error=0.048699999999999966, calibration=Schedule measure)
As you can see, the errors of readout tend to be larger than those of the 2-qubit operation, which in turn tend to be larger than the 1-qubit operation.
Having understood the data structures, we are ready to calculate the median errors for the 'sx' and the 'ecr' gates. Again, please compare the results with the ones shown for the device at the IBM Quantum Platfrom.
Output:
'Median SX error: 2.938e-04'
Output:
'Median ECR error: 9.036e-03'
3.3 Exercise
Please calculate the median readout error for the device. Try this on your own, but code has been added below for you to check yourself.
Output:
'Median readout error: 1.580e-02'
Next, we look at the calibration attribute of the InstructionProperties. Intriguingly, you can get the pulse shape of the instruction! Let us check that of the 'sx' instruction for Qubit 0.
Output:
Schedule((0, Play(Drag(duration=120, sigma=30, beta=-0.12211872788895639, amp=0.06649890340064671, angle=-0.0017386463482104903, name='X90p_d0'), DriveChannel(0), name='X90p_d0')), name="sx")
3.4 Exercise
Please check the pulse shape of the 'ecr' instruction of Edge between Qubit 122 and 111. Try this on your own, but code has been added below for you to check yourself.
Output:
Schedule((0, Play(GaussianSquare(duration=600, sigma=32, width=472, amp=0.05070872163887478, angle=-0.03362374994115896, name='CR90p_d111_u277'), DriveChannel(111), name='CR90p_d111_u277')), (0, Play(GaussianSquare(duration=600, sigma=32, width=472, amp=0.15236209230548664, angle=1.0481626155944523, name='CR90p_u277'), ControlChannel(277), name='CR90p_u277')), (600, Play(Drag(duration=120, sigma=30, beta=0.04737411784577393, amp=0.18973223643805526, angle=0.0, name='Xp_d122'), DriveChannel(122), name='Xp_d122')), (720, Play(GaussianSquare(duration=600, sigma=32, width=472, amp=0.05070872163887478, angle=3.107968903648634, name='CR90m_d111_u277'), DriveChannel(111), name='CR90m_d111_u277')), (720, Play(GaussianSquare(duration=600, sigma=32, width=472, amp=0.15236209230548664, angle=-2.0934300379953408, name='CR90m_u277'), ControlChannel(277), name='CR90m_u277')), name="ecr")
This is just the beginning of what you can do with Backend and Target. You could find much, much more in the documentation of these classes.
Furthermore, we note that, using Qiskit Experiment, you can run characterization and calibration experiments through Qiskit, but it is beyond the scope of this course.
4. Appendix
A popular feature of Qiskit is its visualization capability. It includes circuit visualizers, state and distribution visualizers, and target visualizer. You already used the first two in the previous jupyter notebooks. Let us use some capabilities of the target visualizer.
Output:
Output:
Was this page helpful?